API Reference / @evolu/common / Type / id
Function: id()
function id<Table>(table): IdType<Table>;
Defined in: packages/common/src/Type.ts:1350
Type Factory to create branded Id Type for a specific table.
Example
const TodoId = id("Todo");
// string & Brand<"Id"> & Brand<"Todo">
type TodoId = typeof TodoId.Type;
Type Parameters
Type Parameter |
---|
Table extends string |
Parameters
Parameter | Type |
---|---|
table | Table |
Returns
IdType
<Table
>