/** One authoring contract, distributed by scaffolding and immutable codegen. * Web Studio checks its concrete exports against this contract during its build. */ export const reactPlatformTypes = `// Generated by the Quixos React platform contract. Do not edit. declare module "@quixos/web-studio-react-runtime" { import type * as React from "react"; export function useComponentOverlayContainer(): HTMLElement; export function useComponentStyleRoot(): ShadowRoot; export type ObjectRef = string & { readonly $quixosAtom: AtomId; }; export type LiveFieldProp = { value: T; source: { objectId: string; slotId: string; valueType?: string; storagePolicy?: string; revision?: string | number | bigint; crdtSnapshot?: { type: string; encoding: string; payload: string; }; }; }; export type ReactComponentHostProps = { onAction?: (action: Action) => void; fallback?: React.ReactNode; className?: string; style?: React.CSSProperties; /** Optional extra action. The host still displays and reports errors by default. */ extraErrorAction?: (error: Error) => void; }; export type ReactComponentImplementationProps = { camino: CaminoProps; render: RenderProps; dispatch: (action: Action) => void; }; export const createWebStudioComponent: < ForObject extends ObjectRef, RenderProps extends object, Action, >(config: { expectedAtomId: string }) => (props: { forObject: ForObject; } & RenderProps & ReactComponentHostProps) => any; export const invokeCapability: ( objectId: string, interfaceRevisionId: string, operationId: string, value?: unknown, options?: {clientMutationId?: string; signal?: AbortSignal}, ) => Promise; export const h: typeof React.createElement; export const useLiveField: ( field: LiveFieldProp, options?: { reconcileRegister?: (state: { confirmed: T; optimistic: T; pending: boolean; }) => T; }, ) => readonly [T, (value: T) => Promise]; } `;