Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/core / / ZodLikeSchema
Interface: ZodLikeSchema<TOutput, TInput>
Defined in: packages/core/src/utils/validation.ts:10
Type-only Zod compatibility shim. We declare a structural type for the subset of zod we depend on so that @graphorin/core can be type- checked without importing zod directly. Consumers that do import { z } from 'zod' get the real types via the user's zod install (the peer dependency).
Stable
Type Parameters
| Type Parameter | Default type |
|---|---|
TOutput | unknown |
TInput | unknown |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
_input? | readonly | TInput | - | packages/core/src/utils/validation.ts:15 |
_output? | readonly | TOutput | Internal phantom used by Zod for inference. We don't dereference it. | packages/core/src/utils/validation.ts:14 |
Methods
parse()
ts
parse(data): TOutput;Defined in: packages/core/src/utils/validation.ts:11
Parameters
| Parameter | Type |
|---|---|
data | unknown |
Returns
TOutput
safeParse()
ts
safeParse(data): ZodLikeSafeParseResult<TOutput, TInput>;Defined in: packages/core/src/utils/validation.ts:12
Parameters
| Parameter | Type |
|---|---|
data | unknown |
Returns
ZodLikeSafeParseResult<TOutput, TInput>