@prismicio/types-internal
Version:
Prismic types for Custom Types and Prismic Data
1,271 lines (1,270 loc) • 158 kB
TypeScript
import * as t from "io-ts";
import type { Fields } from "../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: "UID";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
useAsTitle?: boolean;
placeholder?: string;
};
}) | ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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: "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: "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: "Group";
} & {
fieldset?: string | null | undefined;
icon?: string;
description?: string;
config?: {
label?: string | null | undefined;
repeat?: boolean;
fields?: {
[x: string]: ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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: "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: "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: "Group";
} & {
fieldset?: string | null | undefined;
icon?: string;
description?: string;
config?: {
label?: string | null | undefined;
repeat?: boolean;
fields?: {
[x: string]: ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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: "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: "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: "Choice" | "Slices";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
labels?: {
[x: string]: readonly ({
name: string;
} & {
display?: string;
})[];
} | null;
choices?: {
[x: string]: ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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: "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: "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: "Group";
} & {
fieldset?: string | null | undefined;
icon?: string;
description?: string;
config?: {
label?: string | null | undefined;
repeat?: boolean;
fields?: {
[x: string]: ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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: "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: "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: "Slice";
} & {
fieldset?: string | null | undefined;
description?: string;
icon?: string;
display?: string;
"non-repeat"?: {
[x: string]: ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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: "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: "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;
};
});
};
repeat?: {
[x: string]: ({
type: "Color";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
};
}) | ({
type: "Boolean";
} & {
config?: {
label?: string | null | undefined;
default_value?: boolean;
placeholder_true?: string;
placeholder_false?: 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: "Date";
} & {
fieldset?: string | null | undefined;
config?: {
label?: string | null | undefined;
placeholder?: string;
default?: 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;