MasatoDev / boostest

14 stars 0 forks source link

[WIP]Fix: union type is not working [at type alias] #10

Closed MasatoDev closed 2 months ago

MasatoDev commented 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.

    + 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);
    + }
    +