UNPKG

@prismicio/types-internal

Version:
1,269 lines (1,268 loc) 158 kB
import * as t from "io-ts"; import type { OnFieldFn } from "../_internal/utils"; import { Group, NestableWidget, NestedGroup, UID } from "./widgets"; import type { SharedSlice } from "./widgets/slices"; import { DynamicWidget, StaticWidget } from "./widgets/Widget"; export declare function sectionReader<T extends StaticWidget | DynamicWidget>(codec: t.Type<T, unknown>): t.RecordC<t.Type<string, string, unknown>, t.Type<T, unknown, unknown>>; export declare const StaticSection: t.RecordC<t.Type<string, string, unknown>, t.Type<({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string; } & { width?: number | null; height?: number | null; })[]; }; }) | ({ type: "IntegrationFields"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; catalog?: string; }; }) | ({ type: "Link"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; select?: "media" | "document" | "web" | null; customtypes?: readonly (string | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; } | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; })[]; })[]; })[]; masks?: readonly string[]; tags?: readonly string[]; allowTargetBlank?: boolean; allowText?: boolean; repeat?: boolean; variants?: string[]; }; }) | ({ type: "Number"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "Range"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "StructuredText"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; single?: string; multi?: string; imageConstraint?: { width?: number | null; height?: number | null; }; labels?: readonly string[]; allowTargetBlank?: boolean; }; }) | ({ type: "Select"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default_value?: string; options?: readonly string[]; }; }) | ({ type: "Separator"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Table"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Text"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Timestamp"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Group"; } & { fieldset?: string | null | undefined; icon?: string; description?: string; config?: { label?: string | null | undefined; repeat?: boolean; fields?: { [x: string]: ({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string; } & { width?: number | null; height?: number | null; })[]; }; }) | ({ type: "IntegrationFields"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; catalog?: string; }; }) | ({ type: "Link"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; select?: "media" | "document" | "web" | null; customtypes?: readonly (string | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; } | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; })[]; })[]; })[]; masks?: readonly string[]; tags?: readonly string[]; allowTargetBlank?: boolean; allowText?: boolean; repeat?: boolean; variants?: string[]; }; }) | ({ type: "Number"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "Range"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "StructuredText"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; single?: string; multi?: string; imageConstraint?: { width?: number | null; height?: number | null; }; labels?: readonly string[]; allowTargetBlank?: boolean; }; }) | ({ type: "Select"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default_value?: string; options?: readonly string[]; }; }) | ({ type: "Separator"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Table"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Text"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Timestamp"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Group"; } & { fieldset?: string | null | undefined; icon?: string; description?: string; config?: { label?: string | null | undefined; repeat?: boolean; fields?: { [x: string]: ({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string; } & { width?: number | null; height?: number | null; })[]; }; }) | ({ type: "IntegrationFields"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; catalog?: string; }; }) | ({ type: "Link"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; select?: "media" | "document" | "web" | null; customtypes?: readonly (string | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; } | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; })[]; })[]; })[]; masks?: readonly string[]; tags?: readonly string[]; allowTargetBlank?: boolean; allowText?: boolean; repeat?: boolean; variants?: string[]; }; }) | ({ type: "Number"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "Range"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "StructuredText"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; single?: string; multi?: string; imageConstraint?: { width?: number | null; height?: number | null; }; labels?: readonly string[]; allowTargetBlank?: boolean; }; }) | ({ type: "Select"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default_value?: string; options?: readonly string[]; }; }) | ({ type: "Separator"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Table"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Text"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Timestamp"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }); }; }; }); }; }; }) | ({ type: "UID"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Choice" | "Slices"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; labels?: { [x: string]: readonly ({ name: string; } & { display?: string; })[]; } | null; choices?: { [x: string]: ({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string; } & { width?: number | null; height?: number | null; })[]; }; }) | ({ type: "IntegrationFields"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; catalog?: string; }; }) | ({ type: "Link"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; select?: "media" | "document" | "web" | null; customtypes?: readonly (string | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; } | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; })[]; })[]; })[]; masks?: readonly string[]; tags?: readonly string[]; allowTargetBlank?: boolean; allowText?: boolean; repeat?: boolean; variants?: string[]; }; }) | ({ type: "Number"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "Range"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "StructuredText"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; single?: string; multi?: string; imageConstraint?: { width?: number | null; height?: number | null; }; labels?: readonly string[]; allowTargetBlank?: boolean; }; }) | ({ type: "Select"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default_value?: string; options?: readonly string[]; }; }) | ({ type: "Separator"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Table"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Text"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Timestamp"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Group"; } & { fieldset?: string | null | undefined; icon?: string; description?: string; config?: { label?: string | null | undefined; repeat?: boolean; fields?: { [x: string]: ({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string; } & { width?: number | null; height?: number | null; })[]; }; }) | ({ type: "IntegrationFields"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; catalog?: string; }; }) | ({ type: "Link"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; select?: "media" | "document" | "web" | null; customtypes?: readonly (string | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; } | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; })[]; })[]; })[]; masks?: readonly string[]; tags?: readonly string[]; allowTargetBlank?: boolean; allowText?: boolean; repeat?: boolean; variants?: string[]; }; }) | ({ type: "Number"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "Range"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "StructuredText"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; single?: string; multi?: string; imageConstraint?: { width?: number | null; height?: number | null; }; labels?: readonly string[]; allowTargetBlank?: boolean; }; }) | ({ type: "Select"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default_value?: string; options?: readonly string[]; }; }) | ({ type: "Separator"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Table"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Text"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Timestamp"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }); }; }; }) | ({ type: "Slice"; } & { fieldset?: string | null | undefined; description?: string; icon?: string; display?: string; "non-repeat"?: { [x: string]: ({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string; } & { width?: number | null; height?: number | null; })[]; }; }) | ({ type: "IntegrationFields"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; catalog?: string; }; }) | ({ type: "Link"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; select?: "media" | "document" | "web" | null; customtypes?: readonly (string | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; } | { id: string; fields: readonly (string | { id: string; customtypes: readonly (string | { id: string; fields: readonly (string | { id: string; fields: readonly string[]; })[]; })[]; })[]; })[]; })[]; masks?: readonly string[]; tags?: readonly string[]; allowTargetBlank?: boolean; allowText?: boolean; repeat?: boolean; variants?: string[]; }; }) | ({ type: "Number"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "Range"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; min?: number; max?: number; step?: number; }; }) | ({ type: "StructuredText"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; single?: string; multi?: string; imageConstraint?: { width?: number | null; height?: number | null; }; labels?: readonly string[]; allowTargetBlank?: boolean; }; }) | ({ type: "Select"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default_value?: string; options?: readonly string[]; }; }) | ({ type: "Separator"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Table"; } & { config?: { label?: string | null | undefined; }; }) | ({ type: "Text"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; useAsTitle?: boolean; placeholder?: string; }; }) | ({ type: "Timestamp"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }); }; repeat?: { [x: string]: ({ type: "Boolean"; } & { config?: { label?: string | null | undefined; default_value?: boolean; placeholder_true?: string; placeholder_false?: string; }; }) | ({ type: "Color"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; }; }) | ({ type: "Date"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; default?: string; }; }) | ({ type: "Embed"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; useAsTitle?: boolean; }; }) | ({ type: "GeoPoint"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; }; }) | ({ type: "Image"; } & { fieldset?: string | null | undefined; config?: { label?: string | null | undefined; placeholder?: string; constraint?: { width?: number | null; height?: number | null; }; thumbnails?: readonly ({ name: string;