Skip to content

Commit 289be00

Browse files
authoredJun 13, 2024··
Base types should not be never (#2612)
* Base types should be extensible and equals to {} if empty * add revamped types.ts to output folder * linter fix
1 parent 32c23a5 commit 289be00

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed
 

Diff for: ‎output/typescript/types.ts

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎typescript-generator/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function buildInterface (type: M.Interface): string {
196196
const openGenerics = type.generics?.map(t => t.name) ?? []
197197
const inherits = buildInherits(type, openGenerics)
198198
let code = `export interface ${createName(type.name)}${buildGenerics(type.generics, openGenerics)}${inherits} {\n`
199-
if (type.properties.length === 0 && type.attachedBehaviors == null && inherits.length === 0) {
199+
if (type.properties.length === 0 && type.attachedBehaviors == null && inherits.length === 0 && !type.name.name.endsWith('Base')) {
200200
if (process.env.KIBANA == null) {
201201
code += ' [key: string]: never\n'
202202
}

0 commit comments

Comments
 (0)
Please sign in to comment.