Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,10 @@ def processOverloadedConstructors(self, theClass, children = None, templateDecl

def processEnum(self, theEnum):
output = ""
bindingsOutput = "export declare type " + theEnum.spelling + " = {\n"
bindingsOutput = "export declare type " + theEnum.spelling + " = { value: unique symbol };\n"
bindingsOutput += "export declare type " + theEnum.spelling + "_Vals = {\n"
for enumChild in list(theEnum.get_children()):
bindingsOutput += " " + enumChild.spelling + ": {};\n"
bindingsOutput += " " + enumChild.spelling + ": " + theEnum.spelling + ";\n"
bindingsOutput += "}\n\n"
output += bindingsOutput
self.exports.append(theEnum.spelling)
Expand Down
2 changes: 1 addition & 1 deletion src/buildFromYaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def getAdditionalBindCodeO():
" }\n" + \
" function analyzePath(path: string): AnalysisResults;\n" + \
"}\n\n" + \
"\nexport type OpenCascadeInstance = {FS: typeof FS} & {\n " + ";\n ".join(map(lambda x: x["export"] + ((": typeof " + x["export"]) if x["kind"] == "class" else (": " + x["export"])), typescriptExports)) + ";\n" + \
"\nexport type OpenCascadeInstance = {FS: typeof FS} & {\n " + ";\n ".join(map(lambda x: x["export"] + ((": typeof " + x["export"]) if x["kind"] == "class" else (": " + x["export"] + "_Vals")), typescriptExports)) + ";\n" + \
"};\n\n" + \
"declare function init(): Promise<OpenCascadeInstance>;\n\n" + \
"export default init;\n"
Expand Down