import { PrimaryKey, Relation, PolymorphRelation, SchemaMap, DefineRelationMap, MetadataField } from './types'; export default class Schema { static HAS_ONE: string; static HAS_MANY: string; static BELONGS_TO: string; static BELONGS_TO_MANY: string; static MORPH_TO: string; attributes: string[]; metadata: MetadataField; primaryKey: PrimaryKey; relations: Relation[]; relationTypes: { [key: string]: string; }; resourceName: string; /** * Represents a basic relational schema for an entity. */ constructor(resourceName: string, primaryKey?: PrimaryKey | MetadataField, metadata?: MetadataField); /** * Map a list of attribute names. */ addAttributes(attributes: string[]): this; /** * Map a one/many relational schema to the current schema. */ addRelation(attribute: string, schema: Schema, relation: string, polymorph?: PolymorphRelation): this; /** * Map multiple relations for a specific type. */ addRelations(schemas: SchemaMap, relation: string): this; /** * Map belongs-to nested entities by attribute name. */ belongsTo(relations: SchemaMap): this; /** * Map belongs-to-many nested entities by attribute name. */ belongsToMany(relations: SchemaMap): this; /** * Define multiple relationships using a compact syntax. */ define(relations: DefineRelationMap): this; /** * Map has-one nested entities by attribute name. */ hasOne(relations: SchemaMap): this; /** * Map has-many nested entities by attribute name. */ hasMany(relations: SchemaMap): this; /** * Map morph-to nested entities by attribute name. */ morphTo(schemas: SchemaMap, attribute: string, typeSuffix?: string, keySuffix?: string): this; } //# sourceMappingURL=Schema.d.ts.map