Skip to content

Keyed beta ​

TypeAlias of @v12-engine/client

ts
export type Keyed<K extends string, V> = string extends K ? Record<string, V> : {
    [P in K]?: V;
};

Things by id. With the ids left as any text (the default), a plain record. With the ids named (GameView<TdUnit>), only those ids may be written, a slip in one does not compile, and not every id has to be there