1 | import { ClassConstructor } from '..';
|
2 | /**
|
3 | * Discriminator object containing the type information to select a proper type
|
4 | * during transformation when a discriminator property is provided.
|
5 | */
|
6 | export interface DiscriminatorDescriptor {
|
7 | /**
|
8 | * The name of the property which holds the type information in the received object.
|
9 | */
|
10 | property: string;
|
11 | /**
|
12 | * List of the available types. The transformer will try to lookup the object
|
13 | * with the same key as the value received in the defined discriminator property
|
14 | * and create an instance of the defined class.
|
15 | */
|
16 | subTypes: {
|
17 | /**
|
18 | * Name of the type.
|
19 | */
|
20 | name: string;
|
21 | /**
|
22 | * A class constructor which can be used to create the object.
|
23 | */
|
24 | value: ClassConstructor<any>;
|
25 | }[];
|
26 | }
|