@dasch-swiss/dsp-js
Version:
JavaScript library that handles API requests to Knora
40 lines (39 loc) • 1.52 kB
TypeScript
import { ClassAndPropertyDefinitions } from "../../models/v2/ontologies/ClassAndPropertyDefinitions";
import { PropertyDefinition } from "../../models/v2/ontologies/property-definition";
import { TypeGuard } from "../../models/v2/resources/type-guard";
import { ResourceClassDefinitionWithPropertyDefinition } from "./resource-class-definition-with-property-definition";
/**
* Represents resource class definitions
* and property definitions the resource classes have cardinalities for.
*
* @category Model V2
*/
export declare class ResourceClassAndPropertyDefinitions extends ClassAndPropertyDefinitions {
/**
* Resource class definitions and their cardinalities.
*/
classes: {
[index: string]: ResourceClassDefinitionWithPropertyDefinition;
};
/**
* Property definitions referred to in cardinalities.
*/
properties: {
[index: string]: PropertyDefinition;
};
constructor(resClassDefs: {
[index: string]: ResourceClassDefinitionWithPropertyDefinition;
}, propDefs: {
[index: string]: PropertyDefinition;
});
/**
* Gets all property definitions from the resource's entity info.
*/
getAllPropertyDefinitions(): PropertyDefinition[];
/**
* Gets property definitions restricted by type from the resource's entity info.
*
* @param type restriction to a certain property definition type.
*/
getPropertyDefinitionsByType<T extends PropertyDefinition>(type: TypeGuard.Constructor<T>): T[];
}