@sidekick-coder/db
Version:
Cli Tool to manipulate data from diferent sources
45 lines (42 loc) • 1.93 kB
text/typescript
import { ReadRecordOptions, ReadOutput } from './createFilesystem.cjs';
import { FilesystemOptionsPath, FilesystemOptionsFs } from './types.cjs';
import '../validator/validate.cjs';
import '../validator/valibot.cjs';
import 'valibot';
import '../validator/types.cjs';
declare function createFilesystemFake(): {
path: FilesystemOptionsPath;
fs: FilesystemOptionsFs;
exists: (path: string) => Promise<boolean>;
existsSync: (path: string) => boolean;
read: {
(filepath: string): Promise<Uint8Array>;
text(filepath: string, options?: any): Promise<any>;
json<T extends ReadRecordOptions>(filepath: string, options?: T): Promise<ReadOutput<T>>;
yaml(filepath: string, options?: any): Promise<any>;
};
readSync: {
(filepath: string): Uint8Array;
text(filepath: string, defaultValue?: string): string;
json<T extends ReadRecordOptions>(filepath: string, options?: T): ReadOutput<T>;
yaml(filepath: string, options?: any): any;
};
readdir: (filepath: string) => Promise<string[]>;
readdirSync: (filepath: string) => string[];
write: {
(filename: string, content: Uint8Array, options?: any): Promise<void>;
text(filename: string, content: string, options?: any): Promise<void>;
json(filename: string, content: any, options?: any): Promise<void>;
};
writeSync: {
(filename: string, content: Uint8Array, options?: any): void;
text(filename: string, content: string, options?: any): void;
json(filename: string, content: any, options?: any): void;
};
mkdir: (filepath: string, options?: any) => Promise<void>;
mkdirSync: (filepath: string, options?: any) => void;
remove: (filepath: string) => Promise<void>;
removeSync: (filepath: string) => void;
removeAt: (filepath: string, miliseconds: number) => Promise<boolean>;
};
export { createFilesystemFake };