export interface IColumnData { column: string; property?: string; references?: IModelClass; primaryKey?: boolean; } export type IColumn = IColumnData | string; export type IColumns = Array | (() => Array); export interface IColumnInternalData { column: string; property: string; references?: IModelClass; primaryKey: boolean; } export type IColumnInternal = IColumnInternalData; export type IColumnsInternal = Array; export interface IModel { [key: string]: any; } export type IModelClass = new (props: any) => IModel; export interface ICollection { models: Array; } export interface IEntity { tableName: string; displayName?: string; collectionDisplayName?: string; columns: IColumns; Model: new (props: any) => T; Collection: new ({ models }: any) => ICollection; } export type IEntities = Array>; export interface IEntityInternal { tableName: string; displayName: string; collectionDisplayName: string; columns: IColumnsInternal; propertyNames: Array; Model: new (props: any) => T; Collection: new ({ models }: any) => ICollection; columnNames: Array; prefixedColumnNames: Array; primaryKeys: Array; references: object; selectColumnsClause: string; getPkId: (model: IModel) => string; columnToPropertyMap: Map; propertyToColumnMap: Map; referencesEntries: Array<{ property: string; ModelClass: IModelClass; }>; } export type IEntitiesInternal = Array>; export type IParseKind = 0 | 1 | 2 | 3 | 4; export type IArrayFieldParser = IParseKind | ((text: string) => any); export interface INamedField { name: string; } export type IArrayField = string | INamedField; export interface ICreateCoreOptions { entities: IEntities; } export interface ICore { createFromDatabase: >(rows: any) => T; createFromDatabaseArrays: >(rows: Array>, fields: Array, parseKinds?: Array | null) => T; createAnyFromDatabase: >(rows: any, rootKey: string | IModelClass) => T; createOneFromDatabase: (rows: any) => T; createOneOrNoneFromDatabase: (rows: any) => T | void; createManyFromDatabase: >(rows: any) => T; tables: { [key: string]: { columns: string; }; }; getEntityByModel: (model: IModel) => IEntityInternal; getEntityByTableName: (tableName: string) => IEntityInternal; } export declare const collectionSymbolFor: (collectionDisplayName: string) => symbol; export declare const createCore: ({ entities: externalEntities }: ICreateCoreOptions) => ICore;