import { FileSystemDirectoryHandle, FileSystemHandle } from 'native-file-system-adapter';
import { UserPromptResponse } from './utilities';

export declare enum WorkerResponseType {
    OLWorkerResponseDispatchEvent = "OL_WORKER_RESPONSE_DISPATCH_EVENT",
    OLWorkerResponseHandlePermission = "OL_WORKER_RESPONSE_HANDLE_PERMISSION",
    OLWorkerResponseHealthCheck = "OL_WORKER_RESPONSE_HEALTH_CHECK",
    OLWorkerResponseInit = "OL_WORKER_RESPONSE_INIT",
    OLWorkerResponseInvoke = "OL_WORKER_RESPONSE_INVOKE",
    OLWorkerResponsePickDirectory = "OL_WORKER_RESPONSE_PICK_DIRECTORY",
    OLWorkerResponsePromptUser = "OL_WORKER_RESPONSE_PROMPT_USER",
    OLWorkerResponseTakeLeadership = "OL_WORKER_RESPONSE_TAKE_LEADERSHIP"
}
type BaseResponse = {
    replyTo?: string;
};
export type InitResponse = {
    type: WorkerResponseType.OLWorkerResponseInit;
} & BaseResponse;
export type InvokeResponse = {
    error: any;
    returnValue: any;
    type: WorkerResponseType.OLWorkerResponseInvoke;
} & BaseResponse;
export type DispatchEventResponse = {
    type: WorkerResponseType.OLWorkerResponseDispatchEvent;
} & BaseResponse;
export type PickDirectoryResponse = {
    abortedByUser: boolean;
    handle: FileSystemDirectoryHandle | null;
    requireUserActivation: boolean;
    type: WorkerResponseType.OLWorkerResponsePickDirectory;
} & BaseResponse;
export type HandlePermissionResponse = {
    handle: FileSystemHandle | null;
    type: WorkerResponseType.OLWorkerResponseHandlePermission;
} & BaseResponse;
export type HealthCheckResponse = {
    type: WorkerResponseType.OLWorkerResponseHealthCheck;
} & BaseResponse;
export type TakeLeadershipResponse = {
    type: WorkerResponseType.OLWorkerResponseTakeLeadership;
} & BaseResponse;
export type PromptUserResponse = {
    response: UserPromptResponse;
    type: WorkerResponseType.OLWorkerResponsePromptUser;
} & BaseResponse;
export type WorkerResponse = InitResponse | InvokeResponse | DispatchEventResponse | PickDirectoryResponse | HandlePermissionResponse | HealthCheckResponse | TakeLeadershipResponse | PromptUserResponse;
export {};
