Skip to content

Commit ed7e5f7

Browse files
authored
refactor(engine-core): propdef type make enum (salesforce#1960)
1 parent 15dcf46 commit ed7e5f7

File tree

1 file changed

+6
-2
lines changed
  • packages/@lwc/engine-core/src/framework

1 file changed

+6
-2
lines changed

packages/@lwc/engine-core/src/framework/def.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,13 @@ const lightingElementDef: ComponentDef = {
270270
render: BaseLightningElement.prototype.render,
271271
};
272272

273+
enum PropDefType {
274+
any = 'any',
275+
}
276+
273277
interface PropDef {
274278
config: number;
275-
type: string;
279+
type: PropDefType;
276280
attr: string;
277281
}
278282
type PublicMethod = (...args: any[]) => any;
@@ -299,7 +303,7 @@ export function getComponentDef(Ctor: any, subclassComponentName?: string): Publ
299303
// avoid leaking the reference to the public props descriptors
300304
publicProps[key] = {
301305
config: propsConfig[key] || 0, // a property by default
302-
type: 'any', // no type inference for public services
306+
type: PropDefType.any, // no type inference for public services
303307
attr: getAttrNameFromPropName(key),
304308
};
305309
}

0 commit comments

Comments
 (0)