import { A as StateMachine, C as StateValue, D as PromiseActorLogic, a as ActorRefFromLogic, b as RequiredActorOptions, c as AnyEventObject, g as IsNotNever, h as InputFrom, k as MachineSnapshot, m as GetConcreteByKey, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, u as ConditionalRequired, v as MetaObject, w as Values, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js"; import "./StateMachine-EDpYWy0i.js"; import { t as Manager } from "./Manager-CQQ99QOI.js"; import "./Actor-iTq7YY48.js"; import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-Vb4P9ovf.js"; //#region src/modules/document-upload/documentUploadStateMachine.d.ts declare const documentUploadMachine: StateMachine void; }, EventObject>> | ActorRefFromLogic> | undefined; }, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; }>, Values<{ setStream: { type: "setStream"; params: NonReducibleUnknown; }; setImageAndClearError: { type: "setImageAndClearError"; params: NonReducibleUnknown; }; setProgress: { type: "setProgress"; params: NonReducibleUnknown; }; setError: { type: "setError"; params: NonReducibleUnknown; }; clearError: { type: "clearError"; params: NonReducibleUnknown; }; stopStream: { type: "stopStream"; params: NonReducibleUnknown; }; }>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput, NonReducibleUnknown, EventObject, MetaObject, { readonly id: "documentUpload"; readonly initial: "idle"; readonly context: ({ input }: { spawn: { (logic: TSrc, ...[options]: ({ src: "uploadDocument"; logic: PromiseActorLogic void; }, EventObject>; id: string | undefined; } extends (infer T) ? T extends { src: "uploadDocument"; logic: PromiseActorLogic void; }, EventObject>; id: string | undefined; } ? T extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_1) ? T_1 extends { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; } ? T_1 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_1["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_1 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never)): ActorRefFromLogic void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; }>, "src", TSrc>["logic"]>; (src: TLogic, ...[options]: ConditionalRequired<[options?: ({ id?: never; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredLogicInput]: unknown; }) | undefined], IsNotNever>>): ActorRefFromLogic; }; input: DocumentUploadInput; self: ActorRef, StateValue, string, unknown, any, any>, { type: "START"; } | { type: "CAPTURE"; imageBase64: string; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CLOSE"; }, AnyEventObject>; }) => { config: DocumentUploadConfig; stream: undefined; imageBase64: undefined; progress: number; error: undefined; }; readonly states: { readonly idle: { readonly on: { readonly START: { readonly target: "initCamera"; }; }; }; readonly initCamera: { readonly invoke: { readonly id: "initCamera"; readonly src: "initCamera"; readonly input: undefined; readonly onDone: { readonly target: "capturing"; readonly actions: "setStream"; }; readonly onError: { readonly target: "error"; readonly actions: "setError"; }; }; readonly on: { readonly CLOSE: { readonly target: "closed"; }; }; }; readonly capturing: { readonly on: { readonly CAPTURE: { readonly target: "uploading"; readonly actions: "setImageAndClearError"; }; readonly CLOSE: { readonly target: "closed"; readonly actions: "stopStream"; }; }; }; readonly uploading: { readonly invoke: { readonly id: "uploadDocument"; readonly src: "uploadDocument"; readonly input: ({ context, self }: { context: DocumentUploadContext; event: { type: "START"; } | { type: "CAPTURE"; imageBase64: string; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CLOSE"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "START"; } | { type: "CAPTURE"; imageBase64: string; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CLOSE"; }, AnyEventObject>; }) => { imageBase64: string; documentType: string; onProgress: (progress: number) => void; }; readonly onDone: { readonly target: "finished"; readonly actions: "stopStream"; }; readonly onError: { readonly target: "error"; readonly actions: readonly ["setError", "stopStream"]; }; }; readonly on: { readonly UPLOAD_PROGRESS: { readonly actions: "setProgress"; }; }; }; readonly error: { readonly on: { readonly RETRY: { readonly target: "initCamera"; readonly actions: "clearError"; }; readonly CLOSE: { readonly target: "closed"; readonly actions: "stopStream"; }; }; }; readonly finished: { readonly type: "final"; }; readonly closed: { readonly type: "final"; }; }; }>; //#endregion //#region src/modules/document-upload/documentUploadActor.d.ts type CreateDocumentUploadActorOptions = { config: DocumentUploadConfig; }; //#endregion //#region src/modules/document-upload/documentUploadManager.d.ts type DocumentUploadInitializingState = { status: 'initializing'; }; type DocumentUploadCapturingState = { status: 'capturing'; stream: MediaStream; }; type DocumentUploadUploadingState = { status: 'uploading'; progress: number; }; type DocumentUploadErrorState = { status: 'error'; error: string; }; type DocumentUploadFinishedState = { status: 'finished'; }; type DocumentUploadClosedState = { status: 'closed'; }; type DocumentUploadState = DocumentUploadInitializingState | DocumentUploadCapturingState | DocumentUploadUploadingState | DocumentUploadErrorState | DocumentUploadFinishedState | DocumentUploadClosedState; declare function createDocumentUploadManager(options: CreateDocumentUploadActorOptions): Manager & { load(): void; capture(imageBase64: string): void; retry(): void; close(): void; }; type DocumentUploadManager = ReturnType; //#endregion export { type DocumentUploadConfig, type DocumentUploadManager, type DocumentUploadState, createDocumentUploadManager, documentUploadMachine };