export type PlaygroundBridgeVersion = "0.1.0"; export type PlaygroundCapability = "viewer.read" | "spot.read" | "strings.resolve" | "diagnostics.write" | "ui.confirm" | "devices.read" | "devices.execute" | "records.read" | "records.append" | "records.delete" | "scripts.status.read" | "files.request" | "facility.print.state" | "facility.print" | "records.payerCandidates.read" | "data.query"; export type PlaygroundBridgeMethod = "viewer.get" | "spot.get" | "t" | "diag.ready" | "diag.error" | "ui.confirm" | "records.consent" | "records.list" | "records.append" | "records.delete" | "devices.list" | "devices.execute" | "scripts.status" | "files.request" | "facility.print.state" | "facility.print.submit" | "facility.print.list" | "facility.print.cancel"; export type PlaygroundJsonPrimitive = string | number | boolean | null; export type PlaygroundJsonValue = PlaygroundJsonPrimitive | readonly PlaygroundJsonValue[] | { readonly [key: string]: PlaygroundJsonValue }; export type PlaygroundEditableValueV0 = string | number | boolean; export interface PlaygroundDeviceStateV0 { readonly availability: "AVAILABLE" | "UNREACHABLE" | "UNAVAILABLE"; readonly power: "ON" | "OFF" | "UNKNOWN"; readonly brightnessPercent: number | null; readonly colorTemperatureMired: number | null; readonly observedAt: string | null; } export interface PlaygroundDeviceMaintainContextV0 { readonly label: string; readonly bandStartTime: string; readonly targetParams: Readonly>; readonly lastEvaluatedAt: string | null; readonly lastAppliedAt: string | null; } export interface PlaygroundDeviceActionV0 { readonly actionRef: string; readonly domain: "LIGHT" | "PLUG" | "SCENE"; readonly action: string; readonly label: string; readonly presenceRequired: boolean; readonly paramsSchema: unknown; readonly state: PlaygroundDeviceStateV0 | null; readonly maintainContexts: readonly PlaygroundDeviceMaintainContextV0[]; } export interface NihoPlaygroundSdkV0 { viewer: { get(): Promise<{ role: "MEMBER" | "HOST"; language: string; prefersReducedMotion: boolean; prefersHighContrast: boolean }> }; spot: { get(): Promise<{ displayName: string; theme: "LIGHT" | "DARK" | "SYSTEM" }> }; settings: { get(key: string): PlaygroundEditableValueV0 | undefined }; t(key: string, params?: Readonly>): string; diag: { ready(): Promise; error(input: { code: string; recoverable: boolean }): Promise }; ui: { confirm(input: { title: string; message: string; confirmLabel: string; cancelLabel: string; intent: "DEFAULT" | "DESTRUCTIVE" }): Promise }; readonly devices: { list(): Promise<{ readonly actions: readonly PlaygroundDeviceActionV0[] }>; execute(input: { actionRef: string; params?: Readonly> }): Promise<{ readonly ok: true }>; }; readonly files: { request(input: { purpose: "PRINT" | "HOST_SUBMISSION" }): Promise<{ readonly fileRef: string }>; }; readonly records: { consent(input: { collectionKey: string; schemaVersion: number }): Promise<{ readonly ok: true }>; list(input: { collectionKey: string; cursor?: string; limit?: number }): Promise<{ readonly records: readonly { readonly id: string; readonly data: Readonly>; readonly createdAt: string; readonly authoredByViewer: boolean }[]; readonly nextCursor: string | null; readonly totalCount: number }>; append(input: { collectionKey: string; data: Readonly> }): Promise<{ readonly record: { readonly id: string; readonly data: Readonly>; readonly createdAt: string; readonly authoredByViewer: boolean } }>; delete(input: { collectionKey: string; recordId: string }): Promise<{ readonly ok: true }>; }; } declare global { const niho: NihoPlaygroundSdkV0; }