AnyMux

IndexedDB API reference

Exports of @anymux/indexeddb. Back to the module

Classes

IndexedDBFileSystem

class
class IndexedDBFileSystem

promises

property
promises: this

constants

property
constants: FSConstants

constructor

constructor
constructor(config?: Partial<IndexedDBConfig>): IndexedDBFileSystem

init

method
init(): Promise<void>

isImplemented

method
isImplemented(method: string): boolean

readFile

method
readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>

writeFile

method
writeFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

appendFile

method
appendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>

copyFile

method
copyFile(src: string, dest: string, mode?: number): Promise<void>

mkdir

method
mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>

readdir

method
readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>

readdir

method
readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: boolean; recursive?: boolean; }): Promise<string[] | Dirent[]>

rmdir

method
rmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

stat

method
stat(path: string, options?: { bigint?: false; }): Promise<Stats>

stat

method
stat(path: string, options: { bigint: true; }): Promise<BigIntStats>

stat

method
stat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

lstat

method
lstat(path: string, options?: { bigint?: false; }): Promise<Stats>

lstat

method
lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>

lstat

method
lstat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>

access

method
access(path: string, mode?: number): Promise<void>

rename

method
rename(oldPath: string, newPath: string): Promise<void>

unlink

method
unlink(path: string): Promise<void>

rm

method
rm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>

exists

method
exists(path: string): Promise<boolean>

truncate

method
truncate(path: string, len?: number): Promise<void>

utimes

method
utimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>

chmod

method
chmod(path: string, mode: string | number): Promise<void>

chown

method
chown(path: string, uid: number, gid: number): Promise<void>

readlink

method
readlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>

symlink

method
symlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>

link

method
link(existingPath: string, newPath: string): Promise<void>

createReadStream

method
createReadStream(path: string, options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream

createWriteStream

method
createWriteStream(path: string, options?: { encoding?: BufferEncoding; flags?: string; mode?: number; }): WriteStream

watch

method
watch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcher

open

method
open(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>

opendir

method
opendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>

realpath

method
realpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>

cp

method
cp(src: string, dest: string, options?: any): Promise<void>

mkdtemp

method
mkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>

statfs

method
statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>

statfs

method
statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>

statfs

method
statfs(_path: string, _options?: { bigint?: boolean; }): Promise<StatFs | BigIntStatFs>

lutimes

method
lutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>

lchown

method
lchown(path: string, uid: number, gid: number): Promise<void>

lchmod

method
lchmod(path: string, mode: string | number): Promise<void>

Types

IndexedDBConfig

type
type IndexedDBConfig = { dbName?: string; storeName?: string; version?: number; }

Constants

IndexedDBConfigSchema

const
const IndexedDBConfigSchema: z.ZodObject<{ dbName: z.ZodDefault<z.ZodString>; storeName: z.ZodDefault<z.ZodString>; version: z.ZodDefault<z.ZodNumber>; }, "strip", z.ZodTypeAny, { dbName?: string; storeName?: string; version?: number; }, { dbName?: string; storeName?: string; version?: number; }>