Skip to content

Commit

Permalink
#13, ClassMembersMap, adding missed JSDoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajvincent committed Jan 13, 2024
1 parent 09c5fee commit 53fce4b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion stage_1_integration/toolbox/ClassMembersMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ extends Map<string, ClassMemberImpl>
return rv;
}

/**
* Create a `ClassMembersMap` from a class declaration.
* @param classDecl - the class declaration.
* @returns the class members map.
*/
static fromClassDeclaration(
classDecl: ClassDeclarationImpl
): ClassMembersMap
Expand Down Expand Up @@ -162,6 +167,11 @@ extends Map<string, ClassMemberImpl>
return undefined;
}

/**
* Convert get and/or set accessors to a property. This may be lossy, but we try to be faithful.
* @param isStatic - true if the property is static (and the accessors should be)
* @param name - the property name
*/
convertAccessorsToProperty(
isStatic: boolean,
name: string
Expand Down Expand Up @@ -210,7 +220,7 @@ extends Map<string, ClassMemberImpl>
}

/**
*
* Convert a property to get and/or set accessors. This may be lossy, but we try to be faithful.
* @param isStatic - true if the property is static (and the accessors should be)
* @param name - the property name
* @param toGetter - true if the caller wants a getter
Expand Down
12 changes: 11 additions & 1 deletion stage_2_fullset/snapshot/source/toolbox/ClassMembersMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export default class ClassMembersMap extends Map<string, ClassMemberImpl> {
return rv;
}

/**
* Create a `ClassMembersMap` from a class declaration.
* @param classDecl - the class declaration.
* @returns the class members map.
*/
static fromClassDeclaration(
classDecl: ClassDeclarationImpl,
): ClassMembersMap {
Expand Down Expand Up @@ -135,6 +140,11 @@ export default class ClassMembersMap extends Map<string, ClassMemberImpl> {
return undefined;
}

/**
* Convert get and/or set accessors to a property. This may be lossy, but we try to be faithful.
* @param isStatic - true if the property is static (and the accessors should be)
* @param name - the property name
*/
convertAccessorsToProperty(isStatic: boolean, name: string): void {
const getter = this.getAsKind<StructureKind.GetAccessor>(
StructureKind.GetAccessor,
Expand Down Expand Up @@ -206,7 +216,7 @@ export default class ClassMembersMap extends Map<string, ClassMemberImpl> {
}

/**
*
* Convert a property to get and/or set accessors. This may be lossy, but we try to be faithful.
* @param isStatic - true if the property is static (and the accessors should be)
* @param name - the property name
* @param toGetter - true if the caller wants a getter
Expand Down

0 comments on commit 53fce4b

Please sign in to comment.