Skip to content

Feature request: add types for built-in schemas and envelopes  #1837

Closed
@am29d

Description

@am29d

Use case

When using zod schema we can extract type from the schema:

import { z } from 'zod';

const orderSchema = z.object({
  id: z.number().positive(),
  description: z.string(),
  items: z.array(orderItemSchema),
});

type Order = z.infer<typeof orderSchema>; 

We have created built-in schemas and envelopes but we did not extracted this types into dedicated package. If users want to use the types from the schema they need to write z.infer statement themselves. We can improve the experience by creating this types.

Solution/User Experience

Write a types file with alle the schema and envelopes types using z.infer

Alternative solutions

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityparserThis item relates to the Parser UtilitytestsPRs that add or change tests

Type

No type

Projects

Status

Shipped

Relationships

None yet

Development

No branches or pull requests

Issue actions