export type OwnerIdentity = { pid: number; startedAt: string; sessionKey: string; token?: string; pidStartTime?: string; }; export function stateDir(): string; export function statePath(root: string, me: string): string; export function lockPath(root: string, me: string): string; export function backupPath(root: string, me: string): string; export function claim(options: { root: string; me: string; pid: number; startedAt: string; sessionKey: string; token?: string; }): Promise<{ owner: boolean; identity?: OwnerIdentity; currentOwner?: OwnerIdentity | null }>; export function release(options: { root: string; me: string; identity: OwnerIdentity; clearActiveId?: boolean; }): Promise; export function currentOwner(root: string, me: string): Promise; export function isOwner(root: string, me: string, identity: OwnerIdentity): Promise; export function sameOwnerIdentity(a: OwnerIdentity | null, b: OwnerIdentity | null): boolean; export function appendProcessedIds(root: string, me: string, ids: string[]): Promise; export function processedIds(root: string, me: string): Promise; export function hasProcessed(root: string, me: string, id: string): Promise; export function setActiveId(root: string, me: string, id: string | null): Promise; export function pushActiveId(root: string, me: string, id: string, options?: { expectedActiveId?: string | null; deferOnLimit?: boolean }): Promise<{ pushed: boolean; activeId: string | null; reason: string | null }>; export function popActiveId(root: string, me: string, id: string): Promise<{ popped: boolean; activeId: string | null }>; export function removeActiveId(root: string, me: string, id: string): Promise<{ removed: boolean; activeId: string | null }>; export function setActiveIdIfIdle(root: string, me: string, id: string): Promise<{ activated: boolean; activeId: string }>; export function resumeCompletedActiveStack(root: string, me: string): Promise<{ changed: boolean; activeId: string | null; stack: string[] }>; export function getActiveStack(root: string, me: string): Promise; export function getActiveId(root: string, me: string): Promise; export function resetActiveId(root: string, me: string): Promise; export function getMigrated0002(root: string, me: string): Promise; export function setMigrated0002(root: string, me: string, flag: boolean): Promise; export function beginMigration(root: string, me: string): Promise;