UNPKG

@prismicio/types-internal

Version:
28 lines (23 loc) 516 B
import * as t from "io-ts" import { StringOrNull } from "../../../validators" export const TextFieldType = "Text" export const TextConfig = t.exact( t.partial({ label: StringOrNull, useAsTitle: t.boolean, placeholder: t.string, }), ) export type TextConfig = t.TypeOf<typeof TextConfig> export const Text = t.exact( t.intersection([ t.type({ type: t.literal(TextFieldType), }), t.partial({ fieldset: StringOrNull, config: TextConfig, }), ]), ) export type Text = t.TypeOf<typeof Text>