arktypea
arktype15mo ago
PIat

Conform to an existing type

Hello! Is there a way to force a def to conform to an existing typescript type?

export const chatDef = type({
    id: 'number',
    chatType: "private' | 'public'",
    title: 'string',
    username: 'string'
  // force this
}) satisfies Pick<Jsonify<Chat>, 'id' | 'chatType' | 'title' | 'username'>
Was this page helpful?