@prismicio/types-internal
Version:
Prismic types for Custom Types and Prismic Data
1,144 lines (1,143 loc) • 71.9 kB
TypeScript
import type { Variation } from "../widgets/slices";
import { type DiffChange } from "./Changes";
import type { NestableWidgetDiff, SlicePrimaryWidgetDiff } from "./Widgets";
export declare type VariationMetadata = Omit<Variation, "primary" | "items">;
export declare type VariationDiff = DiffChange<Variation, Partial<VariationMetadata> & {
primary?: Record<string, SlicePrimaryWidgetDiff>;
items?: Record<string, NestableWidgetDiff>;
}>;
export declare const VariationComparator: {
compare(variationA?: ({
id: string;
name: string;
description: string;
imageUrl: string;
docURL: string;
version: string;
} & {
display?: string;
primary?: {
[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: "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;
};
});
};
};
});
};
};
});
};
items?: {
[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;
};
});
};
}) | undefined, variationB?: ({
id: string;
name: string;
description: string;
imageUrl: string;
docURL: string;
version: string;
} & {
display?: string;
primary?: {
[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;