1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
//// [tests/cases/compiler/discriminatedUnionWithIndexSignature.ts] ////
=== discriminatedUnionWithIndexSignature.ts ===
export interface UnionAltA {
>UnionAltA : Symbol(UnionAltA, Decl(discriminatedUnionWithIndexSignature.ts, 0, 0))
type?: 'text';
>type : Symbol(UnionAltA.type, Decl(discriminatedUnionWithIndexSignature.ts, 0, 28))
}
export interface UnionAltB {
>UnionAltB : Symbol(UnionAltB, Decl(discriminatedUnionWithIndexSignature.ts, 2, 1))
type?: 'image' | 'video' | 'document';
>type : Symbol(UnionAltB.type, Decl(discriminatedUnionWithIndexSignature.ts, 4, 28))
}
export type ValueUnion = UnionAltA | UnionAltB;
>ValueUnion : Symbol(ValueUnion, Decl(discriminatedUnionWithIndexSignature.ts, 6, 1))
>UnionAltA : Symbol(UnionAltA, Decl(discriminatedUnionWithIndexSignature.ts, 0, 0))
>UnionAltB : Symbol(UnionAltB, Decl(discriminatedUnionWithIndexSignature.ts, 2, 1))
export type MapOrSingleton =
>MapOrSingleton : Symbol(MapOrSingleton, Decl(discriminatedUnionWithIndexSignature.ts, 8, 47))
| {
[key: string]: ValueUnion;
>key : Symbol(key, Decl(discriminatedUnionWithIndexSignature.ts, 12, 9))
>ValueUnion : Symbol(ValueUnion, Decl(discriminatedUnionWithIndexSignature.ts, 6, 1))
}
| ValueUnion;
>ValueUnion : Symbol(ValueUnion, Decl(discriminatedUnionWithIndexSignature.ts, 6, 1))
const withoutAsConst: MapOrSingleton = {
>withoutAsConst : Symbol(withoutAsConst, Decl(discriminatedUnionWithIndexSignature.ts, 16, 5))
>MapOrSingleton : Symbol(MapOrSingleton, Decl(discriminatedUnionWithIndexSignature.ts, 8, 47))
1: {
>1 : Symbol(1, Decl(discriminatedUnionWithIndexSignature.ts, 16, 40))
type: 'text' /*as const*/,
>type : Symbol(type, Decl(discriminatedUnionWithIndexSignature.ts, 17, 8))
},
};
const withAsConst: MapOrSingleton = {
>withAsConst : Symbol(withAsConst, Decl(discriminatedUnionWithIndexSignature.ts, 22, 5))
>MapOrSingleton : Symbol(MapOrSingleton, Decl(discriminatedUnionWithIndexSignature.ts, 8, 47))
1: {
>1 : Symbol(1, Decl(discriminatedUnionWithIndexSignature.ts, 22, 37))
type: 'text' as const,
>type : Symbol(type, Decl(discriminatedUnionWithIndexSignature.ts, 23, 8))
>const : Symbol(const)
},
};
|