import { APIGuardConfig, ED25519KeypairBase64, FetchOptions, HttpMethod, NormalizedRequest, SignedHeaders, SignOptions, VerifyResult } from "./types"; /** * APIGuard * --- * Environment-agnostic Ed25519 request signing & verification. * Works identically in: browser, Node.js, Cloudflare Workers, Next.js. */ export declare class APIGuard { private static instance; private mode; private keyId?; private secretKey?; private publicKey?; private publicKeyRegistry; private maxSkewMs; private nonceStore; private constructor(); static init(config: APIGuardConfig): APIGuard; private static getInstance; static sign(method: HttpMethod | string, path: string, opts?: SignOptions): Promise; static verify(input: Request | NormalizedRequest): Promise; static verifyOrThrow(input: Request | NormalizedRequest): Promise<{ keyId: string; timestamp: number; }>; static generateKeyPair(): ED25519KeypairBase64; /** Wipes this instance's private key material. Call when rotating keys * or tearing down (hot-reload in dev, explicit shutdown, etc). */ dispose(): void; get isReady(): boolean; get currentKeyId(): string | undefined; /** Safe to expose/distribute — this is the public half only. */ get publicKeyBase64(): string | undefined; get trustedKeyIds(): string[]; sign(method: HttpMethod | string, path: string, opts?: SignOptions): Promise; verify(input: Request | NormalizedRequest): Promise; /** Convenience wrapper for callers who prefer throw-on-failure. */ verifyOrThrow(input: Request | NormalizedRequest): Promise<{ keyId: string; timestamp: number; }>; static normalize(input: Request | NormalizedRequest): Promise; private static isFetchRequest; /** * Internal helper to sign a request and immediately dispatch it via fetch() */ private fetchWithSignature; GET(url: string | URL, options?: Omit): Promise; POST(url: string | URL, options?: FetchOptions): Promise; PUT(url: string | URL, options?: FetchOptions): Promise; PATCH(url: string | URL, options?: FetchOptions): Promise; DELETE(url: string | URL, options?: FetchOptions): Promise; }