import { type EveBrowserPluginAdapter } from "./fields-browser-adapter.js"; import { type EveCommandInvocation, type EveCommandResult } from "@gamecult/eve-contracts"; export { fieldsBrowserAdapter, normalizeFieldsDocument, type EveBrowserPluginAdapter } from "./fields-browser-adapter.js"; export interface EveSurfaceComponent { id?: string; kind?: string; text?: string; commandId?: string; props?: Record; layout?: Record; style?: Record; children?: EveSurfaceComponent[]; stateBindings?: EveStateBindingDescriptor[]; embeddedDocuments?: Array>; } export interface EveStateBindingDescriptor { targetProp: string; pointerId: string; sourceId: string; schemaId: string; routeKind: string; routeDescription?: string; bindingName?: string; documentId?: string; fieldPath?: string; valueKind?: "string" | "number" | "boolean" | "choice" | "string-list"; accessMode?: "read" | "write" | "read-write" | "local-draft"; authority?: string; writeCommand?: string; } export interface EveStateBindingHandle { latest(): Promise; watch(callback: (value: unknown) => void): () => void; } export type EveStateBindingResolver = (binding: EveStateBindingDescriptor, component: EveSurfaceComponent) => Promise; export interface EveSurfaceDocument { providerId?: string; title?: string; version?: number; surface?: { id?: string; title?: string; root?: EveSurfaceComponent; styles?: EveSurfaceStyles; }; mesh?: unknown; commands?: Array<{ command: string; payloadSchema?: string; captureBindings?: string[]; transport?: string; }>; } export type EveSurfaceStyles = { tokens?: Record; assets?: { fontCss?: string; }; controlSkins?: Record; } | Array<{ name?: string; value?: unknown; }>; export type EveCommandIntent = EveCommandInvocation; export type EveBrowserCommandResult = EveCommandResult; export interface EveSemanticListItem { label: string; status: string; detail: string; badges: string[]; } export interface EveSurfaceWorldInteraction { commandBoundary?: string; receiptSchema?: string; } export interface EveProviderSurfaceAdvertisement { surfaceId?: string; key?: string; status?: string; transport?: string; worldInteraction?: EveSurfaceWorldInteraction; requiresPlugins?: EvePluginRequirement[]; } export interface EvePluginRequirement { pluginId: string; versionRange?: string; availability?: "required" | "optional" | "optional-nested"; requiredCapabilities?: string[]; optionalCapabilities?: string[]; } export interface EveProviderAdvertisement { providerId?: string; surfaces?: EveProviderSurfaceAdvertisement[]; localAdvertisement?: { surfaces?: EveProviderSurfaceAdvertisement[]; }; } export interface EveBrowserLoweringOptions { activeSurfaceId?: string; assetBaseUrl?: string; assetUrlResolver?: (uri: string, surface: EveSurfaceDocument | undefined) => string; body?: HTMLElement; clientId?: string; commandSink?: (intent: EveCommandIntent, component: EveSurfaceComponent) => EveBrowserCommandResult | void | Promise; documentResolver?: (request: EveEmbeddedDocumentRequest, component: EveSurfaceComponent) => Promise; provider?: EveProviderAdvertisement; pluginAdapters?: readonly EveBrowserPluginAdapter[]; stateBindingResolver?: EveStateBindingResolver; source?: string; statusElement?: HTMLElement; draftStore?: EveBrowserDraftStore; } export interface EveBrowserProviderTransport { providerAdvertisement(): Promise; surface(surface: EveProviderSurfaceAdvertisement): Promise; submitCommand(intent: EveCommandIntent): Promise; resolveDocument?: EveBrowserLoweringOptions["documentResolver"]; resolveAssetUrl?: EveBrowserLoweringOptions["assetUrlResolver"]; } export interface EveBrowserProviderHostOptions { body?: HTMLElement; clientId?: string; pollMs?: number; requestedSurfaceId?: string; source?: string; statusElement?: HTMLElement; pluginAdapters?: readonly EveBrowserPluginAdapter[]; } export declare class EveBrowserDraftStore { private readonly values; private key; has(providerId: string, surfaceId: string, bindingName: string): boolean; get(providerId: string, surfaceId: string, bindingName: string): unknown; set(providerId: string, surfaceId: string, bindingName: string, value: unknown): void; clear(providerId: string, surfaceId: string, bindingNames?: readonly string[]): void; capture(providerId: string, surfaceId: string, bindingNames: readonly string[]): Record; } export declare const defaultBrowserPluginAdapters: readonly EveBrowserPluginAdapter[]; export declare function resolveRequiredPluginAdapters(surface: EveProviderSurfaceAdvertisement, available?: readonly EveBrowserPluginAdapter[]): readonly EveBrowserPluginAdapter[]; export declare function selectAdvertisedSurface(provider: EveProviderAdvertisement, requestedSurfaceId?: string): EveProviderSurfaceAdvertisement; export declare class EveBrowserProviderHost { private readonly host; private readonly transport; private readonly options; private active; private lastSurfaceVersion; private pollHandle; private provider; private selected; private pluginAdapters; private readonly draftStore; constructor(host: HTMLElement, transport: EveBrowserProviderTransport, options?: EveBrowserProviderHostOptions); start(): Promise; stop(): void; refresh(): Promise; private submit; private consumeCommandResult; private presentCommandStatus; } export interface EveEmbeddedDocumentRequest { documentId: string; presentationKind?: string; schemaId?: string; slotId?: string; } export interface EveResolvedDocument { document?: unknown; documentId?: string; schemaId?: string; surface?: EveSurfaceDocument["surface"]; } export interface EveProjectedWorldEntity { entityId: string; faction: string; kind: string; label: string; controlled: boolean; xPercent: number; yPercent: number; source: EveSurfaceComponent; } export declare function renderEveSurface(surface: EveSurfaceDocument, host: HTMLElement, options?: EveBrowserLoweringOptions): HTMLElement; export declare function applyEveStateBindingValue(component: EveSurfaceComponent, binding: EveStateBindingDescriptor, value: unknown): void; export declare function renderEveComponent(node: EveSurfaceComponent, options?: EveBrowserLoweringOptions): HTMLElement; export declare function projectSemanticListItem(node: EveSurfaceComponent): EveSemanticListItem; export declare function projectWorldScene(node: EveSurfaceComponent): EveProjectedWorldEntity[]; export declare function createWorldActionIntent(command: string, action: Record, options?: EveBrowserLoweringOptions): EveCommandIntent; export declare function createInventoryDropIntent(source: Record, target: Record, destinationX: number, destinationY: number, options?: EveBrowserLoweringOptions): EveCommandIntent | undefined; export interface InventoryPlacementCell { x: number; y: number; } export interface InventoryPlacementPreview { valid: boolean; reason: "valid" | "outside-grid" | "outside-valid-shape" | "occupied"; cells: InventoryPlacementCell[]; } export declare function createInventoryPlacementPreview(source: Record, target: Record, targetChildren: EveSurfaceComponent[], destinationX: number, destinationY: number): InventoryPlacementPreview; export declare function applyEveSurfaceStyles(styles: EveSurfaceStyles | undefined, body?: HTMLElement): void; export declare function createEveCommandIntent(commandId: string, props?: Record, options?: EveBrowserLoweringOptions): EveCommandIntent; export declare function emptyState(message: string): HTMLElement; export declare function projectSemanticListItems(value: unknown): EveSemanticListItem[]; export * from "./input-gestures.js";