@prismicio/types
Advanced tools
Comparing version 0.0.12 to 0.1.0
@@ -242,3 +242,3 @@ declare type EmptyObjectField = Record<string, never>; | ||
*/ | ||
declare type CustomType<TabName extends string = string> = Record<TabName, CustomTypeTab>; | ||
declare type CustomTypeModel<TabName extends string = string> = Record<TabName, CustomTypeModelTab>; | ||
/** | ||
@@ -249,15 +249,15 @@ * A Custom Type's tab. Each tab can contain any number of fields but is limited to one Slice Zone. | ||
*/ | ||
declare type CustomTypeTab<FieldName extends string = string> = Record<FieldName, CustomTypeField>; | ||
declare type CustomTypeModelTab<FieldName extends string = string> = Record<FieldName, CustomTypeModelField>; | ||
/** | ||
* A Custom Type field. | ||
*/ | ||
declare type CustomTypeField = CustomTypeUIDField | CustomTypeGroupField | CustomTypeSliceZoneField | CustomTypeFieldForGroup; | ||
declare type CustomTypeModelField = CustomTypeModelUIDField | CustomTypeModelGroupField | CustomTypeModelSliceZoneField | CustomTypeModelFieldForGroup; | ||
/** | ||
* Any Custom Type field that is valid for a Group field. | ||
*/ | ||
declare type CustomTypeFieldForGroup = CustomTypeBooleanField | CustomTypeColorField | CustomTypeDateField | CustomTypeEmbedField | CustomTypeGeoPointField | CustomTypeImageField | CustomTypeIntegrationField | CustomTypeContentRelationshipField | CustomTypeLinkField | CustomTypeLinkToMediaField | CustomTypeNumberField | CustomTypeSelectField | CustomTypeRichTextField | CustomTypeTitleField | CustomTypeKeyTextField | CustomTypeTimestampField; | ||
declare type CustomTypeModelFieldForGroup = CustomTypeModelBooleanField | CustomTypeModelColorField | CustomTypeModelDateField | CustomTypeModelEmbedField | CustomTypeModelGeoPointField | CustomTypeModelImageField | CustomTypeModelIntegrationField | CustomTypeModelContentRelationshipField | CustomTypeModelLinkField | CustomTypeModelLinkToMediaField | CustomTypeModelNumberField | CustomTypeModelSelectField | CustomTypeModelRichTextField | CustomTypeModelTitleField | CustomTypeModelKeyTextField | CustomTypeModelTimestampField; | ||
/** | ||
* Type identifier for a Custom Type field. | ||
*/ | ||
declare enum CustomTypeFieldType { | ||
declare enum CustomTypeModelFieldType { | ||
Boolean = "Boolean", | ||
@@ -285,4 +285,4 @@ Color = "Color", | ||
*/ | ||
interface CustomTypeBooleanField { | ||
type: CustomTypeFieldType.Boolean; | ||
interface CustomTypeModelBooleanField { | ||
type: CustomTypeModelFieldType.Boolean; | ||
config: { | ||
@@ -297,4 +297,4 @@ label: string; | ||
*/ | ||
interface CustomTypeColorField { | ||
type: CustomTypeFieldType.Color; | ||
interface CustomTypeModelColorField { | ||
type: CustomTypeModelFieldType.Color; | ||
config: { | ||
@@ -310,4 +310,4 @@ label: string; | ||
*/ | ||
interface CustomTypeDateField { | ||
type: CustomTypeFieldType.Date; | ||
interface CustomTypeModelDateField { | ||
type: CustomTypeModelFieldType.Date; | ||
config: { | ||
@@ -323,4 +323,4 @@ label: string; | ||
*/ | ||
interface CustomTypeEmbedField { | ||
type: CustomTypeFieldType.Embed; | ||
interface CustomTypeModelEmbedField { | ||
type: CustomTypeModelFieldType.Embed; | ||
config: { | ||
@@ -336,4 +336,4 @@ label: string; | ||
*/ | ||
interface CustomTypeGeoPointField { | ||
type: CustomTypeFieldType.GeoPoint; | ||
interface CustomTypeModelGeoPointField { | ||
type: CustomTypeModelFieldType.GeoPoint; | ||
config: { | ||
@@ -350,4 +350,4 @@ label: string; | ||
*/ | ||
interface CustomTypeGroupField<Fields extends Record<string, CustomTypeFieldForGroup> = Record<string, CustomTypeFieldForGroup>> { | ||
type: CustomTypeFieldType.Group; | ||
interface CustomTypeModelGroupField<Fields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>> { | ||
type: CustomTypeModelFieldType.Group; | ||
config: { | ||
@@ -363,8 +363,8 @@ label: string; | ||
*/ | ||
interface CustomTypeImageField { | ||
type: CustomTypeFieldType.Image; | ||
interface CustomTypeModelImageField { | ||
type: CustomTypeModelFieldType.Image; | ||
config: { | ||
label: string; | ||
constraint: CustomTypeImageConstraint | Record<string, never>; | ||
thumbnails: readonly CustomTypeImageThumbnail[]; | ||
constraint: CustomTypeModelImageConstraint | Record<string, never>; | ||
thumbnails: readonly CustomTypeModelImageThumbnail[]; | ||
}; | ||
@@ -377,3 +377,3 @@ } | ||
*/ | ||
interface CustomTypeImageConstraint { | ||
interface CustomTypeModelImageConstraint { | ||
width: number | null; | ||
@@ -387,3 +387,3 @@ height: number | null; | ||
*/ | ||
interface CustomTypeImageThumbnail extends CustomTypeImageConstraint { | ||
interface CustomTypeModelImageThumbnail extends CustomTypeModelImageConstraint { | ||
name: string; | ||
@@ -396,4 +396,4 @@ } | ||
*/ | ||
interface CustomTypeIntegrationField { | ||
type: CustomTypeFieldType.IntegrationFields; | ||
interface CustomTypeModelIntegrationField { | ||
type: CustomTypeModelFieldType.IntegrationFields; | ||
config: { | ||
@@ -409,3 +409,3 @@ label: string; | ||
*/ | ||
declare enum CustomTypeLinkSelectType { | ||
declare enum CustomTypeModelLinkSelectType { | ||
Document = "document", | ||
@@ -419,8 +419,8 @@ Media = "media" | ||
*/ | ||
interface CustomTypeContentRelationshipField { | ||
type: CustomTypeFieldType.Link; | ||
interface CustomTypeModelContentRelationshipField { | ||
type: CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
placeholder?: string; | ||
select: CustomTypeLinkSelectType.Document; | ||
select: CustomTypeModelLinkSelectType.Document; | ||
}; | ||
@@ -433,4 +433,4 @@ } | ||
*/ | ||
interface CustomTypeLinkField { | ||
type: CustomTypeFieldType.Link; | ||
interface CustomTypeModelLinkField { | ||
type: CustomTypeModelFieldType.Link; | ||
config: { | ||
@@ -448,8 +448,8 @@ label: string; | ||
*/ | ||
interface CustomTypeLinkToMediaField { | ||
type: CustomTypeFieldType.Link; | ||
interface CustomTypeModelLinkToMediaField { | ||
type: CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
placeholder?: string; | ||
select: CustomTypeLinkSelectType.Media; | ||
select: CustomTypeModelLinkSelectType.Media; | ||
}; | ||
@@ -462,4 +462,4 @@ } | ||
*/ | ||
interface CustomTypeNumberField { | ||
type: CustomTypeFieldType.Number; | ||
interface CustomTypeModelNumberField { | ||
type: CustomTypeModelFieldType.Number; | ||
config: { | ||
@@ -478,4 +478,4 @@ label: string; | ||
*/ | ||
interface CustomTypeSelectField<Options extends readonly string[] = readonly string[], DefaultValue extends IterableElement<Options> = IterableElement<Options>> { | ||
type: CustomTypeFieldType.Select; | ||
interface CustomTypeModelSelectField<Options extends readonly string[] = readonly string[], DefaultValue extends IterableElement<Options> = IterableElement<Options>> { | ||
type: CustomTypeModelFieldType.Select; | ||
config: { | ||
@@ -493,3 +493,3 @@ label: string; | ||
*/ | ||
declare type CustomTypeRichTextField = CustomTypeRichTextMultiField | CustomTypeRichTextSingleField; | ||
declare type CustomTypeModelRichTextField = CustomTypeModelRichTextMultiField | CustomTypeModelRichTextSingleField; | ||
/** | ||
@@ -500,4 +500,4 @@ * A Rich Text Custom Type field which supports multiple blocks of content. | ||
*/ | ||
interface CustomTypeRichTextMultiField { | ||
type: CustomTypeFieldType.StructuredText; | ||
interface CustomTypeModelRichTextMultiField { | ||
type: CustomTypeModelFieldType.StructuredText; | ||
config: { | ||
@@ -515,4 +515,4 @@ label: string; | ||
*/ | ||
interface CustomTypeRichTextSingleField { | ||
type: CustomTypeFieldType.StructuredText; | ||
interface CustomTypeModelRichTextSingleField { | ||
type: CustomTypeModelFieldType.StructuredText; | ||
config: { | ||
@@ -530,3 +530,3 @@ label: string; | ||
*/ | ||
declare type CustomTypeTitleField = CustomTypeRichTextSingleField; | ||
declare type CustomTypeModelTitleField = CustomTypeModelRichTextSingleField; | ||
/** | ||
@@ -537,4 +537,4 @@ * A Key Text Custom Type field. | ||
*/ | ||
interface CustomTypeKeyTextField { | ||
type: CustomTypeFieldType.Text; | ||
interface CustomTypeModelKeyTextField { | ||
type: CustomTypeModelFieldType.Text; | ||
config: { | ||
@@ -550,4 +550,4 @@ label: string; | ||
*/ | ||
interface CustomTypeTimestampField { | ||
type: CustomTypeFieldType.Timestamp; | ||
interface CustomTypeModelTimestampField { | ||
type: CustomTypeModelFieldType.Timestamp; | ||
config: { | ||
@@ -563,4 +563,4 @@ label: string; | ||
*/ | ||
interface CustomTypeUIDField { | ||
type: CustomTypeFieldType.UID; | ||
interface CustomTypeModelUIDField { | ||
type: CustomTypeModelFieldType.UID; | ||
config: { | ||
@@ -576,7 +576,7 @@ label: string; | ||
*/ | ||
interface CustomTypeSliceZoneField<Slices extends Record<string, CustomTypeSlice | CustomTypeSharedSlice> = Record<string, CustomTypeSlice | CustomTypeSharedSlice>> { | ||
type: CustomTypeFieldType.Slices; | ||
interface CustomTypeModelSliceZoneField<Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice> = Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice>> { | ||
type: CustomTypeModelFieldType.Slices; | ||
fieldset: "Slice zone"; | ||
config: { | ||
labels: Record<keyof Slices, readonly CustomTypeSliceLabel[]>; | ||
labels: Record<keyof Slices, readonly CustomTypeModelSliceLabel[]>; | ||
choices: Slices; | ||
@@ -590,3 +590,3 @@ }; | ||
*/ | ||
interface CustomTypeSliceLabel { | ||
interface CustomTypeModelSliceLabel { | ||
name: string; | ||
@@ -600,3 +600,3 @@ display: string; | ||
*/ | ||
declare enum CustomTypeSliceDisplay { | ||
declare enum CustomTypeModelSliceDisplay { | ||
List = "list", | ||
@@ -610,3 +610,3 @@ Grid = "grid" | ||
*/ | ||
declare enum CustomTypeSliceType { | ||
declare enum CustomTypeModelSliceType { | ||
Slice = "Slice", | ||
@@ -619,9 +619,12 @@ SharedSlice = "SharedSlice" | ||
* More details: {@link https://prismic.io/docs/core-concepts/slices} | ||
* | ||
* @typeParam NonRepeatFields A record of fields that cannnot be repeated. | ||
* @typeParam RepeatFields A record of fields that can be repeated. | ||
*/ | ||
interface CustomTypeSlice<NonRepeatFields extends Record<string, CustomTypeFieldForGroup> = Record<string, CustomTypeFieldForGroup>, RepeatFields extends Record<string, CustomTypeFieldForGroup> = Record<string, CustomTypeFieldForGroup>> { | ||
type: CustomTypeSliceType.Slice; | ||
interface CustomTypeModelSlice<NonRepeatFields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>, RepeatFields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>> { | ||
type: CustomTypeModelSliceType.Slice; | ||
fieldset: string; | ||
description: string; | ||
icon: string; | ||
display: CustomTypeSliceDisplay; | ||
display: CustomTypeModelSliceDisplay; | ||
"non-repeat": NonRepeatFields; | ||
@@ -637,6 +640,39 @@ repeat: RepeatFields; | ||
*/ | ||
interface CustomTypeSharedSlice { | ||
type: CustomTypeSliceType.SharedSlice; | ||
interface CustomTypeModelSharedSlice { | ||
type: CustomTypeModelSliceType.SharedSlice; | ||
} | ||
/** | ||
* A Prismic Shared Slice model. | ||
* | ||
* More details: | ||
* - {@link https://prismic.io/docs/core-concepts/slices} | ||
* - {@link https://prismic.io/docs/core-concepts/reusing-slices} | ||
*/ | ||
interface SharedSliceModel<Variations extends readonly SharedSliceModelVariation[] = readonly SharedSliceModelVariation[]> { | ||
type: CustomTypeModelSliceType.SharedSlice; | ||
id: string; | ||
name: string; | ||
description: string; | ||
variations: Variations; | ||
} | ||
/** | ||
* A Shared Slice variation. | ||
* | ||
* More details: | ||
* - {@link https://prismic.io/docs/core-concepts/slices} | ||
* - {@link https://prismic.io/docs/core-concepts/reusing-slices} | ||
* | ||
* @typeParam PrimaryFields A record of fields that cannnot be repeated. | ||
* @typeParam ItemFields A record of fields that can be repeated. | ||
*/ | ||
interface SharedSliceModelVariation<PrimaryFields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>, ItemFields extends Record<string, CustomTypeModelFieldForGroup> = Record<string, CustomTypeModelFieldForGroup>> { | ||
id: string; | ||
name: string; | ||
docURL: string; | ||
version: string; | ||
description: string; | ||
primary: PrimaryFields; | ||
items: ItemFields; | ||
} | ||
export { AnyRegularField, BooleanField, ColorField, CustomType, CustomTypeBooleanField, CustomTypeColorField, CustomTypeContentRelationshipField, CustomTypeDateField, CustomTypeEmbedField, CustomTypeField, CustomTypeFieldForGroup, CustomTypeFieldType, CustomTypeGeoPointField, CustomTypeGroupField, CustomTypeImageConstraint, CustomTypeImageField, CustomTypeImageThumbnail, CustomTypeIntegrationField, CustomTypeKeyTextField, CustomTypeLinkField, CustomTypeLinkSelectType, CustomTypeLinkToMediaField, CustomTypeNumberField, CustomTypeRichTextField, CustomTypeRichTextMultiField, CustomTypeRichTextSingleField, CustomTypeSelectField, CustomTypeSharedSlice, CustomTypeSlice, CustomTypeSliceDisplay, CustomTypeSliceLabel, CustomTypeSliceType, CustomTypeSliceZoneField, CustomTypeTab, CustomTypeTimestampField, CustomTypeTitleField, CustomTypeUIDField, DateField, EmbedField, EmbedType, EmptyLinkField, FilledLinkToDocumentField, FilledLinkToMediaField, FilledLinkToWebField, GeoPointField, GroupField, ImageField, KeyTextField, LinkField, LinkToMediaField, LinkType, NumberField, PrismicDocument, PrismicDocumentHeader, RTAnyNode, RTBlockNode, RTEmNode, RTEmbedNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTImageNode, RTInlineNode, RTLabelNode, RTLinkNode, RTListItemNode, RTListNode, RTNode, RTOListItemNode, RTOListNode, RTParagraphNode, RTPreformattedNode, RTSpanNode, RTSpanNodeBase, RTStrongNode, RTTextNode, RTTextNodeBase, RelationField, RichTextField, RichTextNodeType, SelectField, Slice, SliceZone, TimestampField, TitleField }; | ||
export { AnyRegularField, BooleanField, ColorField, CustomTypeModel, CustomTypeModelBooleanField, CustomTypeModelColorField, CustomTypeModelContentRelationshipField, CustomTypeModelDateField, CustomTypeModelEmbedField, CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldType, CustomTypeModelGeoPointField, CustomTypeModelGroupField, CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail, CustomTypeModelIntegrationField, CustomTypeModelKeyTextField, CustomTypeModelLinkField, CustomTypeModelLinkSelectType, CustomTypeModelLinkToMediaField, CustomTypeModelNumberField, CustomTypeModelRichTextField, CustomTypeModelRichTextMultiField, CustomTypeModelRichTextSingleField, CustomTypeModelSelectField, CustomTypeModelSharedSlice, CustomTypeModelSlice, CustomTypeModelSliceDisplay, CustomTypeModelSliceLabel, CustomTypeModelSliceType, CustomTypeModelSliceZoneField, CustomTypeModelTab, CustomTypeModelTimestampField, CustomTypeModelTitleField, CustomTypeModelUIDField, DateField, EmbedField, EmbedType, EmptyLinkField, FilledLinkToDocumentField, FilledLinkToMediaField, FilledLinkToWebField, GeoPointField, GroupField, ImageField, KeyTextField, LinkField, LinkToMediaField, LinkType, NumberField, PrismicDocument, PrismicDocumentHeader, RTAnyNode, RTBlockNode, RTEmNode, RTEmbedNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTImageNode, RTInlineNode, RTLabelNode, RTLinkNode, RTListItemNode, RTListNode, RTNode, RTOListItemNode, RTOListNode, RTParagraphNode, RTPreformattedNode, RTSpanNode, RTSpanNodeBase, RTStrongNode, RTTextNode, RTTextNodeBase, RelationField, RichTextField, RichTextNodeType, SelectField, SharedSliceModel, SharedSliceModelVariation, Slice, SliceZone, TimestampField, TitleField }; |
@@ -36,37 +36,37 @@ var RichTextNodeType; | ||
var CustomTypeFieldType; | ||
(function(CustomTypeFieldType2) { | ||
CustomTypeFieldType2["Boolean"] = "Boolean"; | ||
CustomTypeFieldType2["Color"] = "Color"; | ||
CustomTypeFieldType2["Date"] = "Date"; | ||
CustomTypeFieldType2["Embed"] = "Embed"; | ||
CustomTypeFieldType2["GeoPoint"] = "GeoPoint"; | ||
CustomTypeFieldType2["Group"] = "Group"; | ||
CustomTypeFieldType2["Image"] = "Image"; | ||
CustomTypeFieldType2["IntegrationFields"] = "IntegrationFields"; | ||
CustomTypeFieldType2["Link"] = "Link"; | ||
CustomTypeFieldType2["Number"] = "Number"; | ||
CustomTypeFieldType2["Select"] = "Select"; | ||
CustomTypeFieldType2["Slices"] = "Slices"; | ||
CustomTypeFieldType2["StructuredText"] = "StructuredText"; | ||
CustomTypeFieldType2["Text"] = "Text"; | ||
CustomTypeFieldType2["Timestamp"] = "Timestamp"; | ||
CustomTypeFieldType2["UID"] = "UID"; | ||
})(CustomTypeFieldType || (CustomTypeFieldType = {})); | ||
var CustomTypeLinkSelectType; | ||
(function(CustomTypeLinkSelectType2) { | ||
CustomTypeLinkSelectType2["Document"] = "document"; | ||
CustomTypeLinkSelectType2["Media"] = "media"; | ||
})(CustomTypeLinkSelectType || (CustomTypeLinkSelectType = {})); | ||
var CustomTypeSliceDisplay; | ||
(function(CustomTypeSliceDisplay2) { | ||
CustomTypeSliceDisplay2["List"] = "list"; | ||
CustomTypeSliceDisplay2["Grid"] = "grid"; | ||
})(CustomTypeSliceDisplay || (CustomTypeSliceDisplay = {})); | ||
var CustomTypeSliceType; | ||
(function(CustomTypeSliceType2) { | ||
CustomTypeSliceType2["Slice"] = "Slice"; | ||
CustomTypeSliceType2["SharedSlice"] = "SharedSlice"; | ||
})(CustomTypeSliceType || (CustomTypeSliceType = {})); | ||
var CustomTypeModelFieldType; | ||
(function(CustomTypeModelFieldType2) { | ||
CustomTypeModelFieldType2["Boolean"] = "Boolean"; | ||
CustomTypeModelFieldType2["Color"] = "Color"; | ||
CustomTypeModelFieldType2["Date"] = "Date"; | ||
CustomTypeModelFieldType2["Embed"] = "Embed"; | ||
CustomTypeModelFieldType2["GeoPoint"] = "GeoPoint"; | ||
CustomTypeModelFieldType2["Group"] = "Group"; | ||
CustomTypeModelFieldType2["Image"] = "Image"; | ||
CustomTypeModelFieldType2["IntegrationFields"] = "IntegrationFields"; | ||
CustomTypeModelFieldType2["Link"] = "Link"; | ||
CustomTypeModelFieldType2["Number"] = "Number"; | ||
CustomTypeModelFieldType2["Select"] = "Select"; | ||
CustomTypeModelFieldType2["Slices"] = "Slices"; | ||
CustomTypeModelFieldType2["StructuredText"] = "StructuredText"; | ||
CustomTypeModelFieldType2["Text"] = "Text"; | ||
CustomTypeModelFieldType2["Timestamp"] = "Timestamp"; | ||
CustomTypeModelFieldType2["UID"] = "UID"; | ||
})(CustomTypeModelFieldType || (CustomTypeModelFieldType = {})); | ||
var CustomTypeModelLinkSelectType; | ||
(function(CustomTypeModelLinkSelectType2) { | ||
CustomTypeModelLinkSelectType2["Document"] = "document"; | ||
CustomTypeModelLinkSelectType2["Media"] = "media"; | ||
})(CustomTypeModelLinkSelectType || (CustomTypeModelLinkSelectType = {})); | ||
var CustomTypeModelSliceDisplay; | ||
(function(CustomTypeModelSliceDisplay2) { | ||
CustomTypeModelSliceDisplay2["List"] = "list"; | ||
CustomTypeModelSliceDisplay2["Grid"] = "grid"; | ||
})(CustomTypeModelSliceDisplay || (CustomTypeModelSliceDisplay = {})); | ||
var CustomTypeModelSliceType; | ||
(function(CustomTypeModelSliceType2) { | ||
CustomTypeModelSliceType2["Slice"] = "Slice"; | ||
CustomTypeModelSliceType2["SharedSlice"] = "SharedSlice"; | ||
})(CustomTypeModelSliceType || (CustomTypeModelSliceType = {})); | ||
export { CustomTypeFieldType, CustomTypeLinkSelectType, CustomTypeSliceDisplay, CustomTypeSliceType, EmbedType, LinkType, RichTextNodeType }; | ||
export { CustomTypeModelFieldType, CustomTypeModelLinkSelectType, CustomTypeModelSliceDisplay, CustomTypeModelSliceType, EmbedType, LinkType, RichTextNodeType }; |
{ | ||
"name": "@prismicio/types", | ||
"version": "0.0.12", | ||
"version": "0.1.0", | ||
"description": "Type definitions for Prismic related structure", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47312
830