Skip to content

Commit a8bb516

Browse files
Merge pull request #15 from electron/static-props
Setup for static properties (touchbar)
2 parents eaa478d + e057444 commit a8bb516

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/module-declaration.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,20 @@ const generateModuleDeclaration = (module, index, API) => {
129129
})
130130
}
131131

132+
// Class Static propreties
133+
if (module.staticProperties) {
134+
module.staticProperties
135+
.sort((a, b) => a.name.localeCompare(b.name))
136+
.forEach(prop => {
137+
if (prop.type === 'Class') {
138+
moduleAPI.push(`public static ${prop.name}: typeof ${prop.name}`);
139+
generateModuleDeclaration(prop, -1, API);
140+
} else {
141+
moduleAPI.push(`public static ${prop.name}: ${utils.typify(prop)}`);
142+
}
143+
})
144+
}
145+
132146
// Structure properties
133147
if (module.properties) {
134148
module.properties

0 commit comments

Comments
 (0)