Type alias ObjectLayout<O>

ObjectLayout<O>: {
    [K in keyof O]?: Decoder<O[K]>
}

Mapped type that creates an object from the given type where every property is optional, but wraps the actual type in a Decoder. It's used by Decode.object and Decode.instance.

Type Parameters

  • O

    The type to generate the layout for

Example

If you had a User model like

class User {
id: number;
name: string;
children: User[];
}

the mapped layout would look like this:

type UserLayout = {
id?: Decoder<number>,
name?: Decoder<string>,
children?: Decoder<User[]>,
}

Generated using TypeDoc