Skip to content

@graphty/graphty-element / config / InferOptions

Type Alias: InferOptions<S>

InferOptions<S> = { [K in keyof S]: z.infer<S[K]["schema"]> }

Defined in: src/config/OptionsSchema.ts:62

Infer TypeScript types from an OptionsSchema

Type Parameters

S

S extends OptionsSchema

Example

typescript
const myOptions = defineOptions({
    threshold: {
        schema: z.number().default(0.5),
        meta: { label: "Threshold", description: "..." }
    }
});
type MyOptions = InferOptions\<typeof myOptions\>;
// MyOptions = { threshold: number }