export {}; interface Deno { // 这里添加 Deno 的 API 定义 args: string[]; env: NodeJS.ProcessEnv; exit: (code?: number) => never; chdir: (directory: string) => void; cwd: () => string; version: { deno: string; v8: string; typescript: string }; open(path: string | URL, options?: OpenOptions): Promise; readFile: (path: string | URL) => Promise; writeFile( path: string | URL, data: Uint8Array | ReadableStream, options?: WriteFileOptions, ): Promise; } declare global { var __cn_font_split_version__: string; var Deno: Deno; // eslint-disable-line no-var } interface FsFile { readonly rid: number; readonly readable: ReadableStream; readonly writable: WritableStream; } interface OpenOptions { /** Sets the option for read access. This option, when `true`, means that * the file should be read-able if opened. * * @default {true} */ read?: boolean; /** Sets the option for write access. This option, when `true`, means that * the file should be write-able if opened. If the file already exists, * any write calls on it will overwrite its contents, by default without * truncating it. * * @default {false} */ write?: boolean; /** Sets the option for the append mode. This option, when `true`, means * that writes will append to a file instead of overwriting previous * contents. * * Note that setting `{ write: true, append: true }` has the same effect as * setting only `{ append: true }`. * * @default {false} */ append?: boolean; /** Sets the option for truncating a previous file. If a file is * successfully opened with this option set it will truncate the file to `0` * size if it already exists. The file must be opened with write access * for truncate to work. * * @default {false} */ truncate?: boolean; /** Sets the option to allow creating a new file, if one doesn't already * exist at the specified path. Requires write or append access to be * used. * * @default {false} */ create?: boolean; /** If set to `true`, no file, directory, or symlink is allowed to exist at * the target location. Requires write or append access to be used. When * createNew is set to `true`, create and truncate are ignored. * * @default {false} */ createNew?: boolean; /** Permissions to use if creating the file (defaults to `0o666`, before * the process's umask). * * Ignored on Windows. */ mode?: number; } interface WriteFileOptions { /** If set to `true`, will append to a file instead of overwriting previous * contents. * * @default {false} */ append?: boolean; /** Sets the option to allow creating a new file, if one doesn't already * exist at the specified path. * * @default {true} */ create?: boolean; /** If set to `true`, no file, directory, or symlink is allowed to exist at * the target location. When createNew is set to `true`, `create` is ignored. * * @default {false} */ createNew?: boolean; /** Permissions always applied to file. */ mode?: number; /** An abort signal to allow cancellation of the file write operation. * * If the signal becomes aborted the write file operation will be stopped * and the promise returned will be rejected with an {@linkcode AbortError}. */ signal?: AbortSignal; }