forked from accordproject/concerto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): refactor metamodel object into class (contributes to acco…
…rdproject#402) Signed-off-by: Simon Stone <[email protected]>
- Loading branch information
Simon Stone
authored and
Simon Stone
committed
Mar 22, 2022
1 parent
75c5b42
commit a183bbf
Showing
4 changed files
with
81 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 22 additions & 16 deletions
38
packages/concerto-core/types/lib/introspect/metamodel.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
export = MetaModel; | ||
/** | ||
* Create a metamodel manager (for validation against the metamodel) | ||
* @return {*} the metamodel manager | ||
* Class containing static helper methods for the metamodel. | ||
*/ | ||
export function newMetaModelManager(): any; | ||
/** | ||
* Validate metamodel instance against the metamodel | ||
* @param {object} input - the metamodel instance in JSON | ||
* @return {object} the validated metamodel instance in JSON | ||
*/ | ||
export function validateMetaModel(input: object): object; | ||
/** | ||
* Import metamodel to a model manager | ||
* @param {object} metaModel - the metamodel | ||
* @param {boolean} [validate] - whether to perform validation | ||
* @return {object} the metamodel for this model manager | ||
*/ | ||
export function modelManagerFromMetaModel(metaModel: object, validate?: boolean): object; | ||
declare class MetaModel { | ||
/** | ||
* Create a metamodel manager (for validation against the metamodel) | ||
* @return {*} the metamodel manager | ||
*/ | ||
static newMetaModelManager(): any; | ||
/** | ||
* Validate metamodel instance against the metamodel | ||
* @param {object} input - the metamodel instance in JSON | ||
* @return {object} the validated metamodel instance in JSON | ||
*/ | ||
static validateMetaModel(input: object): object; | ||
/** | ||
* Import metamodel to a model manager | ||
* @param {object} metaModel - the metamodel | ||
* @param {boolean} [validate] - whether to perform validation | ||
* @return {object} the metamodel for this model manager | ||
*/ | ||
static modelManagerFromMetaModel(metaModel: object, validate?: boolean): object; | ||
} |