# CustomIdShape

`type` in `custom-id` · v0.1.1

<https://docs.seedcord.org/packages/custom-id/0.1.1/types/custom-id-shape>

The set of fields a customId carries, keyed by name.

Write it as a constraint when a helper of your own takes a definition and its params together. [`AnyCustomId`](/packages/custom-id/0.1.1/types/any-custom-id) covers the looser case where the fields do not matter.

## Examples

```ts
function label<Shape extends CustomIdShape>(id: CustomId<string, Shape>, params: DecodedParams<Shape>): string {
    return `${id.prefix} ${JSON.stringify(params)}`;
}
```

## Declaration

```ts
type CustomIdShape = Record<
    string,
    CustomIdField<unknown>
>;
```
