import { Context, Deferred, Effect, Option, type Scope } from 'effect';
import { type VNode } from 'vue';
type OverlayResult<T = unknown> = Option.Option<T>;
type OverlayShellProps = Readonly<{
    title?: string;
    description?: string;
    breakpoint?: string;
    trap?: boolean;
    width?: string;
}>;
type OverlaySessionInput = Readonly<{
    shell?: Partial<OverlayShellProps>;
    props?: Record<string, unknown>;
}>;
type OverlaySessionPatch = Readonly<{
    shell?: Partial<OverlayShellProps>;
    props?: Record<string, unknown>;
}>;
type OverlaySlotProps = Readonly<{
    props: Readonly<Record<string, unknown>>;
    report: (...args: [value?: unknown]) => void;
    isDesktop: boolean;
}>;
type OverlayBodyRender = (props: OverlaySlotProps) => Array<VNode>;
type OverlayDefinition = Readonly<{
    definitionId: string;
    ownerId: string;
    render: OverlayBodyRender;
    shell?: OverlayShellProps;
}>;
type OverlayHandle<T = unknown> = Readonly<{
    patch: (patch: OverlaySessionPatch) => Effect.Effect<void>;
    close: (...args: [value?: unknown]) => Effect.Effect<void>;
    result: Effect.Effect<OverlayResult<T>>;
}>;
export type OverlayDefinitionNotFoundError = Readonly<{
    _tag: 'OverlayDefinitionNotFoundError';
    definitionId: string;
}>;
type OverlayShellState = OverlayShellProps & {
    descriptionSrOnly?: boolean;
};
type OverlaySession = {
    sessionId: string;
    definitionId: string;
    open: boolean;
    shell: OverlayShellState;
    props: Record<string, unknown>;
    deferred: Deferred.Deferred<OverlayResult, never>;
    pendingResult?: OverlayResult;
};
type AlertSession = {
    alertId: string;
    open: boolean;
    content: string;
    icon?: string;
    color?: string;
    deferred: Deferred.Deferred<boolean, never>;
    pendingResult?: boolean;
    finalizeScheduled?: boolean;
};
interface OverlayRuntime {
    definitions: Readonly<Record<string, OverlayDefinition>>;
    sessions: ReadonlyArray<OverlaySession>;
    alerts: ReadonlyArray<AlertSession>;
    topSession: OverlaySession | undefined;
    registerDefinition: (definition: OverlayDefinition) => void;
    unregisterDefinition: (definitionId: string, ownerId?: string) => void;
    syncDefinitions: (ownerId: string, definitions: Array<OverlayDefinition>) => void;
    isOpen: (sessionId: string) => boolean;
    open: <T = unknown>(definitionId: string, options?: OverlaySessionInput) => Effect.Effect<OverlayHandle<T>, OverlayDefinitionNotFoundError, Scope.Scope>;
    patch: (sessionId: string, patch: OverlaySessionPatch) => Effect.Effect<void>;
    close: (sessionId: string, ...args: [value?: unknown]) => Effect.Effect<void>;
    closeTop: () => Effect.Effect<void>;
    closeAll: () => Effect.Effect<void>;
    openAlert: (input: {
        content: string;
        icon?: string;
        color?: string;
    }) => Effect.Effect<boolean>;
    closeAlert: (alertId: string, result: boolean, explicit?: boolean) => Effect.Effect<void>;
}
export type { OverlayDefinition };
export declare function useOverlay(): OverlayRuntime;
declare const ActionContext_base: Context.TagClass<ActionContext, "shwfed/ActionContext", {
    definitionId: string;
}>;
declare class ActionContext extends ActionContext_base {
}
export { ActionContext };
export declare function openModal<T = unknown>(options: {
    title: string;
    description?: string;
    trap?: boolean;
    width?: string;
    props?: Record<string, unknown>;
}): Effect.Effect<{
    patch: (props: Record<string, unknown>) => Effect.Effect<void>;
    close: () => Effect.Effect<void>;
    modal: Effect.Effect<OverlayResult<T>>;
}, OverlayDefinitionNotFoundError, ActionContext | Scope.Scope>;
export declare function reject(input: {
    content: string;
    icon?: string;
    color?: string;
}): Effect.Effect<boolean>;
