diff --git a/packages/schema-dts-gen/src/ts/class.ts b/packages/schema-dts-gen/src/ts/class.ts index 8ff65b8..f7e4d4c 100644 --- a/packages/schema-dts-gen/src/ts/class.ts +++ b/packages/schema-dts-gen/src/ts/class.ts @@ -507,7 +507,13 @@ export class RoleBuiltin extends Builtin { ], /*type=*/ factory.createIntersectionTypeNode([ - factory.createTypeReferenceNode(baseName), + factory.createTypeReferenceNode( + /*typeName=*/ 'Omit', + /*typeArguments=*/ [ + factory.createTypeReferenceNode(baseName), + factory.createTypeReferenceNode(RoleBuiltin.kPropertyTypename), + ], + ), factory.createTypeLiteralNode([ new TypeProperty(this.subject).toNode(context), ]), diff --git a/packages/schema-dts-gen/test/baselines/role_inheritance_test.ts b/packages/schema-dts-gen/test/baselines/role_inheritance_test.ts index 713362a..ade863e 100644 --- a/packages/schema-dts-gen/test/baselines/role_inheritance_test.ts +++ b/packages/schema-dts-gen/test/baselines/role_inheritance_test.ts @@ -78,7 +78,7 @@ interface DateTimeLeaf extends DateTimeBase { } export type DateTime = DateTimeLeaf | string; -type OrganizationRoleLeaf = RoleBase & { +type OrganizationRoleLeaf = Omit & { "@type": "OrganizationRole"; } & { [key in TProperty]: TContent; @@ -88,7 +88,7 @@ export type OrganizationRole interface RoleBase extends ThingBase { "startDate"?: SchemaValue; } -type RoleLeaf = RoleBase & { +type RoleLeaf = Omit & { "@type": "Role"; } & { [key in TProperty]: TContent; diff --git a/packages/schema-dts-gen/test/baselines/role_simple_test.ts b/packages/schema-dts-gen/test/baselines/role_simple_test.ts index 37a7b3a..ee5d88b 100644 --- a/packages/schema-dts-gen/test/baselines/role_simple_test.ts +++ b/packages/schema-dts-gen/test/baselines/role_simple_test.ts @@ -78,7 +78,7 @@ export type DateTime = DateTimeLeaf | string; interface RoleBase extends ThingBase { "startDate"?: SchemaValue; } -type RoleLeaf = RoleBase & { +type RoleLeaf = Omit & { "@type": "Role"; } & { [key in TProperty]: TContent;