import type { Class } from '@travetto/runtime'; import type { ModelIdSource, ModelType, OptionalId } from '../types/model.ts'; /** * Interface for basic data interface * @concrete */ export interface ModelBasicSupport { /** * Id Source */ idSource: ModelIdSource; /** * Get underlying client */ get client(): C; /** * Get by Id * @param id The identifier of the document to retrieve * @throws {NotFoundError} When an item is not found */ get(cls: Class, id: string): Promise; /** * Create new item * @param item The document to create * @throws {ExistsError} When an item with the provided id already exists */ create(cls: Class, item: OptionalId): Promise; /** * Delete an item * @param id The id of the document to delete * @throws {NotFoundError} When an item is not found */ delete(cls: Class, id: string): Promise; }