import type { Mortice, MorticeOptions } from './index.js';
import type { TypedEventTarget } from 'main-event';
export type RequestType = 'requestReadLock' | 'requestWriteLock';
export type AbortRequestType = 'abortReadLockRequest' | 'abortWriteLockRequest';
export type FinalizeRequestType = 'finalizeRequest';
export interface RequestEventData {
    name: string;
    identifier: string;
    handler(): Promise<void>;
    onError(err: Error): void;
}
export interface RequestEvent {
    type: string;
    identifier: string;
    name: string;
    error?: {
        name: string;
        message: string;
        stack: string;
    };
}
export interface AbortEventData {
    name: string;
    identifier: string;
}
export interface FinalizeEventData {
    name: string;
}
export interface MorticeEvents {
    requestReadLock: CustomEvent<RequestEventData>;
    abortReadLockRequest: CustomEvent<AbortEventData>;
    requestWriteLock: CustomEvent<RequestEventData>;
    abortWriteLockRequest: CustomEvent<AbortEventData>;
    finalizeRequest: CustomEvent<FinalizeEventData>;
}
export declare function isMortice(obj?: any): obj is Mortice;
export declare function getImplementation(opts: Required<MorticeOptions>): Mortice | TypedEventTarget<MorticeEvents>;
export declare const createMutex: (name: string, options: Required<MorticeOptions>) => Mortice;
//# sourceMappingURL=mortice.d.ts.map