@accordproject/concerto-core
Version:
Core Implementation for the Concerto Modeling Language
70 lines (69 loc) • 2.49 kB
TypeScript
declare const Identifiable: any;
/**
*
* Resource is an instance that has a type. The type of the resource
* specifies a set of properites (which themselves have types).
*
*
* Type information in Concerto is used to validate the structure of
* Resource instances and for serialization.
*
*
* Resources are used in Concerto to represent Assets, Participants, Transactions and
* other domain classes that can be serialized for long-term persistent storage.
*
* @extends Identifiable
* @see See {@link Resource}
* @class
* @memberof module:concerto-core
* @public
*/
declare class Resource extends Identifiable {
/**
* This constructor should not be called directly.
* <p>
* <strong>Note: Only to be called by framework code. Applications should
* retrieve instances from {@link Factory}</strong>
* </p>
*
* @param {ModelManager} modelManager - The ModelManager for this instance
* @param {ClassDeclaration} classDeclaration - The class declaration for this instance.
* @param {string} ns - The namespace this instance.
* @param {string} type - The type this instance.
* @param {string} id - The identifier of this instance.
* @param {string} timestamp - The timestamp of this instance
* @private
*/
constructor(modelManager: any, classDeclaration: any, ns: any, type: any, id: any, timestamp: any);
/**
* Returns the string representation of this class
* @return {String} the string representation of the class
*/
toString(): string;
/**
* Determine if this identifiable is a resource.
* @return {boolean} True if this identifiable is a resource,
* false if not.
*/
isResource(): boolean;
/**
* Determine if this identifiable is a concept.
* @return {boolean} True if this identifiable is a concept,
* false if not.
*/
isConcept(): any;
/**
* Determine if this object is identifiable.
* @return {boolean} True if this object has an identifiying field
* false if not.
*/
isIdentifiable(): any;
/**
* Serialize this resource into a JavaScript object suitable for serialization to JSON,
* using the default options for the serializer. If you need to set additional options
* for the serializer, use the {@link Serializer#toJSON} method instead.
* @return {Object} A JavaScript object suitable for serialization to JSON.
*/
toJSON(): any;
}
export = Resource;