import type { Files } from "../index.js"; import type { Authorize } from "../internal/files-router/authorize.js"; import type { FilesOperation } from "../internal/files-router/protocol.js"; import type { AllowedOrigins } from "../internal/router-core/origin.js"; export type { Authorize, AuthorizeContext, AuthorizeResult, Scope, } from "../internal/files-router/authorize.js"; export type { FilesOperation } from "../internal/files-router/protocol.js"; export type { AllowedOrigins } from "../internal/router-core/origin.js"; export interface CreateFilesRouterOptions { /** A `Files` instance, or a per-request factory (multi-tenant). Pass `files.readonly()` to hard-deny writes. */ files: Files | ((req: Request) => Files | Promise); /** Per-operation gate. Deny-by-default when omitted (only `capabilities` answers). */ authorize?: Authorize; /** Declarative allow-list: operations permitted without a hook. A hard gate that runs before `authorize`. */ operations?: readonly FilesOperation[]; /** CSRF/origin allowlist for state-changing actions. Off by default; strongly recommended. */ allowedOrigins?: AllowedOrigins; /** Default + clamp for `url()`/`download` expiry, seconds. Default 300; clamped to capability. */ defaultExpiresIn?: number; /** Force `Content-Disposition: attachment` on the proxy-download path unless `authorize` opts inline. Default true. */ forceDownloadDisposition?: boolean; /** Cap on a `list` page. Default 1000. */ maxListLimit?: number; /** Cap on `search` results returned in one page. Default 1000. */ maxSearchResults?: number; /** Reject uploads larger than this (bytes) — bound into the presigned policy + verified on complete. */ maxUploadSize?: number; /** `download` strategy. Default `"auto"` (redirect when the adapter can sign, else proxy). */ downloadMode?: "auto" | "redirect" | "proxy"; /** A `Range` request on a non-range adapter. Default `"reject"` (416). */ onUnsupportedRange?: "reject" | "ignore"; /** HMAC secret for the upload round-trip tokens. Falls back to `FILES_API_SECRET`, then a per-process random (warns). */ secret?: string; /** Clock injection point for token expiry; defaults to `Date.now`. */ now?: () => number; } export interface FilesApi { /** The framework-agnostic core every binding calls. */ handle(req: Request): Promise; } export declare const createFilesRouter: (opts: CreateFilesRouterOptions) => FilesApi; //# sourceMappingURL=index.d.ts.map