Browse Source

chore: wrap options & allow extending storage adapter (#9123)

pull/9124/head
Mert E. 5 months ago committed by GitHub
parent
commit
8dbf2f101a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 22
      packages/nc-plugin/src/lib/IStorageAdapterV2.ts

22
packages/nc-plugin/src/lib/IStorageAdapterV2.ts

@ -13,21 +13,23 @@ import IStorageAdapter from './IStorageAdapter';
The methods are not used in current codebase, but will be used in future.
*/
export default interface IStorageAdapterV2 extends IStorageAdapter {
export default interface IStorageAdapterV2<
FileCreateByUrlOptions extends {
fetchOptions?: {
buffer?: boolean;
};
} = {
fetchOptions?: {
buffer?: boolean;
};
}
> extends IStorageAdapter {
fileCreateByUrl(
destPath: string,
url: string,
fileMeta?: FileMeta,
fetchOptions?: any
options?: FileCreateByUrlOptions
): Promise<any>;
fileCreateByStream(destPath: string, readStream: Readable): Promise<void>;
fileReadByStream(key: string): Promise<Readable>;
getDirectoryList(path: string): Promise<string[]>;
}
interface FileMeta {
fileName?: string;
mimetype?: string;
size?: number | string;
}

Loading…
Cancel
Save