UNPKG

goban

Version:

[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/online-go/goban)

46 lines (45 loc) 2.02 kB
import type { GobanBase } from "../GobanBase"; import { GobanSelectedThemes } from "./Goban"; export interface GobanCallbacks { defaultConfig?: () => any; getCoordinateDisplaySystem?: () => "A1" | "1-1"; isAnalysisDisabled?: (goban: GobanBase, perGameSettingAppliesToNonPlayers: boolean) => boolean; getClockDrift?: () => number; getNetworkLatency?: () => number; getLocation?: () => string; getShowVariationMoveNumbers?: () => boolean; getStoneFontScale?: () => number; getShowUndoRequestIndicator?: () => boolean; getMoveTreeNumbering?: () => "move-coordinates" | "none" | "move-number"; getCDNReleaseBase?: () => string; getSoundEnabled?: () => boolean; getSoundVolume?: () => number; watchSelectedThemes?: (cb: (themes: GobanSelectedThemes) => void) => { remove: () => any; }; getSelectedThemes?: () => GobanSelectedThemes; customBlackStoneColor?: () => string; customBlackTextColor?: () => string; customWhiteStoneColor?: () => string; customWhiteTextColor?: () => string; customBoardColor?: () => string; customBoardLineColor?: () => string; customBoardUrl?: () => string; customBlackStoneUrl?: () => string; customWhiteStoneUrl?: () => string; canvasAllocationErrorHandler?: (note: string | null, error: Error, extra: { total_allocations_made: number; total_pixels_allocated: number; width?: number | string; height?: number | string; }) => void; addCoordinatesToChatInput?: (coordinates: string) => void; updateScoreEstimation?: (est_winning_color: "black" | "white", number_of_points: number) => void; toast?: (message_id: string, duration: number) => void; } export declare const callbacks: GobanCallbacks; /** * Set's callback functions to be called in various situations. You can set any * or all of the callbacks, only the provided callbacks will be updated. */ export declare function setGobanCallbacks(newCallbacks: GobanCallbacks): void;