UNPKG

@prismicio/types-internal

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