feat(codegen): emit module boundary in TypeScript definitions
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
1d11472136
commit
c088e5a5ac
2 changed files with 3 additions and 0 deletions
|
|
@ -95,6 +95,7 @@ func TestGenerateTypeScriptDefinitions_DeduplicatesAndOrders_Good(t *testing.T)
|
|||
assert.Equal(t, 1, countSubstr(dts, `"alpha-panel": AlphaPanel;`))
|
||||
assert.Equal(t, 1, countSubstr(dts, `export declare class AlphaPanel extends HTMLElement`))
|
||||
assert.Equal(t, 1, countSubstr(dts, `export declare class ZedPanel extends HTMLElement`))
|
||||
assert.Contains(t, dts, "export {};")
|
||||
assert.Less(t, strings.Index(dts, `"alpha-panel": AlphaPanel;`), strings.Index(dts, `"zed-panel": ZedPanel;`))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,5 +55,7 @@ func GenerateTypeScriptDefinitions(slots map[string]string) string {
|
|||
b.WriteString("}\n\n")
|
||||
}
|
||||
|
||||
b.WriteString("export {};\n")
|
||||
|
||||
return b.String()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue