datum-focus
Version:
Data shape, model, metadata, JSON, JSON Schema, GraphQL, MongoDB query and aggregations, iterator generators
14 lines (10 loc) • 390 B
text/typescript
import { Model } from '../model';
import { Repository } from './repository';
export type StorageAdapterParams = Record<string, boolean | number | string>;
/* new T(req, res) */
export type NewableStorageAdapter = {
new (params: StorageAdapterParams): StorageAdapter;
};
export interface StorageAdapter {
resolve<T>(collectionName: string, model: Model<T>): Promise<Repository<T>>;
}