import type { Class } from '@travetto/runtime'; import type { ModelType } from '../types/model.ts'; /** * This interface defines the behavior for dealing with the * underlying storage mechanism for the datastore. It handles when * a model is added/removed/changed. * * This is intended to be used during development only for rapid prototyping. * * @concrete */ export interface ModelStorageSupport { /** * Should storage modification be allowed */ readonly config?: { modifyStorage?: boolean; }; /** * Initialize storage */ createStorage(): Promise; /** * Delete storage */ deleteStorage(): Promise; /** * Creates model */ upsertModel?(cls: Class): Promise; /** * Exports model */ exportModel?(cls: Class): Promise; /** * Deletes model */ deleteModel?(cls: Class): Promise; /** * Removes all data from a model, but leaving the structure in place */ truncateModel?(cls: Class): Promise; /** * Truncate blob storage data */ truncateBlob?(): Promise; }