import type { ComponentType } from 'react'; export declare const NATIVE_PREVIEW_PROTOCOL_VERSION: 1; export declare const NATIVE_PREVIEW_HOST_API_VERSION: "uds-native-1"; /** Advertised by realtime servers that can create Sidecar pairing sessions. */ export declare const NATIVE_PREVIEW_REALTIME_CAPABILITY: "native-preview-v1"; /** Shared preview bundles read host-owned runtime packages from this table. */ export declare const PREVIEW_DEPENDENCIES_GLOBAL: "__UDS_PREVIEW_DEPS__"; export declare const NATIVE_PREVIEW_REGISTER_GLOBAL: "__UDS_NATIVE_PREVIEW_REGISTER__"; export declare const NATIVE_PREVIEW_AWARENESS_ROLE_FIELD: "nativePreviewRole"; export declare const NATIVE_PREVIEW_AWARENESS_CAPABILITIES_FIELD: "nativePreviewCapabilities"; export type NativePreviewAwarenessRole = 'controller' | 'renderer'; export declare function hasNativePreviewAwarenessRole(state: unknown, role: NativePreviewAwarenessRole): boolean; export type NativePreviewPlatform = 'ios' | 'android'; export type NativePreviewTargetKind = 'component' | 'design'; /** The part of a Y.Map used by the native-preview wire protocol. */ export interface NativePreviewRoomReader { get(key: string): unknown; has(key: string): boolean; } /** The mutable part of a Y.Map used by Studio's native-preview controller. */ export interface NativePreviewRoomWriter extends NativePreviewRoomReader { delete(key: string): unknown; set(key: string, value: unknown): unknown; } export interface NativePreviewRoomPayload { readonly releaseId: string; readonly bundlePath: string; readonly bundleSha256Ios: string; readonly bundleSha256Android: string; readonly deliveryToken: string; readonly requirements: string; readonly targetKind: NativePreviewTargetKind; readonly targetLabel: string; readonly componentName: string; readonly branchName: string; readonly spec: string | undefined; } export interface NativePreviewRoomDelivery { readonly releaseId: string; readonly bundlePath: string; readonly bundleSha256: string; readonly deliveryToken: string; readonly requirements: string; } export interface NativePreviewRoomSnapshot { readonly sessionClosed: boolean; readonly revision?: number; readonly kind: NativePreviewTargetKind; readonly label?: string; readonly branchName?: string; readonly spec?: unknown; readonly specError?: string; readonly delivery?: NativePreviewRoomDelivery; } /** * Read the preview-room wire format once for every Sidecar consumer. * * `componentName` is the v1 label key. The fallback keeps a newer host * compatible with rooms created before design-file targets were introduced. */ export declare function readNativePreviewRoom(room: NativePreviewRoomReader, platform: NativePreviewPlatform): NativePreviewRoomSnapshot; /** * Copy a Studio target into the room only when delivered content changed. * `revision` is the Sidecar render signal, so equivalent edits are true no-ops. */ export declare function syncNativePreviewRoom(room: NativePreviewRoomWriter, payload: NativePreviewRoomPayload, revision?: number): boolean; export interface NativePreviewBundleEntry { readonly artifact: string; readonly bytes: number; readonly sha256: string; } export interface NativePreviewAssetEntry extends NativePreviewBundleEntry { readonly mediaType: string; readonly path: string; } export interface NativePreviewDependencyRequirement { readonly name: string; readonly version: string; readonly platforms: readonly NativePreviewPlatform[]; /** Exact import paths the finished bundle reads from the host registry. */ readonly moduleSpecifiers: readonly string[]; } /** Capabilities advertised by the particular native host in a preview room. */ export interface NativePreviewHostCapabilities { readonly hostName: string; readonly hostVersion?: string; readonly platform: NativePreviewPlatform; /** Package roots exposed to evaluated preview bundles, with host versions. */ readonly dependencies: Readonly>; /** Exact import paths exposed by this host. */ readonly moduleSpecifiers: readonly string[]; } export interface NativePreviewCompatibilityIssue { readonly name: string; readonly requiredVersion: string; readonly providedVersion?: string; readonly reason: 'missing' | 'missing-module' | 'version-mismatch'; } /** Read a renderer's additive capability advertisement from awareness state. */ export declare function nativePreviewHostCapabilitiesFromAwareness(state: unknown): NativePreviewHostCapabilities | undefined; /** Compare one build's requirements with the host that is actually connected. */ export declare function nativePreviewCompatibilityIssues(requirements: readonly NativePreviewDependencyRequirement[], capabilities: NativePreviewHostCapabilities): NativePreviewCompatibilityIssue[]; /** A registered component replaced by a placeholder in the phone bundle. */ export interface NativePreviewComponentFailure { readonly component: string; readonly reason: string; } export interface NativePreviewBuildManifest { readonly schemaVersion: 1; readonly protocolVersion: typeof NATIVE_PREVIEW_PROTOCOL_VERSION; readonly hostApiVersion: typeof NATIVE_PREVIEW_HOST_API_VERSION; readonly configSha256: string; readonly platforms: Readonly>; readonly requirements: readonly NativePreviewDependencyRequirement[]; readonly assets: readonly NativePreviewAssetEntry[]; readonly componentFailures?: readonly NativePreviewComponentFailure[]; } export type NativePreviewRenderer = ComponentType<{ spec: unknown; }>; export interface NativePreviewModule { readonly bundleId: string; readonly protocolVersion: typeof NATIVE_PREVIEW_PROTOCOL_VERSION; readonly hostApiVersion: typeof NATIVE_PREVIEW_HOST_API_VERSION; readonly UdsRenderer: NativePreviewRenderer; } export type NativePreviewParseResult = { readonly ok: true; readonly value: T; } | { readonly ok: false; readonly error: string; }; export declare function parseNativePreviewModule(value: unknown): NativePreviewParseResult; export declare function isNativePreviewBuildManifest(value: unknown): value is NativePreviewBuildManifest; export declare function isNativePreviewDependencyRequirement(value: unknown): value is NativePreviewDependencyRequirement;