UNPKG

@girin/framework

Version:

Core modules for Girin: GraphQL server framework

31 lines 880 B
/// <reference types="node" /> import { Module } from '@girin/environment'; import { Readable } from 'stream'; export interface StorageObject { /** * ID of storage object */ id: string; /** * filename */ filename: string; /** * Content of object as a readable stream */ open(): Readable; /** * Object size in bytes */ contentLength: number; } export declare abstract class ObjectStorage extends Module { readonly label: string; abstract save(bucket: string, filename: string, content: Readable): Promise<StorageObject>; abstract delete(bucket: string, id: string): Promise<void>; abstract get(bucket: string, id: string): Promise<StorageObject>; } export declare class StorageObjectNotFoundError extends Error { constructor(objectId: string); } //# sourceMappingURL=ObjectStorage.d.ts.map