import { StrictAttributes, ConvinienceAttributes, InvalidPropertyMap, DatabaseValues } from './types.d'; import FundementalDatabaseModel from './fundementalDatabaseModel'; export default abstract class SchematicDatabaseModel extends FundementalDatabaseModel { [index: string]: any; protected static tableName: string; protected static primaryKey: string; protected static primaryKeyType: string; protected static attributes: ConvinienceAttributes; protected static parsedAttributes: StrictAttributes; /** -- initialization ---------------------------------------------------------- */ constructor(props: any); /** -- schema validation ---------------------------------------------------------- */ /** validate the props passed based on schema */ static validate(props: any): InvalidPropertyMap; /** convert the defined schema into a validated and actionable schema object - caches the schema results */ protected static getParsedAttributes(): StrictAttributes; /** -- Convinience CRUD ------------------------------------------------------- */ /** save - creates if primaryKeyValue is set, updates if not */ save(): Promise; /** upsert - uses the upsert query to ensure that 1. the object, identified by its unique static fields, is created 2. any dynamic data of the object is updated to the newly passed most recent state - uses the findByUniqueAttributes to find the object details now that we guarenteed it exists and is up to date @returns {boolean} - was the object created or not; */ upsert(): Promise; /** -- CRUD Implementation ------------------------------------------------------- */ create(): Promise; /** -- data manipulation ---------------------------------------------------------- */ databaseValues: DatabaseValues; }