UNPKG

@prismicio/types-internal

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