Skip to content

Commit a5e99a1

Browse files
[Backport 8.14] Base types should not be never (#2615)
* Base types should be extensible and equals to {} if empty * add revamped types.ts to output folder * linter fix (cherry picked from commit 289be00) Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
1 parent 42a458c commit a5e99a1

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

output/typescript/types.ts

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript-generator/src/index.ts

Lines changed: 1 addition & 1 deletion
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)