Skip to content

Commit

Permalink
feat(map): add type defs
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Casey <[email protected]>
  • Loading branch information
jonathan-casey committed Oct 19, 2023
1 parent 72baa6b commit 8509709
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
9 changes: 9 additions & 0 deletions packages/concerto-core/types/lib/decoratormanager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ declare class DecoratorManager {
* @returns {object} the migrated DecoratorCommandSet object
*/
private static migrateTo;
/**
* Checks if the supplied decoratorCommandSet can be migrated.
* Migrations should only take place across minor versions of the same major version.
* @private
* @param {*} decoratorCommandSet the DecoratorCommandSet object
* @param {*} DCS_VERSION the DecoratorCommandSet version
* @returns {boolean} returns true if major versions are equal
*/
private static canMigrate;
/**
* Applies all the decorator commands from the DecoratorCommandSet
* to the ModelManager.
Expand Down
2 changes: 2 additions & 0 deletions packages/concerto-core/types/lib/introspect/mapkeytype.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare class MapKeyType extends Decorated {
*/
constructor(parent: MapDeclaration, ast: any);
parent: MapDeclaration;
modelFile: ModelFile;
/**
* Semantic validation of the structure of this class.
*
Expand Down Expand Up @@ -60,3 +61,4 @@ declare class MapKeyType extends Decorated {
}
import Decorated = require("./decorated");
import MapDeclaration = require("./mapdeclaration");
import ModelFile = require("./modelfile");
8 changes: 0 additions & 8 deletions packages/concerto-core/types/lib/introspect/mapvaluetype.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ declare class MapValueType extends Decorated {
* @return {boolean} true if the class is a Map Value
*/
isValue(): boolean;
/**
* Returns the corresponding ClassDeclaration representation of the Type
*
* @param {string} type - the Type of the Map Value
* @return {Object} the corresponding ClassDeclaration representation
* @private
*/
private getTypeDeclaration;
}
import Decorated = require("./decorated");
import MapDeclaration = require("./mapdeclaration");
Expand Down
17 changes: 12 additions & 5 deletions packages/concerto-core/types/lib/modelutil.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,17 @@ declare class ModelUtil {
*/
static isValidMapKeyScalar(decl: any): boolean;
/**
* Returns true if this Value is a valid Map Value.
*
* @param {Object} value - the Value of the Map Declaration
* @return {boolean} true if the Value is a valid Map Value
*/
* Returns true if this Value is a valid Map Value.
*
* @param {Object} value - the Value of the Map Declaration
* @return {boolean} true if the Value is a valid Map Value
*/
static isValidMapValue(value: any): boolean;
/**
* Returns the corresponding ClassDeclaration representation of the Map Type
* @param {string} type - the Type of the Map Value
* @param {Object} modelFile - the ModelFile that owns the Property
* @return {Object} the corresponding ClassDeclaration representation
*/
static getTypeDeclaration(type: string, modelFile: any): any;
}

0 comments on commit 8509709

Please sign in to comment.