Skip to content

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 ParameterDefault type
TOutputunknown
TInputunknown

Properties

PropertyModifierTypeDescriptionDefined in
_input?readonlyTInput-packages/core/src/utils/validation.ts:15
_output?readonlyTOutputInternal 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

ParameterType
dataunknown

Returns

TOutput


safeParse()

ts
safeParse(data): ZodLikeSafeParseResult<TOutput, TInput>;

Defined in: packages/core/src/utils/validation.ts:12

Parameters

ParameterType
dataunknown

Returns

ZodLikeSafeParseResult&lt;TOutput, TInput&gt;