import { Socket } from 'socket.io-client';

type AppProviderServices = Record<string, InstanceType<any>>;
interface AppProvider {
    get type(): "service" | "data" | "utils";
    services(params?: any): AppProviderServices;
}

declare abstract class AppModule {
    abstract name: string;
    abstract providers: AppProvider[];
    protected serviceRegistry: Record<string, any>;
    protected config: Record<string, any>;
    constructor(args: {
        deps: Record<string, AppModule>;
        config?: Record<string, any>;
    });
    init(): void;
    getService<T>(name: string): T;
    getConfig<T = any>(path?: string, throwIfMissing?: boolean): T | undefined;
}

declare class HttpError extends Error {
    status: string;
    details: any;
    constructor(message: string, status?: string, details?: any);
}

interface ApiResponse<T = any> {
    status: number;
    headers: Headers;
    body: T;
    rawBody: any;
    json: any;
}
interface ApiClient {
    key?: string;
}
interface ErrorHandlingStrategy {
    handleNetworkError?: (error: HttpError) => void;
    handleUnauthorizedError?: (error: HttpError) => void;
    handleForbiddenError?: (error: HttpError) => void;
    handleInvalidClientError?: (error: HttpError) => void;
    handleGenericError?: (error: HttpError, status: number) => void;
    shouldShowToast?: (error: HttpError, status: number) => boolean;
    getErrorTitle?: () => string;
}
interface Options extends RequestInit {
    client?: ApiClient;
    skipErrorToast?: boolean;
    errorHandling?: ErrorHandlingStrategy;
    skipCsrf?: boolean;
}

interface HttpClientConfig {
    apiUrl: string;
    errorHandlingStrategy?: ErrorHandlingStrategy;
    client?: ApiClient;
}
declare class HttpClient {
    private config;
    private csrfToken;
    private csrfTokenPromise;
    constructor(config: HttpClientConfig);
    get apiUrl(): string;
    setApiUrl(url: string): void;
    get client(): ApiClient | undefined;
    get errorHandlingStrategy(): ErrorHandlingStrategy;
    static isValidObject(value: any): boolean;
    static flattenObject(value: any, path?: any[]): any;
    static jsonToQueryString(json: Record<string, any>): string;
    fetchJson<T = any>(url: string, options?: Options): Promise<ApiResponse<T>>;
    fetchData(url: string, options?: Options): Promise<Response>;
    private createHeaders;
    private interceptResponse;
    private isUnauthorized;
    private isLimitExceeded;
    private getMethod;
    private isBrowserRuntime;
    private shouldAttachCsrf;
    private fetchCsrfToken;
    private getOrCreateCsrfToken;
    private attachCsrfHeaderIfNeeded;
}

type CoreModuleConfig = {
    httpClient: HttpClient;
    secureStorage?: {
        getKey: (params?: any) => Promise<string>;
    };
    safekey?: {
        enableMergeAuthorityAuthCheck?: boolean;
    };
};

declare class SharedProtectionPlanDataProvider implements AppProvider {
    private readonly core;
    constructor(core: AppModule);
    get type(): "data";
    services(): Record<string, any>;
}

/**
 * Drop-in replacement for SharedProtectionPlanDataProvider in dev/demo environments.
 * Keeps real local storage repos but swaps the API repo for a fake that simulates
 * auth events and moderator approvals with configurable delays.
 *
 * Usage — in SharedProtectionPlanModule:
 *   new FakeSharedProtectionPlanDataProvider(core)
 * instead of:
 *   new SharedProtectionPlanDataProvider(core)
 */
declare class FakeSharedProtectionPlanDataProvider implements AppProvider {
    private readonly core;
    constructor(core: AppModule);
    get type(): "data";
    services(): Record<string, any>;
}

declare class SharedProtectionPlanServiceProvider implements AppProvider {
    private readonly core;
    private readonly module;
    constructor(core: AppModule, module: AppModule);
    get type(): "service";
    services(): Record<string, any>;
}

declare class SharedProtectionPlanUseCaseProvider implements AppProvider {
    private readonly module;
    private readonly core;
    constructor(module: AppModule, core: AppModule);
    get type(): "service";
    services(): Record<string, any>;
}

declare class SharedProtectionPlanModule extends AppModule {
    private readonly args;
    static readonly dependsOn: readonly ["core"];
    static readonly config?: CoreModuleConfig;
    name: string;
    constructor(args: {
        deps?: {
            core: AppModule;
        };
        config?: CoreModuleConfig;
    });
    get providers(): (FakeSharedProtectionPlanDataProvider | SharedProtectionPlanDataProvider | SharedProtectionPlanServiceProvider | SharedProtectionPlanUseCaseProvider)[];
}

/**
 * Union of all supported secret types that can be stored in a data asset.
 */
type SecretData = PlainTextAsset | UserAndPasswordAsset | RecoveryCodeAsset | PINCodeAsset | ApiKeyAsset | PrivateKeyAsset | SeedPhraseAsset | PaymentDebitCardAsset | PaymentCreditCardAsset | MediaAsset;
/**
 * Enumerates all possible asset types.
 */
type DataAssetType = 'PLAIN-TEXT' | 'ONLINE-ACCOUNT' | 'RECOVERY-CODE' | 'PIN-CODE' | 'API-KEY' | 'PRIVATE-KEY' | 'SEED-PHRASE' | 'PAYMENT-DEBIT-CARD' | 'PAYMENT-CREDIT-CARD' | 'DOCUMENT' | 'IMAGE' | 'VIDEO' | 'PDF';
/**
 * A secure, named asset that contains sensitive information such as passwords, keys, or account details.
 */
type DataAsset = {
    /**
     * Unique identifier of the asset.
     */
    id: string;
    /**
     * The type of secret stored. Used to determine how to parse and display the `secret` field.
     */
    type: DataAssetType;
    /**
     * Metadata describing the asset (e.g., name, notes).
     */
    meta: {
        /**
         * Display name for the asset.
         */
        name: string;
        /**
         * Optional notes or context for the asset.
         */
        notes?: string;
        /**
         * MIME type of the asset content (e.g. "application/pdf", "video/mp4").
         * Required when isMedia is true.
         */
        mimeType?: string;
        /**
         * True for binary media assets (DOCUMENT, IMAGE, VIDEO). When true, mimeType must be provided.
         * Used to correctly encode/decode the secret data during share generation and revelation.
         */
        isMedia?: boolean;
    };
    /**
     * The actual sensitive data, varying by asset type.
     */
    secret: SecretData;
};
/**
 * A simple plain text asset.
 */
type PlainTextAsset = {
    text: string;
};
/**
 * Credentials for logging into an app or website.
 */
type UserAndPasswordAsset = {
    appOrWebsite: string;
    email: string;
    username?: string;
    password: string;
};
/**
 * Backup recovery code for 2FA apps or websites.
 */
type RecoveryCodeAsset = {
    appOrWebsite: string;
    code: string;
};
/**
 * PIN code for a device or app.
 */
type PINCodeAsset = {
    deviceOrApp: string;
    code: string;
};
/**
 * API key for external services or apps.
 */
type ApiKeyAsset = {
    app: string;
    apiKey: string;
};
/**
 * Cryptocurrency private key and its associated public address.
 */
type PrivateKeyAsset = {
    publicAddress: string;
    privateKey: string;
};
/**
 * A seed phrase (mnemonic words) used to recover a crypto wallet.
 */
type SeedPhraseAsset = {
    words: string[];
};
/**
 * Sensitive information related to a debit card.
 */
type PaymentDebitCardAsset = {
    cardNumber: string;
    bank?: string;
    accountNumber?: string;
    cardHolderName?: string;
    expiryDate?: string;
    pinCode?: string;
    code?: string;
    clientId?: string;
};
/**
 * Sensitive information related to a credit card.
 */
type PaymentCreditCardAsset = {
    cardNumber: string;
    bank?: string;
    accountNumber?: string;
    cardHolderName?: string;
    expiryDate?: string;
    pinCode?: string;
    code?: string;
    clientId?: string;
};
/**
 * A binary media asset (document, image, or video file).
 *
 * When creating/sharing: `data` is a base64-encoded string.
 * When revealed via parseAssets({ denormalize: true }): `data` is a Blob with the correct MIME type.
 *
 * `mimeType` is stored inside the secret so it survives the SSDP+ round-trip
 * and is available during reconstruction without any extra metadata lookup.
 */
type MediaAsset = {
    /** Base64-encoded string (stored/shared) or a reconstructed Blob (after reveal). */
    data: string | Blob;
    /** MIME type of the content, e.g. "application/pdf" or "video/mp4". */
    mimeType: string;
};

declare class DataAssetManager {
    constructor();
    parseAssets(secrets: string, metadata: any, options?: {
        denormalize?: boolean;
    }): DataAsset[] | null;
    secrets(assets: DataAsset[]): ({
        text: string;
        id: string;
        type: DataAssetType;
    } | {
        appOrWebsite: string;
        email: string;
        username?: string;
        password: string;
        id: string;
        type: DataAssetType;
    } | {
        appOrWebsite: string;
        code: string;
        id: string;
        type: DataAssetType;
    } | {
        deviceOrApp: string;
        code: string;
        id: string;
        type: DataAssetType;
    } | {
        app: string;
        apiKey: string;
        id: string;
        type: DataAssetType;
    } | {
        publicAddress: string;
        privateKey: string;
        id: string;
        type: DataAssetType;
    } | {
        words: string[];
        id: string;
        type: DataAssetType;
    } | {
        cardNumber: string;
        bank?: string;
        accountNumber?: string;
        cardHolderName?: string;
        expiryDate?: string;
        pinCode?: string;
        code?: string;
        clientId?: string;
        id: string;
        type: DataAssetType;
    } | {
        cardNumber: string;
        bank?: string;
        accountNumber?: string;
        cardHolderName?: string;
        expiryDate?: string;
        pinCode?: string;
        code?: string;
        clientId?: string;
        id: string;
        type: DataAssetType;
    } | {
        data: string | Blob;
        mimeType: string;
        id: string;
        type: DataAssetType;
    })[];
    metadata(assets: DataAsset[]): {};
    toHex(assetsSecret: any[]): string;
    compress(assets: DataAsset[]): void;
    sanitizeAssetsValues(values: any): any[];
    private sanitizeValues;
    private base64ToBlob;
    private parseSecrets;
}

interface AccessPolicySubjectsProps {
    allow: string[];
    deny: string[];
}
interface AccessPolicyMetadataProps {
    updatedAt: string;
}
interface ProtectionPlanAccessPolicyProps {
    version: number;
    teams: AccessPolicySubjectsProps;
    members: AccessPolicySubjectsProps;
    metadata: AccessPolicyMetadataProps;
}
interface ProtectionPlanAccessPolicyPrimitiveProps extends ProtectionPlanAccessPolicyProps {
}
interface AccessPolicyFlatEntry {
    subjectType: 'team' | 'member';
    subjectId: string;
    accessType: 'allow' | 'deny';
}
declare class ProtectionPlanAccessPolicy {
    private props;
    constructor(props: ProtectionPlanAccessPolicyProps);
    private static validate;
    get version(): number;
    get teams(): AccessPolicySubjectsProps;
    get members(): AccessPolicySubjectsProps;
    get metadata(): AccessPolicyMetadataProps;
    toFlatEntries(): AccessPolicyFlatEntry[];
    static fromPrimitives(primitives: ProtectionPlanAccessPolicyPrimitiveProps): ProtectionPlanAccessPolicy;
    toPrimitives(): ProtectionPlanAccessPolicyPrimitiveProps;
}

type SharedPlanShardType = 'DATA' | 'BACKUP' | 'KEY' | 'CUSTODIAN_KEY' | 'CUSTODIAN_DATA';
interface SharedPlanShareProps {
    id: string;
    storageLayerId?: string;
    addresses: string[];
    createdAt?: Date;
    distributedAt?: Date;
    data?: string;
    shardType: SharedPlanShardType;
}
declare class SharedPlanShare {
    private readonly props;
    constructor(props: SharedPlanShareProps);
    get id(): string;
    get storageLayerId(): string | undefined;
    get addresses(): string[];
    get data(): string | undefined;
    get createdAt(): Date | undefined;
    get distributedAt(): Date | undefined;
    get shardType(): SharedPlanShardType;
    get isDataShard(): boolean;
    get isBackupShard(): boolean;
    get isKeyShard(): boolean;
    static fromGeneration(props: {
        data: string;
        shardType: SharedPlanShardType;
    }): SharedPlanShare;
}

interface SharedPlanModeratorProps {
    id: string;
    firstName?: string;
    lastName?: string;
    email?: string;
}
interface SharedPlanModeratorPrimitiveProps extends SharedPlanModeratorProps {
}
declare class SharedPlanModerator {
    private readonly props;
    constructor(props: SharedPlanModeratorProps);
    get id(): string;
    get firstName(): string | undefined;
    get lastName(): string | undefined;
    get email(): string | undefined;
    toPrimitives(): SharedPlanModeratorPrimitiveProps;
}

type AuthMethodType = 'SAFEKEY_MOBILE' | 'EMAIL';
interface SharedPlanAuthenticationMethodProps {
    id: AuthMethodType;
    settings: any;
}
interface SharedPlanAuthenticationMethodPrimitiveProps extends Omit<SharedPlanAuthenticationMethodProps, "id"> {
    id: string;
}
declare class SharedPlanAuthenticationMethod {
    private readonly props;
    constructor(props: SharedPlanAuthenticationMethodProps);
    get id(): AuthMethodType;
    get settings(): any;
    toPrimitives(): SharedPlanAuthenticationMethodPrimitiveProps;
}

declare const AUTHENTICATION_MODES: readonly ["EXCLUSIVE", "ALL_REQUIRED"];
type AuthenticationMode = typeof AUTHENTICATION_MODES[number];

type SharedPlanDmsTriggerType = 'LOGIN' | 'CLICK_LINK';
type SharedPlanDmsTriggerStatus = 'ACTIVE' | 'INACTIVE';
/**
 * LOCKED  — default state (waiting its turn) OR creator proved alive (clicked link / logged in).
 *           Disambiguate via the parent process dmsStatus: if 'RESET', creator responded; otherwise just waiting.
 * PENDING — this trigger's countdown is actively running.
 * UNLOCKED — countdown expired; inheritance opens, next trigger starts (or merge activates if last).
 */
type SharedPlanDmsTriggerMergeStatus = 'LOCKED' | 'PENDING' | 'UNLOCKED';
interface SharedPlanDmsTriggerCountdown {
    days: number;
    hours: number;
    minutes: number;
    seconds: number;
}
interface SharedPlanDmsTriggerSettings {
    email?: string;
}
interface SharedPlanDmsTriggerProps {
    id: SharedPlanDmsTriggerType;
    countdown: SharedPlanDmsTriggerCountdown;
    settings: SharedPlanDmsTriggerSettings;
    status: SharedPlanDmsTriggerStatus;
    mergeStatus?: SharedPlanDmsTriggerMergeStatus;
    expiresAt?: Date;
}

type ApprovalMode = 'THRESHOLD' | 'UNANIMOUS';
interface AccessPolicyInput {
    teams: AccessPolicySubjectsProps;
    members: AccessPolicySubjectsProps;
}
interface SharedPlanModeratorsInput {
    id: string;
}
interface SharedPlanAuthenticationMethodInput {
    id: AuthMethodType;
}
interface CreateSharedProtectionPlanInput {
    id?: string;
    tenantId: string;
    type: 'BACKUP' | 'BUSINESS_CONTINUITY';
    name: string;
    description?: string;
    accessPolicy: AccessPolicyInput;
    privacyMode: "PUBLIC" | "PRIVATE";
    moderators?: SharedPlanModeratorsInput[];
    authenticationMethods?: SharedPlanAuthenticationMethodInput[];
    authenticationMode?: AuthenticationMode;
    approvalMode?: ApprovalMode;
    threshold?: number;
    minimumApprovals?: number;
    assets: (DataAsset | Omit<DataAsset, 'id'> & {
        id?: string;
    })[];
    categoryId?: string | null;
    withCustodian?: boolean;
    masterKeyEncrypted?: boolean;
    triggers?: Array<{
        id: SharedPlanDmsTriggerType;
        countdown: SharedPlanDmsTriggerCountdown;
        settings?: SharedPlanDmsTriggerSettings;
    }>;
}

type SharedProtectionPlanStatus = 'DRAFT' | 'PROTECTED';
type SharedProtectionPlanAccessType = 'MODERATED' | 'DIRECT';
interface EffectivePlanPolicy<T> {
    value: T;
    source: 'org' | 'plan';
    customValue?: T;
    isOverridden: boolean;
}
interface SharedPlanStorageLayer {
    id: "INHERITI_HSM" | "INHERITI_VAULT" | "INHERITI_CHAIN" | "GOOGLE_DRIVE" | "DROPBOX";
}
interface SharedProtectionPlanProps {
    id: string;
    tenantId?: string;
    creatorMemberId?: string;
    type: 'BACKUP' | 'BUSINESS_CONTINUITY';
    name: string;
    description?: string;
    moderators?: SharedPlanModerator[];
    authenticationMethods?: SharedPlanAuthenticationMethod[];
    authenticationMode?: AuthenticationMode;
    approvalMode?: ApprovalMode;
    authenticationPolicy?: EffectivePlanPolicy<AuthenticationMode>;
    approvalModePolicy?: EffectivePlanPolicy<ApprovalMode>;
    accessPolicy: ProtectionPlanAccessPolicy;
    mergeThreshold: number;
    mergeCount: number;
    minimumApprovals?: number;
    shares: SharedPlanShare[];
    assets?: DataAsset[];
    status: SharedProtectionPlanStatus;
    storageLayers?: SharedPlanStorageLayer[];
    createdAt: Date;
    updatedAt: Date;
    privacyMode: "PUBLIC" | "PRIVATE";
    assetsMetadata: any;
    categoryId?: string | null;
    code?: string;
    withCustodian?: boolean;
    masterKeyEncrypted?: boolean;
    triggers?: SharedPlanDmsTriggerProps[];
}
interface SharedPlanSharePrimitiveProps {
    id: string;
    storageLayerId?: string;
    addresses: string[];
    data?: string;
    key?: string;
    createdAt?: Date | string;
    distributedAt?: Date | string;
}
interface SharedProtectionPlanPrimitiveProps extends Omit<SharedProtectionPlanProps, 'moderators' | 'authenticationMethods' | 'accessPolicy' | 'shares' | 'status' | 'createdAt' | 'updatedAt' | 'code'> {
    moderators?: SharedPlanModeratorPrimitiveProps[];
    authenticationMethods?: SharedPlanAuthenticationMethodPrimitiveProps[];
    authenticationMode?: AuthenticationMode;
    approvalMode?: ApprovalMode;
    authenticationPolicy?: EffectivePlanPolicy<AuthenticationMode>;
    approvalModePolicy?: EffectivePlanPolicy<ApprovalMode>;
    accessPolicy: ProtectionPlanAccessPolicyPrimitiveProps;
    shares: SharedPlanSharePrimitiveProps[];
    status: string;
    createdAt: Date | string;
    updatedAt: Date | string;
    code?: string;
}
declare class SharedProtectionPlan {
    private readonly props;
    constructor(props: SharedProtectionPlanProps);
    get id(): string;
    get tenantId(): string | undefined;
    get creatorMemberId(): string | undefined;
    get type(): 'BACKUP' | 'BUSINESS_CONTINUITY';
    get name(): string;
    get description(): string | undefined;
    get privacyMode(): 'PUBLIC' | 'PRIVATE';
    get accessPolicy(): ProtectionPlanAccessPolicy;
    get mergeThreshold(): number;
    get mergeCount(): number;
    get minimumApprovals(): number | undefined;
    get moderators(): SharedPlanModerator[] | undefined;
    get authenticationMethods(): SharedPlanAuthenticationMethod[] | undefined;
    get authenticationMode(): AuthenticationMode;
    get approvalMode(): ApprovalMode;
    get authenticationPolicy(): EffectivePlanPolicy<AuthenticationMode> | undefined;
    get approvalModePolicy(): EffectivePlanPolicy<ApprovalMode> | undefined;
    get totalShares(): number;
    get assets(): DataAsset[] | undefined;
    get status(): SharedProtectionPlanStatus;
    get storageLayers(): SharedPlanStorageLayer[] | undefined;
    get assetsMetadata(): any;
    get categoryId(): string | null;
    get createdAt(): Date;
    get code(): string | undefined;
    get withCustodian(): boolean;
    get masterKeyEncrypted(): boolean;
    get triggers(): SharedPlanDmsTriggerProps[] | undefined;
    get isDraft(): boolean;
    get isPrivate(): boolean;
    get requiresAuthentication(): boolean;
    get isModerated(): boolean;
    get accessType(): SharedProtectionPlanAccessType;
    get hasDirectAccess(): boolean;
    static create(props: Omit<SharedProtectionPlanProps, "shares" | "status" | "mergeCount">): SharedProtectionPlan;
    withAssetsMetadata(assetsMetadata: any): SharedProtectionPlan;
    toPrimitives(): SharedProtectionPlanPrimitiveProps;
    static fromPrimitives(raw: SharedProtectionPlanPrimitiveProps): SharedProtectionPlan;
}

type ApprovalMethod = 'SK_MOBILE_AUTH_FLOW' | 'OTP_EMAIL' | 'CLICK_LINK' | 'ITSME' | 'SAFEKEY_2FA';
type ApprovalFlowStatus = 'IDLE' | 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELED';
type ApprovalParticipantStatus = 'IDLE' | 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELED';
type ApprovalParticipantRole = 'AUTHENTICATOR' | 'MODERATOR';
type ApprovalProcessStatus = 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELED';
interface ApprovalFlowSnapshot {
    type: ApprovalMethod;
    status: ApprovalFlowStatus;
    startedAt?: Date;
    expiresAt?: Date;
}
interface ApprovalParticipantSnapshot {
    userId: string;
    role: ApprovalParticipantRole;
    status: ApprovalParticipantStatus;
    flows: ApprovalFlowSnapshot[];
}
interface ApprovalProcessSnapshot {
    status: ApprovalProcessStatus;
    requiredApprovals: number;
    participants: ApprovalParticipantSnapshot[];
}

type DmsStatus = 'PENDING' | 'ACTIVATED' | 'RESET';
interface SharedPlanDmsTriggerAction {
    id: string;
    status: 'WAITING' | 'PENDING' | 'SENT' | 'PROCESSED';
    action: {
        type: 'CODE' | 'LINK';
        attemptCount: number;
        lastAttemptAt?: Date;
        retriesCount: number;
    };
    startedAt?: Date;
    expiresAt?: Date;
}

type SharedPlanMergeStep = 'PENDING_DMS' | 'PENDING' | 'PENDING_APPROVALS' | 'PENDING_AUTH' | 'PENDING_MODERATION' | 'ACCESS_GRANTED' | 'READY_TO_REVEAL' | 'REVEALED' | 'EXPIRED' | 'COMPLETED' | 'FAILED';
interface CollectedShare {
    id: string;
    storageLayerId: string;
    data: string;
}
interface SharedPlanMergeProcessProps {
    id: string;
    planId: string;
    step: SharedPlanMergeStep;
    requiredShares: number;
    approvalProcess: ApprovalProcessSnapshot;
    storageLayers: string[];
    collectedStorageLayerIds: string[];
    revealStartedAt?: Date;
    revealEndsAt?: Date;
    timeoutMinutesForClose?: number;
    createdAt: Date;
    dmsStatus?: DmsStatus;
    dmsTriggers?: SharedPlanDmsTriggerProps[];
    dmsTriggerActions?: SharedPlanDmsTriggerAction[];
}
declare class SharedPlanMergeProcess {
    private readonly props;
    constructor(props: SharedPlanMergeProcessProps);
    get id(): string;
    get planId(): string;
    get step(): SharedPlanMergeStep;
    get dmsStatus(): DmsStatus | undefined;
    get dmsTriggers(): SharedPlanDmsTriggerProps[] | undefined;
    get dmsTriggerActions(): SharedPlanDmsTriggerAction[] | undefined;
    get activeDmsTriggerAction(): SharedPlanDmsTriggerAction | undefined;
    get isPendingDms(): boolean;
    get isDmsActivated(): boolean;
    get isDmsReset(): boolean;
    get requiredShares(): number;
    get approvalProcess(): ApprovalProcessSnapshot;
    get storageLayers(): string[];
    get collectedStorageLayerIds(): string[];
    get revealStartedAt(): Date | undefined;
    get revealEndsAt(): Date | undefined;
    get timeoutMinutesForClose(): number | undefined;
    get collectedCount(): number;
    get hasEnoughShares(): boolean;
    get needsApproval(): boolean;
    get authenticatorParticipant(): ApprovalParticipantSnapshot | undefined;
    get moderatorParticipants(): ApprovalParticipantSnapshot[];
    get isAuthenticationComplete(): boolean;
    get isRevealWindowOpen(): boolean;
    get isExpired(): boolean;
    get pendingStorageLayers(): string[];
    static create(props: Omit<SharedPlanMergeProcessProps, 'step' | 'collectedStorageLayerIds'>): SharedPlanMergeProcess;
    withStep(step: SharedPlanMergeStep): SharedPlanMergeProcess;
    withDmsReset(): SharedPlanMergeProcess;
    withApprovalProcess(approvalProcess: ApprovalProcessSnapshot): SharedPlanMergeProcess;
    withCollectedStorageLayerIds(collectedStorageLayerIds: string[]): SharedPlanMergeProcess;
    withRevealWindow(revealStartedAt: Date, revealEndsAt: Date, timeoutMinutesForClose?: number): SharedPlanMergeProcess;
    toPrimitives(): SharedPlanMergeProcessProps;
    static fromPrimitives(raw: any): SharedPlanMergeProcess;
}

interface SharedProtectionPlanSummaryProps {
    id: string;
    name: string;
    description?: string;
    memberCount: number;
    threshold: number;
    createdAt: Date;
}
declare class SharedProtectionPlanSummary {
    private readonly props;
    constructor(props: SharedProtectionPlanSummaryProps);
    get id(): string;
    get name(): string;
    get description(): string | undefined;
    get memberCount(): number;
    get threshold(): number;
    get createdAt(): Date;
    get status(): string;
}

interface ProcessStepProps {
    id: string;
    status: 'COMPLETE' | 'INCOMPLETE' | 'IN_PROCESS';
}
interface ProcessStepPrimitiveProps extends ProcessStepProps {
}
declare class ProcessStep<T> {
    private props;
    constructor(props: ProcessStepProps & T);
    get id(): string;
    get isComplete(): boolean;
    get status(): "COMPLETE" | "INCOMPLETE" | "IN_PROCESS";
    get isPending(): boolean;
    get isInProcess(): boolean;
    static fromPrimitives(props: ProcessStepPrimitiveProps): ProcessStep<unknown>;
    reset(): void;
    markAsComplete(): void;
    markAsInProgress(): void;
    markAsIncomplete(): void;
    toPrimitives(): ProcessStepPrimitiveProps;
}

interface CustodianSharePair {
    keyShard: {
        id: string;
        data: string;
    };
    dataShard: {
        id: string;
        data: string;
    };
}
interface SharedPlanSharesGeneratorResult {
    dataShards: string[];
    backupShards: string[];
    keyShards: string[];
    custodianPair?: CustodianSharePair;
}
interface SharedPlanSharesGenerator {
    generate(data: Uint8Array, params: {
        total: number;
        threshold: number;
        withCustodian?: boolean;
    }): Promise<SharedPlanSharesGeneratorResult>;
}

type SharedPlanConfigurationStepId = 'SHARES_CREATION' | 'SHARES_DISTRIBUTION' | "FINALIZE";
interface StepErrorEntry {
    message: string;
    description?: string;
}
interface SharedPlanConfigurationProcessProps {
    id: string;
    planId: string;
    steps: ProcessStep<any>[];
    activeStep: number;
    stepErrors?: Record<string, StepErrorEntry>;
    stepsAttempts?: Record<string, number>;
    createdAt: Date;
    symmetricKey?: string;
    shares?: SharedPlanShare[];
    custodianPair?: CustodianSharePair;
}
interface SharedPlanConfigurationProcessPrimitiveProps {
    id: string;
    planId: string;
    steps: ProcessStepPrimitiveProps[];
    activeStep: number;
    stepErrors?: Record<string, StepErrorEntry | string>;
    stepsAttempts?: Record<string, number>;
    createdAt: Date;
    symmetricKey?: string;
    shares?: SharedPlanShareProps[];
    custodianPair?: CustodianSharePair;
}
declare class SharedPlanConfigurationProcess {
    private props;
    constructor(props: SharedPlanConfigurationProcessProps);
    get id(): string;
    get planId(): string;
    get steps(): ProcessStep<any>[];
    get createdAt(): Date;
    get symmetricKey(): string | undefined;
    get shares(): SharedPlanShare[] | undefined;
    get custodianPair(): CustodianSharePair | undefined;
    setCustodianPair(pair: CustodianSharePair): void;
    setSymmetricKey(key: string): void;
    setShares(shares: SharedPlanShare[]): void;
    get activeStepIndex(): number;
    get currentStep(): ProcessStep<any>;
    get isCompleted(): boolean;
    get hasErrors(): boolean;
    static create(planId: string): SharedPlanConfigurationProcess;
    static fromPrimitives(props: SharedPlanConfigurationProcessPrimitiveProps): SharedPlanConfigurationProcess;
    start(): void;
    completeStep(step: ProcessStep<any>): void;
    setStepError(id: string, entry: StepErrorEntry): void;
    getStepError(id: string): StepErrorEntry | undefined;
    cleanStepError(id: string): void;
    updateStepAttempt(id: string): void;
    stepCompleted(id: string): boolean | undefined;
    toPrimitives(): SharedPlanConfigurationProcessPrimitiveProps;
}

type SharedMergeStatus = 'NOT_STARTED' | 'PENDING_DMS' | 'PENDING' | 'PENDING_APPROVALS' | 'PENDING_AUTH' | 'PENDING_MODERATION' | 'ACCESS_GRANTED' | 'READY_TO_REVEAL' | 'REVEALED' | 'EXPIRED' | 'COMPLETED' | 'FAILED';

interface ApprovalProcessView {
    status: ApprovalProcessStatus;
    requiredApprovals: number;
    approvedAuthenticationMethods: number;
    approvedModerators: number;
    participants: ApprovalParticipantSnapshot[];
}
interface StorageLayerView {
    id: string;
    collected: boolean;
}
interface SharedPlanMergeProcessViewProps {
    processId?: string;
    planId?: string;
    status: SharedMergeStatus;
    approvalProcess: ApprovalProcessView;
    storageLayers: StorageLayerView[];
    revealStartedAt?: Date;
    revealEndsAt?: Date;
    timeoutMinutesForClose?: number;
    revealedAssets?: DataAsset[] | null;
    dmsStatus?: DmsStatus;
    dmsTriggers?: SharedPlanDmsTriggerProps[];
    dmsTriggerActions?: SharedPlanDmsTriggerAction[];
}
declare class SharedPlanMergeProcessView {
    private readonly props;
    constructor(props: SharedPlanMergeProcessViewProps);
    private static getDisplayParticipantStatus;
    static notStarted(): SharedPlanMergeProcessView;
    static build(process: SharedPlanMergeProcess, revealedAssets?: DataAsset[] | null): SharedPlanMergeProcessView;
    get processId(): string | undefined;
    get planId(): string | undefined;
    get status(): SharedMergeStatus;
    get dmsStatus(): DmsStatus | undefined;
    get dmsTriggers(): SharedPlanDmsTriggerProps[] | undefined;
    get dmsTriggerActions(): SharedPlanDmsTriggerAction[] | undefined;
    get activeDmsTriggerAction(): SharedPlanDmsTriggerAction | undefined;
    get isPendingDms(): boolean;
    get isDmsActivated(): boolean;
    get isDmsReset(): boolean;
    get approvalProcess(): ApprovalProcessView;
    get storageLayers(): StorageLayerView[];
    get revealStartedAt(): Date | undefined;
    get revealEndsAt(): Date | undefined;
    get timeoutMinutesForClose(): number | undefined;
    get revealedAssets(): DataAsset[] | null | undefined;
    get isStarted(): boolean;
    get isPendingApprovals(): boolean;
    get isPendingAuth(): boolean;
    get isPendingModeration(): boolean;
    get isAccessGranted(): boolean;
    get isReadyToReveal(): boolean;
    get isRevealed(): boolean;
    get isExpired(): boolean;
    get isCompleted(): boolean;
    get isFailed(): boolean;
    get isDone(): boolean;
    get isApprovalDenied(): boolean;
    get isApprovalCanceled(): boolean;
    get isAuthenticationDenied(): boolean;
    get isAuthenticationCanceled(): boolean;
    get isModerationDenied(): boolean;
    get isModerationCanceled(): boolean;
    get authenticatorParticipant(): ApprovalParticipantSnapshot | undefined;
    get moderatorParticipants(): ApprovalParticipantSnapshot[];
    get isRevealWindowOpen(): boolean;
    get requiredModeratorApprovals(): number;
    get approvalProgress(): {
        approvedAuthenticationMethods: number;
        approvedModerators: number;
        required: number;
        total: number;
    };
    get sharesProgress(): {
        collected: number;
        total: number;
    };
    toPrimitives(): SharedPlanMergeProcessViewProps;
}

interface SharedProtectionPlanViewProps {
    plan: SharedProtectionPlanSummary;
    configurationProcess?: SharedPlanConfigurationProcess;
    mergeProcess?: SharedPlanMergeProcessView;
}
declare class SharedProtectionPlanView {
    private readonly props;
    constructor(props: SharedProtectionPlanViewProps);
    get plan(): SharedProtectionPlanSummary;
    get configurationProcess(): SharedPlanConfigurationProcess | undefined;
    get mergeProcess(): SharedPlanMergeProcessView | undefined;
    get isConfigured(): boolean;
    get isMerging(): boolean;
}

interface SharedPlanDataRevealer {
    reveal(dataShards: string[], keyShards: string[], params: {
        threshold: number;
        assetsMetadata?: any;
    }): Promise<DataAsset[]>;
}

interface SharedPlanEventHandlers {
    onProcessUpdated?: () => void | Promise<void>;
    onApprovalUpdated?: () => void | Promise<void>;
    onRevealWindowExpired?: (processId: string) => void | Promise<void>;
    onCustodianShareClaimed?: (processId: string) => void | Promise<void>;
    onCustodianShareReceived?: (processId: string, shareData: unknown) => void | Promise<void>;
}
interface SharedPlanEventListener {
    refreshConnection?(): void | Promise<void>;
    subscribe(processId: string, handlers: SharedPlanEventHandlers): void;
    unsubscribe(processId: string): void;
}

interface SharedPlanOperationEventHandlers {
    onProcessUpdated?: () => void | Promise<void>;
    onApprovalUpdated?: () => void | Promise<void>;
}
interface SharedPlanOperationEventListener {
    refreshConnection?(): void | Promise<void>;
    subscribe(processId: string, handlers: SharedPlanOperationEventHandlers): void;
    unsubscribe(processId: string): void;
}

type SharedPlanErrorFlow = 'CONFIGURATION' | 'MERGE' | 'OPERATION';
type SharedPlanErrorSeverity = 'warning' | 'error' | 'critical';
interface SharedPlanErrorReport {
    flow: SharedPlanErrorFlow;
    useCase: string;
    message: string;
    step?: string;
    detail?: string;
    severity?: SharedPlanErrorSeverity;
    planId?: string;
    processId?: string;
    metadata?: Record<string, any>;
}
interface SharedPlanErrorReporter {
    report(error: SharedPlanErrorReport): Promise<void>;
}

type SharedPlanViewStatus = 'DRAFT' | 'PROTECTED';
type SharedPlanViewType = 'BACKUP' | 'BUSINESS_CONTINUITY';
type SharedPlanViewPrivacyMode = 'PUBLIC' | 'PRIVATE';
interface SharedPlanViewModerator {
    id: string;
    countdown?: {
        days: number;
        hours: number;
        minutes: number;
    };
}
interface SharedPlanViewAuthenticationMethod {
    id: string;
    status?: string;
    settings?: any;
}
interface SharedPlanViewShare {
    id: string;
    storageLayerId?: string;
    addresses: string[];
    data?: string;
    key?: string;
    createdAt?: Date;
    distributedAt?: Date;
}
interface SharedPlanViewStorageLayer {
    id: string;
}
interface SharedPlanViewTrigger {
    id: string;
    countdown: {
        days: number;
        hours: number;
        minutes: number;
        seconds: number;
    };
    settings?: {
        email?: string;
    };
    status: 'ACTIVE' | 'INACTIVE';
}
interface SharedPlanViewProps {
    id: string;
    tenantId?: string;
    creatorMemberId?: string;
    code?: string;
    type: SharedPlanViewType;
    name: string;
    description?: string;
    status: SharedPlanViewStatus;
    privacyMode: SharedPlanViewPrivacyMode;
    mergeThreshold: number;
    minimumApprovals?: number;
    mergeCount: number;
    moderators?: SharedPlanViewModerator[];
    authenticationMethods?: SharedPlanViewAuthenticationMethod[];
    assetsMetadata?: Record<string, {
        meta?: {
            name?: string;
            notes?: string;
        };
        type?: string;
    }>;
    storageLayers?: SharedPlanViewStorageLayer[];
    shares: SharedPlanViewShare[];
    categoryId: string | null;
    accessPolicy?: any;
    settings?: any;
    triggers?: SharedPlanViewTrigger[];
    configuredAt?: Date;
    createdAt: Date;
}
declare class SharedPlanView {
    private readonly props;
    constructor(props: SharedPlanViewProps);
    get id(): string;
    get tenantId(): string | undefined;
    get creatorMemberId(): string | undefined;
    get code(): string | undefined;
    get type(): SharedPlanViewType;
    get name(): string;
    get description(): string | undefined;
    get status(): SharedPlanViewStatus;
    get isDraft(): boolean;
    get isProtected(): boolean;
    get isConfigured(): boolean;
    get privacyMode(): SharedPlanViewPrivacyMode;
    get isModerated(): boolean;
    get mergeThreshold(): number;
    get minimumApprovals(): number | undefined;
    get mergeCount(): number;
    get moderators(): SharedPlanViewModerator[];
    get authenticationMethods(): SharedPlanViewAuthenticationMethod[];
    get requiresAuthentication(): boolean;
    get requiresTeams(): boolean;
    get accessType(): "MODERATED" | "DIRECT";
    get shares(): SharedPlanViewShare[];
    get totalShares(): number;
    get assetsMetadata(): Record<string, {
        meta?: {
            name?: string;
            notes?: string;
        };
        type?: string;
    }>;
    get assetEntries(): {
        meta?: {
            name?: string;
            notes?: string;
        };
        type?: string;
    }[];
    get assetTypes(): string[];
    get assetsCount(): number;
    get storageLayers(): SharedPlanViewStorageLayer[];
    get categoryId(): string | null;
    get accessPolicy(): any;
    get isPrivate(): boolean;
    get settings(): any;
    get triggers(): SharedPlanViewTrigger[];
    get configuredAt(): Date | undefined;
    get createdAt(): Date;
    get setupProgressSteps(): {
        active: boolean;
        id: string;
        label: string;
        complete: boolean;
    }[];
    get setupProgressCompletedSteps(): number;
    get setupProgressTotalSteps(): number;
    get setupProgressValue(): number;
    static fromRaw(raw: any): SharedPlanView;
    private isSetupConfigured;
    private hasDetailsConfigured;
    private hasTeamsConfigured;
    private hasAuthenticationConfigured;
    private hasDataConfigured;
}

interface PaginationOptions {
    page?: number;
    perPage?: number;
}

type ResourceCount = {
    count: number;
};

interface SortOptions {
    field?: string;
    order?: string;
}

interface APIRepositoryProps {
    httpClient: HttpClient;
    httpClientKey?: string;
}
interface RequestOptions {
}
declare abstract class APIRepository {
    protected readonly props: APIRepositoryProps;
    protected httpClient: HttpClient;
    constructor(props: APIRepositoryProps);
    findByCriteriaRequest<T>(resource: string, filter?: any, pagination?: PaginationOptions, sort?: SortOptions, withAuth?: boolean, options?: RequestOptions): Promise<T[]>;
    countRequest<T>(resource: string, where?: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    findOneById<T>(resource: string, id: string, withAuth?: boolean, options?: RequestOptions): Promise<T | undefined>;
    create<T>(resource: string, data: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    updateById<T>(resource: string, id: string, changes: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    deleteById<T>(resource: string, id: string, withAuth?: boolean, options?: RequestOptions): Promise<void>;
    get<T>(path: string, withAuth?: boolean, options?: RequestOptions): Promise<T>;
    post<T>(path: string, data: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    patch<T>(resource: string, changes: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    getClientApiUrl(path: string): string;
    private getRequestOptions;
}

interface FindSharedPlansCriteria {
    tenantId?: string;
    teamId?: string;
    userId?: string;
    memberId?: string;
    tenantMemberId?: string;
    q?: string;
    categoryId?: string;
    type?: string;
    privacyMode?: 'PUBLIC' | 'PRIVATE';
    storageLayerType?: string;
}
declare class FindSharedProtectionPlansByCriteriaUseCase {
    private readonly planRepository;
    constructor(planRepository: SharedProtectionPlanRepository);
    execute(filters: FindSharedPlansCriteria, pagination?: PaginationOptions, sort?: SortOptions): Promise<SharedPlanView[]>;
}

interface SharedProtectionPlanRepository {
    findById(id: string): Promise<SharedProtectionPlan | null>;
    findAll(): Promise<SharedPlanView[]>;
    findByCriteria(criteria: FindSharedPlansCriteria, pagination?: PaginationOptions, sort?: SortOptions): Promise<SharedPlanView[]>;
    count(criteria: FindSharedPlansCriteria): Promise<ResourceCount>;
    save(plan: SharedProtectionPlan): Promise<void>;
    delete(id: string): Promise<void>;
    /** Sends encrypted data, backup, and key shards to the backend to complete plan configuration. */
    configure(planId: string, dataShards: SharedPlanShare[], backupShards: SharedPlanShare[], keyShards: SharedPlanShare[], encryptedKey?: string, assetsMetadata?: any, custodianPair?: {
        keyShard: {
            id: string;
            data: string;
        };
        dataShard: {
            id: string;
            data: string;
        };
    }): Promise<void>;
    /** Re-distributes encrypted shares for an existing plan (requires active EDIT merge process). */
    reconfigure(planId: string, mergeProcessId: string, dataShards: SharedPlanShare[], backupShards: SharedPlanShare[], keyShards: SharedPlanShare[], encryptedKey?: string, assetsMetadata?: any, custodianPair?: {
        keyShard: {
            id: string;
            data: string;
        };
        dataShard: {
            id: string;
            data: string;
        };
    }): Promise<void>;
}

interface SharedConfigurationProcessRepository {
    findByPlanId(planId: string): Promise<SharedPlanConfigurationProcess | null>;
    save(process: SharedPlanConfigurationProcess): Promise<void>;
    delete(planId: string): Promise<void>;
}

/** Local session storage — persists the in-progress merge process across page reloads. */
interface SharedMergingProcessLocalRepository {
    findById(id: string): Promise<SharedPlanMergeProcess | null>;
    findByPlanId(planId: string): Promise<SharedPlanMergeProcess | null>;
    save(process: SharedPlanMergeProcess): Promise<void>;
    delete(id: string): Promise<void>;
}

interface StartProcessResult {
    approvalProcess: ApprovalProcessSnapshot;
    status?: string;
    dmsStatus?: DmsStatus;
    dmsTriggers?: SharedPlanDmsTriggerProps[];
}
interface OpenRevealWindowResult {
    revealStartedAt: Date;
    revealEndsAt: Date;
    timeoutMinutesForClose: number;
}
interface SharedRevealOptions {
    timeoutMinutes: number;
}
interface CollectSharesResult {
    dataShards: CollectedShare[];
    backupShards: CollectedShare[];
    keyShards: CollectedShare[];
    dek: string;
}
interface GetAssetsMetadataResult {
    assetsMetadata: any;
}
interface ActiveProcessSnapshot {
    id: string;
    planId: string;
    status: string;
    requestedAt: string;
    approvalProcess: ApprovalProcessSnapshot;
    revealStartedAt?: string;
    revealEndsAt?: string;
    timeoutMinutesForClose?: number;
    dmsStatus?: DmsStatus;
    dmsTriggers?: SharedPlanDmsTriggerProps[];
    dmsTriggerActions?: SharedPlanDmsTriggerAction[];
}
interface CustodianShareAccessSnapshot {
    status: 'DISTRIBUTED' | 'CLAIMED' | 'PENDING' | 'INVALID' | 'NOT_FOUND';
    deviceType: string;
    shareId: string;
    distributedAt: string | null;
}
type MergeAccessIntent = 'VIEW' | 'EDIT';
interface SharedMergingProcessApiRepository {
    startProcess(planId: string, processId: string, accessIntent?: MergeAccessIntent): Promise<StartProcessResult>;
    getApprovals(processId: string): Promise<ApprovalProcessSnapshot>;
    getAssetsMetadata(processId: string): Promise<GetAssetsMetadataResult>;
    requestApproval(processId: string): Promise<void>;
    notifyApprovalParticipants(processId: string): Promise<void>;
    openRevealWindow(processId: string, options: SharedRevealOptions): Promise<OpenRevealWindowResult>;
    collectShares(processId: string): Promise<CollectSharesResult>;
    abortProcess(processId: string): Promise<void>;
    closePlan(processId: string): Promise<void>;
    markSharesCollected(processId: string): Promise<void>;
    markSharesReconstructed(processId: string): Promise<void>;
    markDataRevealed(processId: string): Promise<void>;
    findActiveByPlanId(planId: string, tenantId: string): Promise<ActiveProcessSnapshot | null>;
    getCustodianShareAccess(processId: string): Promise<CustodianShareAccessSnapshot>;
    getCustodianShareData(processId: string): Promise<{
        id: string;
        shares: string[];
        planId: string;
        isMergeAuthority: boolean;
    }>;
    distributeCustodianShareViaMobile(planId: string): Promise<void>;
    recordCustodianShareClaim(planId: string, shareId: string, deviceId: string, deviceType: 'SK_MOBILE' | 'SK_PRO'): Promise<void>;
    cancelCustodianShareClaim(processId: string): Promise<void>;
    releaseCustodianShareViaMobile(processId: string): Promise<void>;
    markCustodianShareAsCollected(processId: string, shareId: string): Promise<void>;
}

/** Combined interface used by the orchestrator. Implemented by an adapter. */
interface SharedMergingProcessRepository extends SharedMergingProcessLocalRepository, SharedMergingProcessApiRepository {
}

declare class CreateSharedProtectionPlanUseCase {
    private readonly planRepository;
    private readonly assetManager;
    constructor(planRepository: SharedProtectionPlanRepository, assetManager: DataAssetManager);
    execute(input: CreateSharedProtectionPlanInput): Promise<SharedProtectionPlan>;
}

declare class GetSharedProtectionPlanUseCase {
    private readonly planRepository;
    constructor(planRepository: SharedProtectionPlanRepository);
    execute(planId: string): Promise<SharedProtectionPlan | null>;
}

declare class CountSharedProtectionPlansUseCase {
    private readonly planRepository;
    constructor(planRepository: SharedProtectionPlanRepository);
    execute(criteria: FindSharedPlansCriteria): Promise<ResourceCount>;
}

interface EncryptedSharePayload {
    id: string;
    encryptedData: string;
}
interface DecryptedSharePayload {
    id: string;
    data: string;
}
interface ShareEncryptionResult {
    encryptedShares: EncryptedSharePayload[];
    symmetricKeyBase64: string;
    encryptedKey: string;
}
interface ShareEncryptionService {
    encryptShares(shares: Array<{
        id: string;
        data?: string;
    }>, existingSymmetricKeyBase64?: string, masterKey?: string): Promise<ShareEncryptionResult>;
    decryptShares(shares: Array<{
        id: string;
        encryptedData: string;
    }>, dekBase64: string): Promise<DecryptedSharePayload[]>;
    unwrapDEKWithMasterKey(masterKeyWrappedDEKBase64: string, masterKeyHex: string): Promise<string>;
}

declare class DistributeSharesUseCase {
    private readonly planRepository;
    private readonly configRepository;
    private readonly encryptionService;
    constructor(planRepository: SharedProtectionPlanRepository, configRepository: SharedConfigurationProcessRepository, encryptionService: ShareEncryptionService);
    execute(process: SharedPlanConfigurationProcess, shares: SharedPlanShare[], assetsMetadata?: any, masterKey?: string, mergeProcessId?: string): Promise<void>;
    private sendShards;
    private encryptShardGroup;
    private wrapEncrypted;
    private encryptCustodianPair;
    private handleEncryptShares;
}

interface GenerateSharesInput {
    assets: DataAsset[];
    threshold: number;
    total: number;
    withCustodian?: boolean;
}
interface GenerateSharesResult {
    shares: SharedPlanShare[];
    custodianPair?: CustodianSharePair;
}
declare class GenerateSharesUseCase {
    private readonly assetManager;
    private readonly generator;
    private readonly errorReporter;
    constructor(assetManager: DataAssetManager, generator: SharedPlanSharesGenerator, errorReporter: SharedPlanErrorReporter);
    execute(input: GenerateSharesInput): Promise<GenerateSharesResult>;
    private runStep;
    private validateInput;
    private reportError;
}

interface ReconfigureContext {
    mergeProcessId: string;
}
interface ConfigureSharedProtectionPlanInput {
    planId: string;
    assets: DataAsset[];
    totalShares: number;
    withCustodian?: boolean;
    masterKey?: string;
    reconfigureContext?: ReconfigureContext;
}
interface ConfigureSharedProtectionPlanCallbacks {
    onSharesGenerated?: (shares: SharedPlanShare[]) => void;
    onSharesDistributed?: () => void;
    onCompleted?: () => void;
    onError?: (error: Error) => void;
    /** Signal that the backend pushed a process update via socket. */
    onProcessUpdated?: () => void;
}
interface ConfigureSharedProtectionPlanDeps {
    planRepository: SharedProtectionPlanRepository;
    configRepository: SharedConfigurationProcessRepository;
    generateShares: GenerateSharesUseCase;
    distributeShares: DistributeSharesUseCase;
    eventListener: SharedPlanEventListener;
    assetManager: DataAssetManager;
    errorReporter: SharedPlanErrorReporter;
}
declare class ConfigureSharedProtectionPlanUseCase {
    private readonly deps;
    private activeSubscription;
    constructor(deps: ConfigureSharedProtectionPlanDeps);
    subscribe(planId: string, handlers: SharedPlanEventHandlers): void;
    unsubscribe(planId: string): void;
    execute(input: ConfigureSharedProtectionPlanInput, callbacks?: ConfigureSharedProtectionPlanCallbacks): Promise<void>;
    private reportStepError;
}

declare class GetSharedPlanConfigurationProcessUseCase {
    private readonly configRepository;
    constructor(configRepository: SharedConfigurationProcessRepository);
    execute(planId: string): Promise<SharedPlanConfigurationProcess | null>;
}

declare class DeleteSharedPlanConfigurationProcessUseCase {
    private readonly configRepository;
    constructor(configRepository: SharedConfigurationProcessRepository);
    execute(planId: string): Promise<void>;
}

declare class SsdpPlusSharedPlanSharesGenerator implements SharedPlanSharesGenerator {
    generate(data: Uint8Array, params: {
        total: number;
        threshold: number;
        withCustodian?: boolean;
    }): Promise<SharedPlanSharesGeneratorResult>;
}

declare class SsdpPlusSharedPlanDataRevealer implements SharedPlanDataRevealer {
    private readonly assetManager;
    constructor(assetManager: DataAssetManager);
    reveal(dataShards: string[], keyShards: string[], params: {
        threshold: number;
        assetsMetadata?: any;
    }): Promise<DataAsset[]>;
}

interface SocketSubscription {
    /** Server-room join event.  Omit when server-side subscription is explicit (e.g. requestToken). */
    subscribeEmit?: string;
    subscribePayload?: object;
    /** Server-room leave event. */
    unsubscribeEmit: string;
    unsubscribePayload: object;
    /** Pairs of socket event name + the exact handler reference used with socket.on(). */
    bindings: Array<{
        event: string;
        handler: (...args: any[]) => void;
    }>;
}
declare abstract class SocketIoBaseEventListener {
    protected readonly socket: Socket;
    private readonly subs;
    private readonly onReconnect;
    constructor(socket: Socket);
    /**
     * Register a subscription under `key`.
     * If a subscription with the same key already exists it is cleanly removed first
     * (deduplication — safe to call on every render / effect re-run).
     */
    protected register(key: string, sub: SocketSubscription): void;
    /**
     * Remove a subscription: calls socket.off() with the exact stored handler
     * references and emits the server-side unsubscribe event.
     */
    protected remove(key: string): void;
    /**
     * Update the reconnect payload for an existing subscription.
     * Use this when the server-side subscription is triggered by an explicit call
     * after the initial register() (e.g. requestToken), so that reconnect can
     * re-emit it automatically.
     */
    protected setReconnectEmit(key: string, subscribeEmit: string, subscribePayload: object): void;
    /**
     * Remove all active subscriptions and the reconnect handler.
     * Call when the listener itself is no longer needed (e.g. module teardown).
     */
    destroy(): void;
}

declare class SocketIoSharedPlanEventListener extends SocketIoBaseEventListener implements SharedPlanEventListener {
    constructor(socket: Socket);
    refreshConnection: () => void;
    subscribe: (processId: string, handlers: SharedPlanEventHandlers) => void;
    unsubscribe: (processId: string) => void;
}

declare class SocketIoSharedPlanOperationEventListener extends SocketIoBaseEventListener implements SharedPlanOperationEventListener {
    constructor(socket: Socket);
    refreshConnection: () => void;
    subscribe: (processId: string, handlers: SharedPlanOperationEventHandlers) => void;
    unsubscribe: (processId: string) => void;
}

declare class AppSharedConfigurationProcessRepository extends APIRepository implements SharedConfigurationProcessRepository {
    private storage;
    private payloadStorage;
    constructor(props: APIRepositoryProps);
    findByPlanId(planId: string): Promise<SharedPlanConfigurationProcess | null>;
    save(process: SharedPlanConfigurationProcess): Promise<void>;
    delete(planId: string): Promise<void>;
    private extractPayload;
    private sanitizeProcessPrimitives;
    private hydrateProcessPrimitives;
}

declare class AppSharedMergingProcessRepository implements SharedMergingProcessRepository {
    private readonly local;
    private readonly api;
    constructor(local: SharedMergingProcessLocalRepository, api: SharedMergingProcessApiRepository);
    findById(id: string): Promise<SharedPlanMergeProcess | null>;
    findByPlanId(planId: string): Promise<SharedPlanMergeProcess | null>;
    save(process: SharedPlanMergeProcess): Promise<void>;
    delete(id: string): Promise<void>;
    startProcess(planId: string, processId: string, accessIntent?: 'VIEW' | 'EDIT'): Promise<StartProcessResult>;
    getApprovals(processId: string): Promise<ApprovalProcessSnapshot>;
    getAssetsMetadata(processId: string): Promise<GetAssetsMetadataResult>;
    requestApproval(processId: string): Promise<void>;
    notifyApprovalParticipants(processId: string): Promise<void>;
    openRevealWindow(processId: string, options: SharedRevealOptions): Promise<OpenRevealWindowResult>;
    collectShares(processId: string): Promise<CollectSharesResult>;
    abortProcess(processId: string): Promise<void>;
    closePlan(processId: string): Promise<void>;
    markSharesCollected(processId: string): Promise<void>;
    markSharesReconstructed(processId: string): Promise<void>;
    markDataRevealed(processId: string): Promise<void>;
    findActiveByPlanId(planId: string, tenantId: string): Promise<ActiveProcessSnapshot | null>;
    getCustodianShareAccess(planId: string): Promise<CustodianShareAccessSnapshot>;
    getCustodianShareData(planId: string): Promise<{
        id: string;
        shares: string[];
        planId: string;
        isMergeAuthority: boolean;
    }>;
    distributeCustodianShareViaMobile(planId: string): Promise<void>;
    recordCustodianShareClaim(planId: string, shareId: string, deviceId: string, deviceType: 'SK_MOBILE' | 'SK_PRO'): Promise<void>;
    cancelCustodianShareClaim(processId: string): Promise<void>;
    releaseCustodianShareViaMobile(planId: string): Promise<void>;
    markCustodianShareAsCollected(processId: string, shareId: string): Promise<void>;
}

declare class AppSharedPlanErrorReporter extends APIRepository implements SharedPlanErrorReporter {
    constructor(props: APIRepositoryProps);
    report(error: SharedPlanErrorReport): Promise<void>;
}

declare class AppSharedProtectionPlanRepository extends APIRepository implements SharedProtectionPlanRepository {
    constructor(props: APIRepositoryProps);
    findById(id: string): Promise<SharedProtectionPlan | null>;
    findAll(): Promise<SharedPlanView[]>;
    findByCriteria(criteria: FindSharedPlansCriteria, pagination?: PaginationOptions, sort?: SortOptions): Promise<SharedPlanView[]>;
    count(criteria: FindSharedPlansCriteria): Promise<ResourceCount>;
    save(plan: SharedProtectionPlan): Promise<void>;
    delete(id: string): Promise<void>;
    configure(planId: string, dataShards: SharedPlanShare[], backupShards: SharedPlanShare[], keyShards: SharedPlanShare[], encryptedKey?: string, assetsMetadata?: any, custodianPair?: {
        keyShard: {
            id: string;
            data: string;
        };
        dataShard: {
            id: string;
            data: string;
        };
    }): Promise<void>;
    reconfigure(planId: string, mergeProcessId: string, dataShards: SharedPlanShare[], backupShards: SharedPlanShare[], keyShards: SharedPlanShare[], encryptedKey?: string, assetsMetadata?: any, custodianPair?: {
        keyShard: {
            id: string;
            data: string;
        };
        dataShard: {
            id: string;
            data: string;
        };
    }): Promise<void>;
}

/** Fake implementation — stores plans in localStorage. Use in dev/demo environments. */
declare class FakeSharedProtectionPlanRepository extends APIRepository implements SharedProtectionPlanRepository {
    private storage;
    private dekMap;
    constructor(props: APIRepositoryProps);
    findById(id: string): Promise<SharedProtectionPlan | null>;
    findAll(): Promise<SharedProtectionPlanSummary[]>;
    findByCriteria(criteria: FindSharedPlansCriteria): Promise<SharedProtectionPlanSummary[]>;
    count(criteria: FindSharedPlansCriteria): Promise<{
        count: number;
    }>;
    save(plan: SharedProtectionPlan): Promise<void>;
    delete(id: string): Promise<void>;
    getDek(planId: string): string | undefined;
    configure(planId: string, dataShards: SharedPlanShare[], backupShards: SharedPlanShare[], keyShards: SharedPlanShare[], encryptedKey?: string, assetsMetadata?: any, custodianPair?: {
        keyShard: {
            id: string;
            data: string;
        };
        dataShard: {
            id: string;
            data: string;
        };
    }): Promise<void>;
    reconfigure(planId: string, mergeProcessId: string, dataShards: SharedPlanShare[], backupShards: SharedPlanShare[], keyShards: SharedPlanShare[], encryptedKey?: string, assetsMetadata?: any, custodianPair?: {
        keyShard: {
            id: string;
            data: string;
        };
        dataShard: {
            id: string;
            data: string;
        };
    }): Promise<void>;
}

type MaybePromise$2<T = void> = T | Promise<T>;
interface IApprovableProcess {
    readonly id: string;
    readonly authenticatorParticipant: ApprovalParticipantSnapshot | undefined;
    readonly isAuthenticationComplete: boolean;
    readonly moderatorParticipants: ApprovalParticipantSnapshot[];
    readonly approvalProcess: ApprovalProcessSnapshot;
    withApprovalProcess(ap: ApprovalProcessSnapshot): this;
    withStep(step: any): this;
}
interface IApprovalOperations<P> {
    getApprovals(processId: string): Promise<ApprovalProcessSnapshot>;
    save(process: P): Promise<void>;
    requestApproval(processId: string): Promise<void>;
    notifyApprovalParticipants(processId: string): Promise<void>;
}
interface ApprovalOrchestratorCallbacks {
    onApprovalsRequested?: () => MaybePromise$2;
}
declare class SharedPlanApprovalOrchestrator {
    private pendingApprovalResolve;
    signalApprovalUpdate(): void;
    runApprovalStep<P extends IApprovableProcess>(process: P, operations: IApprovalOperations<P>, callbacks: ApprovalOrchestratorCallbacks, emit: (p: P) => Promise<void>, authStepName: string, isCancelled: () => boolean): Promise<P>;
    private isTerminal;
    private pollUntilComplete;
    private waitForApprovalUpdate;
}

interface RevealSharedPlanDataInput {
    dataShards: string[];
    keyShards: string[];
    threshold: number;
    processId: string;
}
declare class RevealSharedPlanDataUseCase {
    private readonly revealer;
    private readonly mergeRepository;
    constructor(revealer: SharedPlanDataRevealer, mergeRepository: SharedMergingProcessRepository);
    execute(input: RevealSharedPlanDataInput): Promise<DataAsset[] | null>;
}

type RevealStep = 'DISTRIBUTING_CUSTODIAN_SHARE' | 'OPENING_WINDOW' | 'COLLECTING_SHARES' | 'RECONSTRUCTING' | 'PREPARING_VIEW';
type RevealStepStatus = 'IN_PROCESS' | 'COMPLETE' | 'FAILED';
declare const DEFAULT_SHARED_REVEAL_OPTIONS: SharedRevealOptions;
type MaybePromise$1<T = void> = T | Promise<T>;
type CustodianShareRequiredContext = {
    mode: 'distribute';
    planId: string;
    requiresKeyShares?: boolean;
} | {
    mode: 'awaiting-claim';
    planId: string;
    shareId: string;
    distributedAt: string | null;
} | {
    mode: 'awaiting-release';
    planId: string;
    shareId: string;
} | {
    mode: 'collect-from-sk-pro';
    planId: string;
    shareId: string;
};
interface MergeSharedProtectionPlanCallbacks {
    onApprovalsRequested?: () => MaybePromise$1;
    onViewUpdate?: (view: SharedPlanMergeProcessView) => MaybePromise$1;
    onRevealStepUpdate?: (step: RevealStep, status: RevealStepStatus) => MaybePromise$1;
    onRevealStepError?: (step: RevealStep, error: Error) => MaybePromise$1;
    onRevealed?: (assets: DataAsset[] | null) => MaybePromise$1;
    onRevealWindowExpired?: () => MaybePromise$1;
    onError?: (error: Error) => MaybePromise$1;
    /**
     * Called when the custodian share step requires user action.
     * `mode: 'distribute'` — share has never been distributed; UI should let the user choose device.
     * `mode: 'awaiting-release'` — share is already on SK-Mobile, release was triggered; UI should show waiting state.
     * `mode: 'collect-from-sk-pro'` — share was already claimed to SK-Pro; user must connect device to provide it.
     * Must resolve once the action is done.
     */
    onCustodianShareRequired?: (processId: string, context: CustodianShareRequiredContext) => MaybePromise$1<{
        keyShares: string[];
    } | void>;
}
interface MergeSharedProtectionPlanDeps {
    planRepository: SharedProtectionPlanRepository;
    mergeRepository: SharedMergingProcessRepository;
    revealUseCase: RevealSharedPlanDataUseCase;
    eventListener: SharedPlanEventListener;
    encryptionService: ShareEncryptionService;
    errorReporter: SharedPlanErrorReporter;
    approvalOrchestrator: SharedPlanApprovalOrchestrator;
}
declare class MergeSharedProtectionPlanUseCase {
    private readonly deps;
    private pendingDmsResolve;
    private pendingCustodianClaimResolve;
    private pendingCustodianClaimProcessId;
    private pendingCustodianShareResolver;
    private pendingCustodianShareProcessId;
    private runCancelled;
    private readonly trackedErrors;
    constructor(deps: MergeSharedProtectionPlanDeps);
    initialize(planId: string, accessIntent?: 'VIEW' | 'EDIT'): Promise<SharedPlanMergeProcessView>;
    getView(processId: string): Promise<SharedPlanMergeProcessView | null>;
    resume(planId: string, callbacks?: MergeSharedProtectionPlanCallbacks): Promise<SharedPlanMergeProcessView | null>;
    resumeReveal(processId: string, callbacks?: MergeSharedProtectionPlanCallbacks, masterKey?: string): Promise<void>;
    abort(processId: string): Promise<void>;
    closePlan(processId: string): Promise<void>;
    clearLocalProcess(processId: string): Promise<void>;
    clearLocalProcessByPlanId(planId: string): Promise<void>;
    /** Runs the process until READY_TO_REVEAL, then stops and waits for manual trigger. */
    run(processId: string, callbacks?: MergeSharedProtectionPlanCallbacks): Promise<void>;
    /**
     * Runs the reveal subprocess and only opens the timed reveal window once the
     * data is ready to be shown:
     * collect shares → decrypt/reconstruct → open window → REVEALED.
     *
     * The SDK subscribes to the process room to handle expiry events during this phase.
     */
    openRevealWindow(processId: string, revealOptions?: SharedRevealOptions, callbacks?: MergeSharedProtectionPlanCallbacks, masterKey?: string): Promise<void>;
    private revealBeforeOpeningWindow;
    private revealWithOpenWindow;
    private collectAndReconstruct;
    private handleCustodianShare;
    private prepareRevealedView;
    private hydrateProcessFromApi;
    private resolveProcessStep;
    private resolveExpiredStep;
    private executeRevealStep;
    private waitForDmsActivation;
    private waitForCustodianShare;
    private waitForCustodianShareClaim;
    private resolvePendingCustodianClaim;
    private resolvePendingCustodianShare;
    private notifyCustodianShareRequired;
    private waitForClaimedMobileCustodianShareAccess;
    private delay;
    private throwIfCancelled;
    private normalizeCustodianShareData;
    private reportRevealStepError;
    getCustodianShareData(processId: string): Promise<{
        id: string;
        shares: string[];
        planId: string;
        isMergeAuthority: boolean;
    }>;
    distributeCustodianShareViaMobile(planId: string): Promise<void>;
    recordCustodianShareClaim(planId: string, shareId: string, deviceId: string, deviceType: 'SK_MOBILE' | 'SK_PRO'): Promise<void>;
    cancelCustodianShareClaim(processId: string): Promise<void>;
    releaseCustodianShareViaMobile(processId: string): Promise<void>;
    markCustodianShareAsCollected(processId: string, shareId: string): Promise<void>;
    private reportMergeErrorIfNeeded;
    private getRevealStepMessage;
}

declare class GetSharedMergingProcessUseCase {
    private readonly mergeRepository;
    constructor(mergeRepository: SharedMergingProcessRepository);
    execute(processId: string): Promise<SharedPlanMergeProcessView | null>;
}

type RevealStepState = 'idle' | 'IN_PROCESS' | 'COMPLETE' | 'FAILED';
type RevealSteps = Record<RevealStep, RevealStepState>;
type RevealStepErrors = Partial<Record<RevealStep, string>>;
interface SharedRevealConfiguration {
    revealOptions?: SharedRevealOptions;
}
interface UseMergeSharedProtectionPlanConfig {
    reveal?: SharedRevealConfiguration;
    accessIntent?: 'VIEW' | 'EDIT';
    custodianShare?: {
        onRequired: (processId: string, context: {
            mode: 'distribute';
            planId: string;
            requiresKeyShares?: boolean;
        } | {
            mode: 'awaiting-claim';
            planId: string;
            shareId: string;
            distributedAt: string | null;
        } | {
            mode: 'awaiting-release';
            planId: string;
            shareId: string;
        } | {
            mode: 'collect-from-sk-pro';
            planId: string;
            shareId: string;
        }) => Promise<{
            keyShares: string[];
        } | void>;
    };
    masterKey?: string;
}

type PlanOperationType = 'EDIT' | 'DELETE';
type SharedPlanOperationStep = 'PENDING' | 'PENDING_APPROVALS' | 'PENDING_AUTHENTICATION' | 'PENDING_MODERATION' | 'ACCESS_GRANTED' | 'EXPIRED' | 'COMPLETED' | 'ABORTED' | 'FAILED';
interface SharedPlanOperationProcessProps {
    id: string;
    planId: string;
    operationType: PlanOperationType;
    step: SharedPlanOperationStep;
    approvalProcess: ApprovalProcessSnapshot;
    operationWindowExpiresAt?: Date;
    createdAt: Date;
}
declare class SharedPlanOperationProcess {
    private readonly props;
    constructor(props: SharedPlanOperationProcessProps);
    get id(): string;
    get planId(): string;
    get operationType(): PlanOperationType;
    get step(): SharedPlanOperationStep;
    get approvalProcess(): ApprovalProcessSnapshot;
    get operationWindowExpiresAt(): Date | undefined;
    get createdAt(): Date;
    get needsApproval(): boolean;
    get authenticatorParticipant(): ApprovalParticipantSnapshot | undefined;
    get moderatorParticipants(): ApprovalParticipantSnapshot[];
    get isAuthenticationComplete(): boolean;
    get isAccessGranted(): boolean;
    get isExpired(): boolean;
    static create(props: Omit<SharedPlanOperationProcessProps, 'step'>): SharedPlanOperationProcess;
    withStep(step: SharedPlanOperationStep): SharedPlanOperationProcess;
    withApprovalProcess(approvalProcess: ApprovalProcessSnapshot): SharedPlanOperationProcess;
    withAccessGranted(operationWindowExpiresAt?: Date): SharedPlanOperationProcess;
    toPrimitives(): SharedPlanOperationProcessProps;
    static fromPrimitives(raw: any): SharedPlanOperationProcess;
}

type SharedOperationStatus = 'NOT_STARTED' | 'PENDING' | 'PENDING_APPROVALS' | 'PENDING_AUTHENTICATION' | 'PENDING_MODERATION' | 'ACCESS_GRANTED' | 'EXPIRED' | 'COMPLETED' | 'ABORTED' | 'FAILED';

interface OperationApprovalProcessView {
    status: ApprovalProcessStatus;
    requiredApprovals: number;
    approvedAuthenticationMethods: number;
    approvedModerators: number;
    participants: ApprovalParticipantSnapshot[];
}
interface SharedPlanOperationProcessViewProps {
    processId?: string;
    planId?: string;
    operationType?: PlanOperationType;
    status: SharedOperationStatus;
    approvalProcess: OperationApprovalProcessView;
    operationWindowExpiresAt?: Date;
}
declare class SharedPlanOperationProcessView {
    private readonly props;
    constructor(props: SharedPlanOperationProcessViewProps);
    private static getDisplayParticipantStatus;
    static notStarted(): SharedPlanOperationProcessView;
    static build(process: SharedPlanOperationProcess): SharedPlanOperationProcessView;
    get processId(): string | undefined;
    get planId(): string | undefined;
    get operationType(): PlanOperationType | undefined;
    get status(): SharedOperationStatus;
    get approvalProcess(): OperationApprovalProcessView;
    get operationWindowExpiresAt(): Date | undefined;
    get isStarted(): boolean;
    get isPendingApprovals(): boolean;
    get isPendingAuth(): boolean;
    get isPendingModeration(): boolean;
    get isAccessGranted(): boolean;
    get isExpired(): boolean;
    get isCompleted(): boolean;
    get isAborted(): boolean;
    get isFailed(): boolean;
    get isDone(): boolean;
    get isApprovalDenied(): boolean;
    get isApprovalCanceled(): boolean;
    get isAuthenticationDenied(): boolean;
    get isAuthenticationCanceled(): boolean;
    get isModerationDenied(): boolean;
    get isModerationCanceled(): boolean;
    get authenticatorParticipant(): ApprovalParticipantSnapshot | undefined;
    get moderatorParticipants(): ApprovalParticipantSnapshot[];
    get requiredModeratorApprovals(): number;
    get approvalProgress(): {
        approvedAuthenticationMethods: number;
        approvedModerators: number;
        required: number;
        total: number;
    };
    toPrimitives(): SharedPlanOperationProcessViewProps;
}

/** Local session storage — persists the in-progress plan operation process across page reloads. */
interface SharedPlanOperationProcessLocalRepository {
    findById(id: string): Promise<SharedPlanOperationProcess | null>;
    findByPlanId(planId: string): Promise<SharedPlanOperationProcess | null>;
    save(process: SharedPlanOperationProcess): Promise<void>;
    delete(id: string): Promise<void>;
}

interface ActivePlanOperationProcessSnapshot {
    id: string;
    planId: string;
    operationType: PlanOperationType;
    status: string;
    requestedAt: string;
    approvalProcess: ApprovalProcessSnapshot;
    operationWindowExpiresAt?: string;
}
interface SharedPlanOperationProcessApiRepository {
    startProcess(planId: string, processId: string, operationType: PlanOperationType): Promise<ApprovalProcessSnapshot>;
    getApprovals(processId: string): Promise<ApprovalProcessSnapshot>;
    requestApproval(processId: string): Promise<void>;
    notifyApprovalParticipants(processId: string): Promise<void>;
    abortProcess(processId: string): Promise<void>;
    completeProcess(processId: string): Promise<void>;
    findActiveByPlanId(planId: string, tenantId: string, operationType?: PlanOperationType): Promise<ActivePlanOperationProcessSnapshot | null>;
}

/** Combined interface used by the orchestrator. Implemented by an adapter. */
interface SharedPlanOperationProcessRepository extends SharedPlanOperationProcessLocalRepository, SharedPlanOperationProcessApiRepository {
}

type MaybePromise<T = void> = T | Promise<T>;
interface RunSharedPlanOperationProcessCallbacks {
    onApprovalsRequested?: () => MaybePromise;
    onViewUpdate?: (view: SharedPlanOperationProcessView) => MaybePromise;
    onAccessGranted?: (view: SharedPlanOperationProcessView) => MaybePromise;
    onError?: (error: Error) => MaybePromise;
}
interface RunSharedPlanOperationProcessDeps {
    planRepository: SharedProtectionPlanRepository;
    operationRepository: SharedPlanOperationProcessRepository;
    eventListener: SharedPlanOperationEventListener;
    errorReporter: SharedPlanErrorReporter;
    approvalOrchestrator: SharedPlanApprovalOrchestrator;
}
/**
 * Orchestrates a plan operation process (EDIT or DELETE) through the exact same
 * approval steps as the merge flow — initialize → authentication → moderation —
 * but stops at ACCESS_GRANTED. There is no reveal/collect/reconstruct phase:
 * once access is granted the consumer performs the edit/delete and then calls
 * `complete()` to close the session.
 */
declare class RunSharedPlanOperationProcessUseCase {
    private readonly deps;
    private runCancelled;
    private readonly trackedErrors;
    constructor(deps: RunSharedPlanOperationProcessDeps);
    initialize(planId: string, operationType: PlanOperationType): Promise<SharedPlanOperationProcessView>;
    getView(processId: string): Promise<SharedPlanOperationProcessView | null>;
    resume(planId: string, operationType?: PlanOperationType, callbacks?: RunSharedPlanOperationProcessCallbacks): Promise<SharedPlanOperationProcessView | null>;
    abort(processId: string): Promise<void>;
    complete(processId: string): Promise<void>;
    clearLocalProcess(processId: string): Promise<void>;
    clearLocalProcessByPlanId(planId: string): Promise<void>;
    /** Runs the process until ACCESS_GRANTED (success) or EXPIRED/FAILED (terminal), then stops. */
    run(processId: string, callbacks?: RunSharedPlanOperationProcessCallbacks): Promise<void>;
    private hydrateProcessFromApi;
    private resolveProcessStep;
    private isTerminalStep;
    private resolveExpiredStep;
    private reportErrorIfNeeded;
}

type OperationStatus = 'idle' | 'initializing' | 'running' | 'granted' | 'completing' | 'completed' | 'error';
interface UseSharedPlanOperationProcessConfig {
    operationType?: PlanOperationType;
}
interface SharedPlanOperationProcessHook {
    start: {
        execute: () => Promise<void>;
        loading: boolean;
        error?: string;
        errorDescription?: string;
    };
    retry: {
        execute: () => Promise<void>;
    };
    abort: {
        execute: () => Promise<void>;
    };
    complete: {
        execute: () => Promise<void>;
        loading: boolean;
    };
    reset: () => void;
    resume: () => Promise<void>;
    process: SharedPlanOperationProcessView;
    operationType: PlanOperationType;
    status: OperationStatus;
    isRunning: boolean;
    isAccessGranted: boolean;
    isCompleted: boolean;
    hasError: boolean;
    error?: string;
    errorDescription?: string;
}

declare class AppSharedPlanOperationProcessRepository implements SharedPlanOperationProcessRepository {
    private readonly local;
    private readonly api;
    constructor(local: SharedPlanOperationProcessLocalRepository, api: SharedPlanOperationProcessApiRepository);
    findById(id: string): Promise<SharedPlanOperationProcess | null>;
    findByPlanId(planId: string): Promise<SharedPlanOperationProcess | null>;
    save(process: SharedPlanOperationProcess): Promise<void>;
    delete(id: string): Promise<void>;
    startProcess(planId: string, processId: string, operationType: PlanOperationType): Promise<ApprovalProcessSnapshot>;
    getApprovals(processId: string): Promise<ApprovalProcessSnapshot>;
    requestApproval(processId: string): Promise<void>;
    notifyApprovalParticipants(processId: string): Promise<void>;
    abortProcess(processId: string): Promise<void>;
    completeProcess(processId: string): Promise<void>;
    findActiveByPlanId(planId: string, tenantId: string, operationType?: PlanOperationType): Promise<ActivePlanOperationProcessSnapshot | null>;
}

export { AppSharedConfigurationProcessRepository, AppSharedMergingProcessRepository, AppSharedPlanErrorReporter, AppSharedPlanOperationProcessRepository, AppSharedProtectionPlanRepository, ConfigureSharedProtectionPlanUseCase, CountSharedProtectionPlansUseCase, CreateSharedProtectionPlanUseCase, DEFAULT_SHARED_REVEAL_OPTIONS, DeleteSharedPlanConfigurationProcessUseCase, DistributeSharesUseCase, FakeSharedProtectionPlanRepository, FindSharedProtectionPlansByCriteriaUseCase, GenerateSharesUseCase, GetSharedMergingProcessUseCase, GetSharedPlanConfigurationProcessUseCase, GetSharedProtectionPlanUseCase, MergeSharedProtectionPlanUseCase, RevealSharedPlanDataUseCase, RunSharedPlanOperationProcessUseCase, SharedPlanAuthenticationMethod, SharedPlanConfigurationProcess, SharedPlanMergeProcessView, SharedPlanModerator, SharedPlanOperationProcessView, SharedPlanShare, SharedProtectionPlan, SharedProtectionPlanModule, SharedProtectionPlanSummary, SharedProtectionPlanView, SocketIoSharedPlanEventListener, SocketIoSharedPlanOperationEventListener, SsdpPlusSharedPlanDataRevealer, SsdpPlusSharedPlanSharesGenerator };
export type { AccessPolicyInput, AccessPolicySubjectsProps, ActivePlanOperationProcessSnapshot, ApprovalFlowSnapshot, ApprovalFlowStatus, ApprovalFlowSnapshot as ApprovalFlowView, ApprovalMethod, ApprovalMode, ApprovalParticipantRole, ApprovalParticipantSnapshot, ApprovalParticipantStatus, ApprovalParticipantSnapshot as ApprovalParticipantView, ApprovalProcessSnapshot, ApprovalProcessStatus, ApprovalProcessView, AuthMethodType, AuthenticationMode, CollectedShare, ConfigureSharedProtectionPlanCallbacks, ConfigureSharedProtectionPlanDeps, ConfigureSharedProtectionPlanInput, CreateSharedProtectionPlanInput, DmsStatus, FindSharedPlansCriteria, GenerateSharesInput, MergeSharedProtectionPlanCallbacks, MergeSharedProtectionPlanDeps, OpenRevealWindowResult, OperationApprovalProcessView, PlanOperationType, ReconfigureContext, RevealSharedPlanDataInput, RevealStep, RevealStepErrors, RevealStepState, RevealStepStatus, RevealSteps, RunSharedPlanOperationProcessCallbacks, RunSharedPlanOperationProcessDeps, SharedConfigurationProcessRepository, SharedMergeStatus, SharedMergingProcessRepository, SharedOperationStatus, SharedPlanAuthenticationMethodInput, SharedPlanConfigurationStepId, SharedPlanDataRevealer, SharedPlanDmsTriggerAction, SharedPlanDmsTriggerCountdown, SharedPlanDmsTriggerProps, SharedPlanDmsTriggerSettings, SharedPlanDmsTriggerStatus, SharedPlanDmsTriggerType, SharedPlanErrorFlow, SharedPlanErrorReport, SharedPlanErrorReporter, SharedPlanErrorSeverity, SharedPlanEventHandlers, SharedPlanEventListener, SharedPlanMergeProcessViewProps, SharedPlanMergeStep, SharedPlanModeratorsInput, SharedPlanOperationEventHandlers, SharedPlanOperationEventListener, SharedPlanOperationProcessHook, SharedPlanOperationProcessProps, SharedPlanOperationProcessRepository, SharedPlanOperationStep, SharedPlanSharesGenerator, SharedPlanSharesGeneratorResult, SharedPlanStorageLayer, SharedProtectionPlanAccessType, SharedProtectionPlanProps, SharedProtectionPlanRepository, SharedRevealConfiguration, SharedRevealOptions, StorageLayerView, UseMergeSharedProtectionPlanConfig, UseSharedPlanOperationProcessConfig };
