Skip to content

Conversation

@RicoSuter
Copy link
Owner

@RicoSuter RicoSuter commented Jul 17, 2024

New

export interface Base {
    Type: EBase;
}

export type EBase = "OneChild" | "SecondChild";

export interface OneChild extends Base {
    A: string;
    Type: 'OneChild';
}

export interface SecondChild extends Base {
    B: string;
    Type: 'SecondChild';
}

export interface MyClass {
    Child: Base;
    Children: Base[];
}

Before

export interface Base {
    Type: EBase;
}

export type EBase = "OneChild" | "SecondChild";

export interface OneChild extends Base {
    A: string;
    Type: EBase;
}

export interface SecondChild extends Base {
    B: string;
    Type: EBase;
}

export interface MyClass {
    Child: Base;
    Children: Base[];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants