Skip to content

@graphty/graphty-element / catalog / optionsFromZod

Function: optionsFromZod() ​

optionsFromZod(schema, options?): readonly OptionDescriptor[]

Defined in: graphty-element/src/catalog/optionsFromZod.ts:106

Turn a Zod option schema into plain-JSON option descriptors.

Parameters ​

schema ​

OptionsSource

A Zod object schema, or the element's options schema of Zod schemas paired with UI metadata.

options? ​

OptionsFromZodOptions = {}

Metadata and per-option overrides the schema cannot express.

Returns ​

readonly OptionDescriptor[]

One descriptor per option, in the order the schema declares them.