import { z } from "zod"; import { AntialiasTypeEnum } from "./Display.types"; import { PixiRenderer, PixiRendererInitOptions } from "./renderer/PixiRenderer"; /** * Zod schema for serialized display state. */ export declare const DisplaySchema: z.ZodObject<{ width: z.ZodNumber; height: z.ZodNumber; backgroundColor: z.ZodString; }, "strip", z.ZodTypeAny, { width: number; height: number; backgroundColor: string; }, { width: number; height: number; backgroundColor: string; }>; /** * Initialization options for the display wrapper. */ export type DisplayOptions = Partial> & { view: HTMLCanvasElement; }; /** * Manages the project canvas, renderer sizing, background rendering, and display hit-testing. */ export declare class Display { private width; private height; private backgroundColor; private antialias; renderer: PixiRenderer; /** * Creates a display wrapper with default resolution and renderer settings. */ constructor(); /** * Initializes the PIXI renderer and applies the requested display configuration. * * @param options Display initialization options, including the target canvas element. * @returns Nothing. */ init(options: DisplayOptions): void; /** * Returns the current display width. * * @returns The display width in pixels. */ getWidth(): number; /** * Returns the current display height. * * @returns The display height in pixels. */ getHeight(): number; /** * Returns the current display resolution. * * @returns The `[width, height]` tuple in pixels. */ getResolution(): [number, number]; /** * Returns the configured display background color. * * @returns The background color string. */ getBackgroundColor(): string; /** * Returns the renderer canvas element. * * @returns The canvas element, if the renderer is initialized. */ getView(): HTMLCanvasElement; /** * Returns the configured antialiasing mode. * * @returns The antialias mode. */ getAntialias(): AntialiasTypeEnum; private updateBackgroundColor; /** * Updates the display background color. * * @param color New CSS color or gradient string. * @returns Nothing. */ setBackgroundColor(color: string): void; /** * Resizes the display and notifies dependent subsystems. * * @param width New display width, in pixels. * @param height New display height, in pixels. * @returns Nothing. */ setResolution(width: number, height: number): void; private updateViewAutoLayout; /** * Returns the top-most clip under the specified cursor position. * * @param cursorX Cursor X coordinate in canvas space. * @param cursorY Cursor Y coordinate in canvas space. * @returns The matching clip ID, or `null` if no clip is hit. */ getClipIdByCursorPosition(cursorX: number, cursorY: number): string | null; /** * Destroys the renderer and recreates the DOM canvas element. * * @returns Nothing. */ destroy(): void; /** * Serializes the current display state. * * @returns The serialized display payload. */ serialize(): { width: number; height: number; backgroundColor: string; }; /** * Restores a display instance from serialized data while preserving the current canvas and antialias configuration. * * @param data Serialized display payload. * @returns The deserialized display instance. */ static deserialize(data: object): Display; }