Skip to content
Typecustom-idv0.3.2

DecodedParams

The values that a shape decodes to, keyed by field name.

type DecodedParams<Shape extends CustomIdShape> = Simplify<{
    [Name in keyof Shape]: Shape[Name] extends CustomIdField<infer Decoded>
        ? Decoded
        : never;
}>;
const Ticket = new CustomId('ticket').snowflake('ownerId').bool('urgent');

// { ownerId: string; urgent: boolean }
function open(params: DecodedParams<(typeof Ticket)['shape']>) {}