| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 662bf52 commit 2d8490f
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ import {ConfigBinding} from "./internalBinding/config"; | |||
| 4 | 4 | import {ConstantsBinding} from "./internalBinding/constants"; | |
| 5 | 5 | import {HttpParserBinding} from "./internalBinding/http_parser"; | |
| 6 | 6 | import {FsBinding} from "./internalBinding/fs"; | |
| 7 | + import {FsDirBinding} from "./internalBinding/fs_dir"; | ||
| 7 | 8 | import {MessagingBinding} from "./internalBinding/messaging"; | |
| 8 | 9 | import {OptionsBinding} from "./internalBinding/options"; | |
| 9 | 10 | import {OSBinding} from "./internalBinding/os"; | |
@@ -34,6 +35,7 @@ interface InternalBindingMap { | |||
| 34 | 35 | config: ConfigBinding; | |
| 35 | 36 | constants: ConstantsBinding; | |
| 36 | 37 | fs: FsBinding; | |
| 38 | + fs_dir: FsDirBinding; | ||
| 37 | 39 | http_parser: HttpParserBinding; | |
| 38 | 40 | messaging: MessagingBinding; | |
| 39 | 41 | options: OptionsBinding; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,25 +1,25 @@ | |||
| 1 | 1 | import { ConstantsBinding } from './constants'; | |
| 2 | 2 | ||
| 3 | + interface ReadFileContext { | ||
| 4 | + fd: number | undefined; | ||
| 5 | + isUserFd: boolean | undefined; | ||
| 6 | + size: number; | ||
| 7 | + callback: (err?: Error, data?: string | Uint8Array) => unknown; | ||
| 8 | + buffers: Uint8Array[]; | ||
| 9 | + buffer: Uint8Array; | ||
| 10 | + pos: number; | ||
| 11 | + encoding: string; | ||
| 12 | + err: Error | null; | ||
| 13 | + signal: unknown /* AbortSignal | undefined */; | ||
| 14 | + } | ||
| 15 | + | ||
| 3 | 16 | declare namespace InternalFSBinding { | |
| 4 | 17 | class FSReqCallback<ResultType = unknown> { | |
| 5 | 18 | constructor(bigint?: boolean); | |
| 6 | 19 | oncomplete: ((error: Error) => void) | ((error: null, result: ResultType) => void); | |
| 7 | 20 | context: ReadFileContext; | |
| 8 | 21 | } | |
| 9 | 22 | ||
| 10 | - interface ReadFileContext { | ||
| 11 | - fd: number | undefined; | ||
| 12 | - isUserFd: boolean | undefined; | ||
| 13 | - size: number; | ||
| 14 | - callback: (err?: Error, data?: string | Buffer) => unknown; | ||
| 15 | - buffers: Buffer[]; | ||
| 16 | - buffer: Buffer; | ||
| 17 | - pos: number; | ||
| 18 | - encoding: string; | ||
| 19 | - err: Error | null; | ||
| 20 | - signal: unknown /* AbortSignal | undefined */; | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | 23 | interface FSSyncContext { | |
| 24 | 24 | fd?: number; | |
| 25 | 25 | path?: string; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + import {InternalFSBinding, ReadFileContext} from './fs'; | ||
| 2 | + | ||
| 3 | + declare namespace InternalFSDirBinding { | ||
| 4 | + import FSReqCallback = InternalFSBinding.FSReqCallback; | ||
| 5 | + type Buffer = Uint8Array; | ||
| 6 | + type StringOrBuffer = string | Buffer; | ||
| 7 | + | ||
| 8 | + class DirHandle { | ||
| 9 | + read(encoding: string, bufferSize: number, _: unknown, ctx: ReadFileContext): string[] | undefined; | ||
| 10 | + close(_: unknown, ctx: ReadFileContext): void; | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + function opendir(path: StringOrBuffer, encoding: string, req: FSReqCallback): DirHandle; | ||
| 14 | + function opendir(path: StringOrBuffer, encoding: string, _: undefined, ctx: ReadFileContext): DirHandle; | ||
| 15 | + function opendirSync(path: StringOrBuffer): DirHandle; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + export interface FsDirBinding { | ||
| 19 | + opendir: typeof InternalFSDirBinding.opendir; | ||
| 20 | + opendirSync: typeof InternalFSDirBinding.opendirSync; | ||
| 21 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments