UNPKG

rest-client-sdk

Version:
31 lines (30 loc) 1.3 kB
import AbstractClient from '../client/AbstractClient'; import Attribute from './Attribute'; import Relation from './Relation'; declare type AttributeListType = { [key: string]: Attribute; }; export declare type DefaultSerializedModelType = { [key: string]: null | null[]; }; declare class ClassMetadata { #private; readonly key: string; readonly pathRoot: string; repositoryClass: typeof AbstractClient; /** * @param {string} key mandatory, will be passed in your serializer * @param {string|null} pathRoot the endpoint of your API: will be added to the mapping prefix ('/v1' here) * @param {typeof AbstractClient} repositoryClass [Overriding repository]{@link https://github.com/mapado/rest-client-js-sdk#overriding-repository} for more detail */ constructor(key: string, pathRoot?: string | null, repositoryClass?: typeof AbstractClient); getAttribute(name: string): Attribute; hasIdentifierAttribute(): boolean; getIdentifierAttribute(): Attribute; getAttributeList(): AttributeListType; setAttributeList(attributeList: Attribute[]): void; setRelationList(relationList: Relation[]): void; getRelation(key: string): Relation; getDefaultSerializedModel(): DefaultSerializedModelType; } export default ClassMetadata;