@uploadx/core
Version:
Node.js resumable upload middleware
27 lines (26 loc) • 838 B
TypeScript
import { File } from './file';
import { MetaStorage, MetaStorageOptions, UploadList } from './meta-storage';
export interface LocalMetaStorageOptions extends MetaStorageOptions {
/**
* Where the upload metadata should be stored
*/
directory?: string;
}
/**
* Stores upload metafiles on local disk
*/
export declare class LocalMetaStorage<T extends File = File> extends MetaStorage<T> {
readonly directory: string;
constructor(config?: LocalMetaStorageOptions);
/**
* Returns metafile path
* @param id - upload id
*/
getMetaPath: (id: string) => string;
save(id: string, file: T): Promise<T>;
touch(id: string, file: T): Promise<T>;
get(id: string): Promise<T>;
delete(id: string): Promise<void>;
list(prefix?: string): Promise<UploadList>;
private accessCheck;
}