frontend
    Preparing search index...

    Function useHeartsGame

    • Hook that manages Hearts game state and player actions.

      Returns {
          clearSelection: () => void;
          error: string | null;
          exec: (
              ...args: [
                  command: "reset"
                  | "play"
                  | "pass"
                  | "next"
                  | "nextround"
                  | "hint",
                  cardIndices?: number[],
                  cardIndex?: number,
                  config?: HeartsConfigInput,
              ],
          ) => Promise<void>;
          handleConfigChange: (key: NumberKeys<HeartsConfig>, value: string) => void;
          handleHint: () => Promise<void>;
          handleNextRound: () => void;
          handleNextTrick: () => void;
          handlePass: () => void;
          handlePlay: () => void;
          handleToggle: (key: "omnibusJD", value: boolean) => void;
          heartsConfig: HeartsConfig;
          hint: HeartsHint | null;
          hintError: string | null;
          hintLoading: boolean;
          loading: boolean;
          retry: () => Promise<void>;
          selectedCardIndices: number[];
          state: HeartsResponse | null;
          toggleCard: (idx: number) => void;
      }