Closed MasatoDev closed 2 months ago
Supportting TSTypeAliasDeclaration is needed for fixing the issue https://github.com/MasatoDev/boostest/issues/8. If it is a property of object, union type works.
TSTypeAliasDeclaration
+ export function boostestTSAliasMixUnionObjType<T>(args?: Partial<T>): T { + return ({ + 'ref_type':ref_type_boostestTSAliasMixUnionObjType(), + 'type':50000, + ...args + } as T); + } + + export function ref_type_boostestTSAliasMixUnionObjType<T>(args?: Partial<T>): T { + return ({ + ...args + } as T); + } + + export function boostestTSAliasMixUnionType<T>(args?: Partial<T>): T { + return ({ + ...args + } as T); + } + + export function boostestTSAliasStringUnionType<T>(args?: Partial<T>): T { + return ({ + ...args + } as T); + } + + export function boostestTSInterfaceMixUnionType<T>(args?: Partial<T>): T { + return ({ + 'type':50000, + ...args + } as T); + } + + export function boostestTSInterfaceStringUnionType<T>(args?: Partial<T>): T { + return ({ + 'type':'A', + ...args + } as T); + } +
Supportting
TSTypeAliasDeclaration
is needed for fixing the issue https://github.com/MasatoDev/boostest/issues/8. If it is a property of object, union type works.