///
import { Awaitable } from '@miniflare/shared';
import { Context } from '@miniflare/shared';
import { MiniflareError } from '@miniflare/shared';
import { Mount } from '@miniflare/shared';
import { Plugin } from '@miniflare/shared';
import { PluginContext } from '@miniflare/shared';
import { Request } from '@miniflare/core';
import { RequestInfo } from '@miniflare/core';
import { RequestInit } from '@miniflare/core';
import { Response } from '@miniflare/core';
import { SetupResult } from '@miniflare/shared';
import { Storage } from '@miniflare/shared';
import { StorageFactory } from '@miniflare/shared';
import { StorageListOptions } from '@miniflare/shared';
import { StorageListResult } from '@miniflare/shared';
import { StoredKey } from '@miniflare/shared';
import { StoredValue } from '@miniflare/shared';
export declare const ALARM_KEY = "__MINIFLARE_ALARMS__";
export declare class AlarmStore {
#private;
setupStore(storage: StorageFactory, persist?: boolean | string): Promise;
setupAlarms(callback?: (objectKey: string) => Promise): Promise;
buildBridge(objectKey: string): DurableObjectAlarmBridge;
setAlarm(objectKey: string, scheduledTime: number | Date): Promise;
deleteAlarm(key: string): Promise;
flushAlarms(keys?: string[]): Promise;
dispose(): void;
}
export declare interface DurableObject {
fetch(request: Request): Awaitable;
alarm?(): Awaitable;
}
export declare interface DurableObjectAlarm {
scheduledTime: number;
timeout?: NodeJS.Timeout;
}
export declare interface DurableObjectAlarmBridge {
setAlarm: (scheduledTime: number | Date) => Promise;
deleteAlarm: () => Promise;
}
export declare interface DurableObjectConstructor {
new (state: DurableObjectState, env: Context): DurableObject;
}
export declare class DurableObjectError extends MiniflareError {
}
export declare type DurableObjectErrorCode = "ERR_SCRIPT_NOT_FOUND" | "ERR_CLASS_NOT_FOUND" | "ERR_RESPONSE_TYPE" | "ERR_DESERIALIZATION" | "ERR_NO_HANDLER";
export declare type DurableObjectFactory = (id: DurableObjectId) => Promise;
export declare interface DurableObjectGetAlarmOptions {
allowConcurrency?: boolean;
}
export declare interface DurableObjectGetOptions {
allowConcurrency?: boolean;
noCache?: boolean;
}
export declare class DurableObjectId {
#private;
readonly name?: string | undefined;
readonly [kObjectName]: string;
constructor(objectName: string, hexId: string, name?: string | undefined);
equals(other: DurableObjectId): boolean;
toString(): string;
}
export declare interface DurableObjectListOptions extends DurableObjectGetOptions {
start?: string;
startAfter?: string;
end?: string;
prefix?: string;
reverse?: boolean;
limit?: number;
}
export declare class DurableObjectNamespace {
#private;
constructor(objectName: string, factory: DurableObjectFactory, ctx?: PluginContext);
jurisdiction(name: string): DurableObjectNamespace;
newUniqueId(options?: NewUniqueIdOptions): DurableObjectId;
idFromName(name: string): DurableObjectId;
idFromString(hexId: string): DurableObjectId;
get(id: DurableObjectId): DurableObjectStub;
}
export declare interface DurableObjectOperator {
get(key: string, options?: DurableObjectGetOptions): Promise;
get(keys: string[], options?: DurableObjectGetOptions): Promise