import { type TurnPreset, type TurnView } from "./turn.camera.ts"; import { type TurnSettings } from "./turn.model.ts"; import type { ScoreOptions, SurfaceOptions } from "./types.ts"; /** What `mountKyogijoTurn` gives back. */ export interface KyogijoTurn { /** `3d`, or `flat` where the browser cannot draw the 3D view (or there is nothing to turn): the flat drawing is shown and the rest of this does nothing. */ readonly mode: "3d" | "flat"; /** The view now: where it is going if it is gliding. */ view(): TurnView; /** Turn to a view (the parts of it given): it glides there unless `glide` is false or the reader prefers reduced motion. */ set(view: Partial, glide?: boolean): void; /** Go to one of the four viewpoints: `overhead`, `broadcast`, `end` or `corner`. */ preset(name: TurnPreset): void; /** Back to the opening view. */ reset(): void; /** Draw again with new options (a score that moved, a look that changed), keeping the view. */ update(options: SurfaceOptions | ScoreOptions): void; /** Whether the auto-turn is running. */ readonly playing: boolean; /** Start the auto-turn, a slow turn of the whole view. It gives whether it is running (a surface that cannot turn gives `false`). Nothing turns by itself until this, the Play button or Space starts it, unless `autoPlay` asked. */ play(): boolean; /** Stop the auto-turn. */ pause(): void; /** Start the auto-turn if it is stopped and stop it if it is running; it gives whether it is running now. */ togglePlay(): boolean; /** The flat drawing that is the floor, or `null` after `destroy`. */ svg(): SVGSVGElement | null; /** Stop listening and empty the container. */ destroy(): void; } /** True where the page can draw a plane in 3D by one `matrix3d`: that is, nearly everywhere with a stylesheet. */ export declare function turnSupported(win?: { CSS?: { supports?: (property: string, value: string) => boolean; } | null; } | undefined): boolean; /** * Mount a surface as a 3D view in a container, over the static drawing it would otherwise hold: the drawing is the floor, tilted and turned by the pointer, the * touch, the wheel and the keys, with what stands on the surface (a net and its posts, a basket, a goal, the posts of a football field) standing on it. * @example * ```ts no-run * import { mountKyogijoTurn } from "@johnmorrisdotca/kyogijo-stadiums/turn"; * const view = mountKyogijoTurn(document.querySelector("#court")!, { sport: "volleyball", home: { name: "Japan", score: 3 }, away: { name: "USA", score: 2 } }, { preset: "end" }); * view.preset("corner"); * view.set({ yaw: 60, pitch: 40 }); * ``` */ export declare function mountKyogijoTurn(host: HTMLElement, options: SurfaceOptions | ScoreOptions, settings?: TurnSettings): KyogijoTurn;