import { type StudioElementPayload } from './element-payload'; import type { StudioProtocolFetcher } from './studio-discovery'; export type InstallInStudioErrorCode = 'unsupported-origin' | 'no-compatible-studio' | 'loopback-network-permission-denied' | 'studio-upgrade-required' | 'no-installable-target' | 'unsupported-protocol' | 'invalid-response' | 'target-expired' | 'request-rejected' | 'request-timed-out' | 'network-error'; export type InstallInStudioResult = { readonly success: true; readonly status: 'awaiting-confirmation'; readonly target: { readonly projectName: string | null; readonly compositionId: string; readonly studioOrigin: string; readonly studioVersion: string; }; } | { readonly success: false; readonly code: InstallInStudioErrorCode; readonly message: string; }; type LoopbackPermissionName = 'loopback-network' | 'local-network-access'; type PermissionQueryFn = (descriptor: { readonly name: LoopbackPermissionName; }) => Promise<{ readonly state: PermissionState; }>; export type InstallInStudioDependencies = { readonly fetchFn: StudioProtocolFetcher; readonly now: () => number; readonly ports: readonly number[]; readonly pageOrigin: string | null; readonly permissionQueryFn: PermissionQueryFn | null; }; export type StudioProtocolInstallRequest = { readonly operation: 'install-element'; readonly protocol: 'remotion-studio-protocol'; readonly protocolVersion: 1; readonly targetId: string; readonly payload: StudioElementPayload; }; export declare const parseStudioProtocolIframeInstallRequest: (value: unknown) => StudioElementPayload | null; export declare const parseStudioProtocolInstallRequest: (value: unknown) => { readonly status: "valid"; readonly request: StudioProtocolInstallRequest; } | { readonly status: "invalid-payload" | "invalid-request"; }; export declare const isAllowedStudioProtocolPageOrigin: (origin: string | null) => boolean; export declare const installInStudioWithDependencies: (payload: StudioElementPayload, dependencies: InstallInStudioDependencies) => Promise; export declare const installInStudio: ({ payload, }: { readonly payload: StudioElementPayload; }) => Promise; export {};