import type { Accessor } from '../../accessor/base.ts'; import type { OpKwargs, RegisteredOp } from '../registry.ts'; import type { PathSpec } from '../../types.ts'; type OpCoreFn = (...args: any[]) => unknown; /** * Structural subset of a backend's `CommandIO` the ops factory consumes. * The table in `commands/builtin//ops.ts` already carries every core * function the VFS/FUSE op wrappers forward to, so the same table feeds * both `makeGenericCommands` and `makeGenericOps`. Command-only fields * (`readStream`, `isMounted`, `find`, ...) are ignored. */ export interface OpsTable { readdir: (accessor: A, path: PathSpec, index?: OpKwargs['index']) => unknown; readBytes: (accessor: A, path: PathSpec, index?: OpKwargs['index']) => Promise; readRange?: (accessor: A, path: PathSpec, index: OpKwargs['index'], offset: number, size: number | null) => Promise; stat: (accessor: A, path: PathSpec, index?: OpKwargs['index']) => unknown; write?: OpCoreFn; mkdir?: OpCoreFn; unlink?: OpCoreFn; rmdir?: OpCoreFn; rename?: OpCoreFn; create?: OpCoreFn; truncate?: OpCoreFn; append?: OpCoreFn; setAttrs?: OpCoreFn; } export interface MakeGenericOpsOptions { /** * Synthesize truncate from readBytes + write for a backend with no * native partial write (dropbox is the only one; a table carrying a * real `truncate` wins outright). */ emulateTruncate?: boolean; /** Forward `parents=true` to the core mkdir (disk). */ mkdirParents?: boolean; /** Op names to skip because the backend registers an irregular wrapper. */ overrides?: ReadonlySet; } /** * Generate a backend's VFS/FUSE op set from its `CommandIO` table. * * The per-backend `ops//` wrapper modules were hand-written forwards * of a handful of shapes; this factory emits the same wrappers from the * table that already feeds `makeGenericCommands`, so a backend declares * its core surface once. Ops whose table field is undefined are * omitted, mirroring how the command factory skips write commands on * read-only backends. */ export declare function makeGenericOps(resource: string | readonly string[], table: OpsTable, options?: MakeGenericOpsOptions): RegisteredOp[]; export {}; //# sourceMappingURL=factory.d.ts.map