opfs-worker
Version:
A robust TypeScript library for working with Origin Private File System (OPFS) through Web Workers
57 lines • 1.72 kB
TypeScript
/**
* Base error class for all OPFS-related errors
*/
export declare class OPFSError extends Error {
readonly code: string;
readonly path?: string | undefined;
constructor(message: string, code: string, path?: string | undefined, cause?: any);
}
/**
* Error thrown when OPFS is not supported in the current browser
*/
export declare class OPFSNotSupportedError extends OPFSError {
constructor(cause?: unknown);
}
/**
* Error thrown when OPFS is not mounted
*/
export declare class OPFSNotMountedError extends OPFSError {
constructor(cause?: unknown);
}
/**
* Error thrown for invalid paths or path traversal attempts
*/
export declare class PathError extends OPFSError {
constructor(message: string, path: string, cause?: unknown);
}
/**
* Error thrown when a requested file doesn't exist
*/
export declare class FileNotFoundError extends OPFSError {
constructor(path: string, cause?: unknown);
}
/**
* Error thrown when a requested directory doesn't exist
*/
export declare class DirectoryNotFoundError extends OPFSError {
constructor(path: string, cause?: unknown);
}
/**
* Error thrown when permission is denied for an operation
*/
export declare class PermissionError extends OPFSError {
constructor(path: string, operation: string, cause?: unknown);
}
/**
* Error thrown when an operation fails due to insufficient storage
*/
export declare class StorageError extends OPFSError {
constructor(message: string, path?: string, cause?: unknown);
}
/**
* Error thrown when an operation times out
*/
export declare class TimeoutError extends OPFSError {
constructor(operation: string, path?: string, cause?: unknown);
}
//# sourceMappingURL=errors.d.ts.map