import { type CharacterIndicator } from "./interaction.js"; import { type CharacterRendererFactory } from "./renderer.js"; import type { RuntimeStyleAsset } from "./styles.js"; import { type DiagnosticRecord, type EmitResult, type HostContent, type HostBindings, type NativeManifest, type NormalizedPack, type Point, type PeeklingPreset, type Plan, type OverrideHandle, type OverrideInput, type SurfaceTheme, type TargetAnchor } from "./types.js"; export type PeeklingPosition = "bottom-left" | "bottom-right" | "center" | Readonly; export type PeeklingPressAction = "toggle-content" | "show-content" | "hide-content" | "emit" | "none"; export type PeeklingMotionPreference = "system" | "full" | "reduce"; export interface PeeklingInteractionOptions { /** Defaults to toggle-content. Setting pressEvent defaults this to emit. */ press?: PeeklingPressAction; /** Bounded application Event emitted by the emit press action. */ pressEvent?: string; drag?: boolean; throw?: boolean; dragState?: string; riseState?: string; fallState?: string; landState?: string; gravity?: number; maxThrowSpeed?: number; bounce?: number; floorInset?: number; label?: string; contentInitiallyHidden?: boolean; clearIndicatorOnPress?: boolean; catchTarget?: string; catchAnchor?: TargetAnchor; catchMargin?: number; catchEvent?: string; } export type PeeklingIndicator = CharacterIndicator; export interface PeeklingOptions { /** Serializable options contract version. Defaults to 1. */ format?: 1; /** Explicit registered character selection. character, pack, or packUrl is required. */ character?: string; pack?: NativeManifest | NormalizedPack; /** Relative or absolute HTTPS manifest candidate checked semantically. */ packUrl?: string; /** Byte-identical atlas mirror. density is required for variant Packs. */ atlasUrl?: string; /** Relative or absolute HTTPS stylesheet candidate checked semantically. */ styles?: RuntimeStyleAsset; /** Host-owned immutable Plan. Packs remain data-only. */ plan?: Plan; /** Named simple behavior compiled into the same canonical Plan. */ preset?: PeeklingPreset; /** Host-approved element geometry available to target-aware motion. */ targets?: Readonly>; /** Direct manipulation is enabled by default. Set false to remove the hit target. */ interaction?: false | PeeklingInteractionOptions; /** Optional notification state rendered on the owned character hit target. */ indicator?: PeeklingIndicator; /** Host-owned accessible text and links referenced by plan contentId values. */ content?: HostContent; /** Property-only host surface mounts. */ bindings?: HostBindings; theme?: SurfaceTheme; accessibility?: { announceContent?: boolean; contentLabel?: string; }; diagnostics?: { /** Omit for error-only console output, true for all records, or false for none. */ console?: boolean; debug?: boolean; context?: Readonly>; }; /** Property-only vendor-neutral structured diagnostic sink. */ logger?: (record: Readonly) => void; /** Hidden by default. True uses the validated manifest title. */ name?: boolean | string; scale?: number; /** Initial center position. Coordinates are CSS pixels and clamp to the viewport. */ position?: PeeklingPosition; density?: 1 | 2 | 4; maxDensity?: 1 | 2 | 4; /** Defaults to system. Hosts may explicitly request full or reduced motion. */ motionPreference?: PeeklingMotionPreference; onDiagnostic?: (message: string) => void; document?: Document; window?: Window; } export type PeeklingPackSelection = { character: string; } | { pack: NativeManifest | NormalizedPack; } | { packUrl: string; }; export type PeeklingHatchInput = string | (PeeklingOptions & PeeklingPackSelection); export type PeeklingFinishReason = "destroyed" | "pagehide" | "failed"; export interface PeeklingFinishResult { readonly reason: PeeklingFinishReason; } /** Owned runtime handle returned by hatch and Web Component readiness. */ export interface PeeklingInstance { readonly ready: Promise; /** Non-rejecting terminal signal that settles once after cleanup. */ readonly finished: Promise; emit(name: string, payload?: unknown): EmitResult; override(value: OverrideInput): OverrideHandle; pause(): void; resume(): void; /** Re-resolve configured target selectors after host layout changes. */ refreshTargets(): void; setIndicator(indicator: PeeklingIndicator | null): void; /** Show or hide every content surface owned by this character. */ setContentVisible(visible: boolean): boolean; /** Toggle every content surface owned by this character. */ toggleContent(): boolean; destroy(): void; } /** Package-internal implementation. It is not a supported import. */ export declare class PeeklingRuntime implements PeeklingInstance { #private; static hatch(input: PeeklingHatchInput | PeeklingOptions, rendererFactory?: CharacterRendererFactory): PeeklingRuntime; /** Package-internal presentation update used only by the Web Component. */ updateComponentName(value: PeeklingOptions["name"]): boolean; readonly ready: Promise; readonly finished: Promise; constructor(options?: PeeklingOptions, rendererFactory?: CharacterRendererFactory); emit(name: string, payload?: unknown): EmitResult; override(value: OverrideInput): OverrideHandle; pause(): void; resume(): void; refreshTargets(): void; setIndicator(indicator: PeeklingIndicator | null): void; setContentVisible(visible: boolean): boolean; toggleContent(): boolean; destroy(): void; } /** Create one independently owned companion instance. */ export declare function hatch(input: PeeklingHatchInput): PeeklingInstance; export declare function resolveInitialPosition(position: NonNullable, width: number, height: number, spriteWidth: number, spriteHeight: number): Point; //# sourceMappingURL=runtime.d.ts.map