/** Maximum accepted UTF-8 manifest size (256 KiB). */ export declare const MAX_EXTENSION_MANIFEST_BYTES: number; /** Manifest grammar selected by the caller. */ export type ExtensionManifestSyntax = "json" | "jsonc"; /** Metadata required to validate that a path and open handle identify one file. */ export interface ExtensionManifestFileInfo { readonly isFile: boolean; readonly isSymlink: boolean; readonly size: number | bigint; readonly dev: number | bigint | null; readonly ino: number | bigint | null; } /** Narrow file handle used by the manifest reader and its deterministic tests. */ export interface ExtensionManifestFileHandle { read(buffer: Uint8Array): Promise; stat(): Promise; close(): void | Promise; } /** Narrow filesystem seam used to make identity races and stream growth testable. */ export interface ExtensionManifestFileSystem { lstat(path: string): Promise; open(path: string): Promise; isNotFound(error: unknown): boolean; } /** Options for reading an extension manifest. */ export interface ReadExtensionManifestOptions { /** Select strict JSON or JSON-with-comments explicitly. */ readonly syntax: ExtensionManifestSyntax; /** @internal Deterministic filesystem seam for tests and platform adapters. */ readonly fileSystem?: ExtensionManifestFileSystem; } /** Missing manifests are data, not parse or I/O failures. */ export type ExtensionManifestReadResult = { readonly kind: "missing"; } | { readonly kind: "found"; readonly manifest: T; readonly bytesRead: number; }; /** * Parse strict JSON or the hardened JSONC subset used for Deno manifests. * * JSONC accepts comments, trailing commas, Deno's Unicode whitespace, and an * empty/comment-only document. It deliberately keeps JSON's double-quoted * strings and property names: Deno's optional loose keys and single-quoted * strings are rejected rather than approximated with brittle rewriting. */ export declare function parseExtensionManifest(source: string, syntax: ExtensionManifestSyntax, path?: string): T; /** * Read and parse one extension manifest through one file handle. * * The reader rejects terminal symlinks and non-regular files, verifies that * pre-open, current-path, and handle identities agree, and caps all reads at a * fixed `MAX + 1` buffer so concurrent file growth remains bounded. */ export declare function readExtensionManifest(path: string, options: ReadExtensionManifestOptions): Promise>; //# sourceMappingURL=manifest-reader.d.ts.map