@prismicio/types
Advanced tools
Comparing version 0.1.29 to 0.2.0
@@ -0,0 +0,0 @@ declare const LinkType: { |
@@ -727,3 +727,3 @@ declare type EmptyObjectField = Record<string, never>; | ||
*/ | ||
label: string; | ||
label: string | null | undefined; | ||
/** | ||
@@ -762,3 +762,3 @@ * Determines if more than one document for the Custom Type can be created. | ||
*/ | ||
declare type CustomTypeModelFieldForGroup = CustomTypeModelBooleanField | CustomTypeModelColorField | CustomTypeModelDateField | CustomTypeModelEmbedField | CustomTypeModelGeoPointField | CustomTypeModelImageField | CustomTypeModelIntegrationFieldsField | CustomTypeModelContentRelationshipField | CustomTypeModelLinkField | CustomTypeModelLinkToMediaField | CustomTypeModelNumberField | CustomTypeModelSelectField | CustomTypeModelRichTextField | CustomTypeModelTitleField | CustomTypeModelKeyTextField | CustomTypeModelTimestampField; | ||
declare type CustomTypeModelFieldForGroup = CustomTypeModelBooleanField | CustomTypeModelColorField | CustomTypeModelDateField | CustomTypeModelEmbedField | CustomTypeModelGeoPointField | CustomTypeModelImageField | CustomTypeModelIntegrationFieldsField | CustomTypeModelContentRelationshipField | CustomTypeModelLinkField | CustomTypeModelLinkToMediaField | CustomTypeModelNumberField | CustomTypeModelRangeField | CustomTypeModelSelectField | CustomTypeModelRichTextField | CustomTypeModelTitleField | CustomTypeModelKeyTextField | CustomTypeModelTimestampField | CustomTypeModelSeparatorField; | ||
/** | ||
@@ -784,2 +784,14 @@ * Type identifier for a Custom Type field. | ||
readonly UID: "UID"; | ||
/** | ||
* @deprecated - Legacy field type. Use `Number` instead. | ||
*/ | ||
readonly Range: "Range"; | ||
/** | ||
* @deprecated - Legacy field type. Do not use. | ||
*/ | ||
readonly Separator: "Separator"; | ||
/** | ||
* @deprecated - Legacy field type. Use `Slices` instead. | ||
*/ | ||
readonly LegacySlices: "Choice"; | ||
}; | ||
@@ -793,4 +805,7 @@ /** | ||
type: typeof CustomTypeModelFieldType.Boolean; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
default_value?: boolean; | ||
placeholder_true?: string; | ||
placeholder_false?: string; | ||
}; | ||
@@ -805,4 +820,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Color; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -818,5 +833,6 @@ }; | ||
type: typeof CustomTypeModelFieldType.Date; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
default?: string; | ||
}; | ||
@@ -831,4 +847,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Embed; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -844,4 +860,4 @@ }; | ||
type: typeof CustomTypeModelFieldType.GeoPoint; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
}; | ||
@@ -858,5 +874,5 @@ } | ||
type: typeof CustomTypeModelFieldType.Group; | ||
config: { | ||
label: string; | ||
fields: Fields; | ||
config?: { | ||
label?: string | null; | ||
fields?: Fields; | ||
}; | ||
@@ -871,6 +887,6 @@ } | ||
type: typeof CustomTypeModelFieldType.Image; | ||
config: { | ||
label: string; | ||
constraint: CustomTypeModelImageConstraint | Record<string, never>; | ||
thumbnails: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[]; | ||
config?: { | ||
label?: string | null; | ||
constraint?: CustomTypeModelImageConstraint; | ||
thumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[]; | ||
}; | ||
@@ -884,4 +900,4 @@ } | ||
interface CustomTypeModelImageConstraint { | ||
width: number | null; | ||
height: number | null; | ||
width?: number | null; | ||
height?: number | null; | ||
} | ||
@@ -903,6 +919,6 @@ /** | ||
type: typeof CustomTypeModelFieldType.IntegrationFields; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
catalog: string; | ||
catalog?: string; | ||
}; | ||
@@ -918,2 +934,3 @@ } | ||
readonly Media: "media"; | ||
readonly Web: "web"; | ||
}; | ||
@@ -927,4 +944,4 @@ /** | ||
type: typeof CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -943,7 +960,7 @@ select: typeof CustomTypeModelLinkSelectType.Document; | ||
type: typeof CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
select?: null; | ||
allowTargetBlank?: true; | ||
select?: null | typeof CustomTypeModelLinkSelectType[keyof typeof CustomTypeModelLinkSelectType]; | ||
allowTargetBlank?: boolean; | ||
}; | ||
@@ -958,4 +975,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -972,8 +989,23 @@ select: typeof CustomTypeModelLinkSelectType.Media; | ||
type: typeof CustomTypeModelFieldType.Number; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
min?: number; | ||
max?: number; | ||
}; | ||
} | ||
/** | ||
* @deprecated - Legacy field. Use `CustomTypeModelNumberField` instead. | ||
*/ | ||
interface CustomTypeModelRangeField { | ||
type: typeof CustomTypeModelFieldType.Range; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
min?: number; | ||
max?: number; | ||
step?: number; | ||
}; | ||
} | ||
/** | ||
* A Select Custom Type field. | ||
@@ -988,6 +1020,6 @@ * | ||
type: typeof CustomTypeModelFieldType.Select; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
options: Option[]; | ||
options?: readonly Option[]; | ||
default_value?: DefaultValue; | ||
@@ -1009,7 +1041,7 @@ }; | ||
type: typeof CustomTypeModelFieldType.StructuredText; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
allowTargetBlank?: true; | ||
multi: string; | ||
allowTargetBlank?: boolean; | ||
multi?: string; | ||
}; | ||
@@ -1024,7 +1056,7 @@ } | ||
type: typeof CustomTypeModelFieldType.StructuredText; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
allowTargetBlank?: true; | ||
single: string; | ||
allowTargetBlank?: boolean; | ||
single?: string; | ||
}; | ||
@@ -1045,4 +1077,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Text; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -1058,5 +1090,6 @@ }; | ||
type: typeof CustomTypeModelFieldType.Timestamp; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
default?: string; | ||
}; | ||
@@ -1071,4 +1104,4 @@ } | ||
type: typeof CustomTypeModelFieldType.UID; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -1078,2 +1111,11 @@ }; | ||
/** | ||
* @deprecated - Legacy field. Do not use. | ||
*/ | ||
interface CustomTypeModelSeparatorField { | ||
type: typeof CustomTypeModelFieldType.Separator; | ||
config?: { | ||
label?: string | null; | ||
}; | ||
} | ||
/** | ||
* A Slice Zone Custom Type field. | ||
@@ -1083,8 +1125,8 @@ * | ||
*/ | ||
interface CustomTypeModelSliceZoneField<Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice> = Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice>> { | ||
type: typeof CustomTypeModelFieldType.Slices; | ||
fieldset: "Slice zone"; | ||
config: { | ||
labels: Record<string, readonly CustomTypeModelSliceLabel[]>; | ||
choices: Slices; | ||
interface CustomTypeModelSliceZoneField<Slices extends Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice> = Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice | CustomTypeModelLegacySlice>> { | ||
type: typeof CustomTypeModelFieldType.Slices | typeof CustomTypeModelFieldType.LegacySlices; | ||
fieldset?: string | null; | ||
config?: { | ||
labels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null; | ||
choices?: Slices; | ||
}; | ||
@@ -1099,3 +1141,3 @@ } | ||
name: string; | ||
display: string; | ||
display?: string; | ||
} | ||
@@ -1130,8 +1172,8 @@ /** | ||
type: typeof CustomTypeModelSliceType.Slice; | ||
fieldset: string; | ||
description: string; | ||
icon: string; | ||
display: typeof CustomTypeModelSliceDisplay[keyof typeof CustomTypeModelSliceDisplay]; | ||
"non-repeat": NonRepeatFields; | ||
repeat: RepeatFields; | ||
fieldset?: string | null; | ||
description?: string; | ||
icon?: string; | ||
display?: typeof CustomTypeModelSliceDisplay[keyof typeof CustomTypeModelSliceDisplay] | string; | ||
"non-repeat"?: NonRepeatFields; | ||
repeat?: RepeatFields; | ||
} | ||
@@ -1163,3 +1205,3 @@ /** | ||
name: string; | ||
description: string; | ||
description?: string; | ||
variations: readonly Variation[]; | ||
@@ -1184,5 +1226,10 @@ } | ||
description: string; | ||
primary: PrimaryFields; | ||
items: ItemFields; | ||
primary?: PrimaryFields; | ||
items?: ItemFields; | ||
imageUrl: string; | ||
} | ||
/** | ||
* @deprecated - Legacy slice type. Do not use. | ||
*/ | ||
declare type CustomTypeModelLegacySlice = CustomTypeModelGroupField | CustomTypeModelFieldForGroup; | ||
@@ -1467,2 +1514,2 @@ /** | ||
export { AlternateLanguage, AnyOEmbed, AnyRegularField, BooleanField, ColorField, CommonEmbedData, CustomTypeModel, CustomTypeModelBooleanField, CustomTypeModelColorField, CustomTypeModelContentRelationshipField, CustomTypeModelDateField, CustomTypeModelDefinition, CustomTypeModelEmbedField, CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldType, CustomTypeModelGeoPointField, CustomTypeModelGroupField, CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail, CustomTypeModelIntegrationFieldsField, CustomTypeModelKeyTextField, CustomTypeModelLinkField, CustomTypeModelLinkSelectType, CustomTypeModelLinkToMediaField, CustomTypeModelNumberField, CustomTypeModelRichTextField, CustomTypeModelRichTextMultiField, CustomTypeModelRichTextSingleField, CustomTypeModelSelectField, CustomTypeModelSharedSlice, CustomTypeModelSlice, CustomTypeModelSliceDisplay, CustomTypeModelSliceLabel, CustomTypeModelSliceType, CustomTypeModelSliceZoneField, CustomTypeModelTab, CustomTypeModelTimestampField, CustomTypeModelTitleField, CustomTypeModelUIDField, DateField, EmbedField, EmbedType, EmptyImageFieldImage, EmptyLinkField, FieldState, FilledImageFieldImage, FilledLinkToDocumentField, FilledLinkToMediaField, FilledLinkToWebField, Form, FormField, GeoPointField, GroupField, ImageField, ImageFieldImage, IntegrationFields, KeyTextField, Language, LinkField, LinkOEmbed, LinkToMediaField, LinkType, NumberField, OEmbedExtra, OEmbedType, PhotoOEmbed, PrismicDocument, PrismicDocumentHeader, PrismicDocumentWithUID, PrismicDocumentWithoutUID, Query, 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, Ref, RelationField, Release, Repository, RichOEmbed, RichTextField, RichTextNodeType, SelectField, SharedSlice, SharedSliceModel, SharedSliceModelVariation, SharedSliceVariation, Slice, SliceZone, Tags, TimestampField, TitleField, VideoOEmbed, WebhookBody, WebhookBodyAPIUpdate, WebhookBodyTestTrigger, WebhookType }; | ||
export { AlternateLanguage, AnyOEmbed, AnyRegularField, BooleanField, ColorField, CommonEmbedData, CustomTypeModel, CustomTypeModelBooleanField, CustomTypeModelColorField, CustomTypeModelContentRelationshipField, CustomTypeModelDateField, CustomTypeModelDefinition, CustomTypeModelEmbedField, CustomTypeModelField, CustomTypeModelFieldForGroup, CustomTypeModelFieldType, CustomTypeModelGeoPointField, CustomTypeModelGroupField, CustomTypeModelImageConstraint, CustomTypeModelImageField, CustomTypeModelImageThumbnail, CustomTypeModelIntegrationFieldsField, CustomTypeModelKeyTextField, CustomTypeModelLegacySlice, CustomTypeModelLinkField, CustomTypeModelLinkSelectType, CustomTypeModelLinkToMediaField, CustomTypeModelNumberField, CustomTypeModelRangeField, CustomTypeModelRichTextField, CustomTypeModelRichTextMultiField, CustomTypeModelRichTextSingleField, CustomTypeModelSelectField, CustomTypeModelSeparatorField, CustomTypeModelSharedSlice, CustomTypeModelSlice, CustomTypeModelSliceDisplay, CustomTypeModelSliceLabel, CustomTypeModelSliceType, CustomTypeModelSliceZoneField, CustomTypeModelTab, CustomTypeModelTimestampField, CustomTypeModelTitleField, CustomTypeModelUIDField, DateField, EmbedField, EmbedType, EmptyImageFieldImage, EmptyLinkField, FieldState, FilledImageFieldImage, FilledLinkToDocumentField, FilledLinkToMediaField, FilledLinkToWebField, Form, FormField, GeoPointField, GroupField, ImageField, ImageFieldImage, IntegrationFields, KeyTextField, Language, LinkField, LinkOEmbed, LinkToMediaField, LinkType, NumberField, OEmbedExtra, OEmbedType, PhotoOEmbed, PrismicDocument, PrismicDocumentHeader, PrismicDocumentWithUID, PrismicDocumentWithoutUID, Query, 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, Ref, RelationField, Release, Repository, RichOEmbed, RichTextField, RichTextNodeType, SelectField, SharedSlice, SharedSliceModel, SharedSliceModelVariation, SharedSliceVariation, Slice, SliceZone, Tags, TimestampField, TitleField, VideoOEmbed, WebhookBody, WebhookBodyAPIUpdate, WebhookBodyTestTrigger, WebhookType }; |
@@ -51,7 +51,11 @@ const RichTextNodeType = { | ||
Timestamp: "Timestamp", | ||
UID: "UID" | ||
UID: "UID", | ||
Range: "Range", | ||
Separator: "Separator", | ||
LegacySlices: "Choice" | ||
}; | ||
const CustomTypeModelLinkSelectType = { | ||
Document: "document", | ||
Media: "media" | ||
Media: "media", | ||
Web: "web" | ||
}; | ||
@@ -58,0 +62,0 @@ const CustomTypeModelSliceDisplay = { |
{ | ||
"name": "@prismicio/types", | ||
"version": "0.1.29", | ||
"version": "0.2.0", | ||
"description": "Type definitions for Prismic related structure", | ||
@@ -60,11 +60,12 @@ "keywords": [ | ||
"devDependencies": { | ||
"@prismicio/types-internal": "^1.0.0-alpha.0", | ||
"@size-limit/preset-small-lib": "^7.0.8", | ||
"@typescript-eslint/eslint-plugin": "^5.27.1", | ||
"@typescript-eslint/parser": "^5.27.1", | ||
"@typescript-eslint/eslint-plugin": "^5.30.0", | ||
"@typescript-eslint/parser": "^5.30.0", | ||
"c8": "^7.11.3", | ||
"eslint": "^8.17.0", | ||
"eslint": "^8.18.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-prettier": "^4.1.0", | ||
"eslint-plugin-tsdoc": "^0.2.16", | ||
"prettier": "^2.6.2", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-jsdoc": "^0.3.38", | ||
@@ -75,4 +76,4 @@ "siroc": "^0.16.0", | ||
"ts-expect": "^1.3.0", | ||
"typescript": "^4.7.3", | ||
"vitest": "^0.14.1" | ||
"typescript": "^4.7.4", | ||
"vitest": "^0.16.0" | ||
}, | ||
@@ -79,0 +80,0 @@ "engines": { |
@@ -19,3 +19,4 @@ /** | ||
*/ | ||
label: string; | ||
// TODO: Revert to `label?: string | null` if `label` can be partial in: https://github.com/prismicio/prismic-types-internal/blob/HEAD/src/customtypes/CustomType.ts#L39 | ||
label: string | null | undefined; | ||
@@ -85,2 +86,3 @@ /** | ||
| CustomTypeModelNumberField | ||
| CustomTypeModelRangeField | ||
| CustomTypeModelSelectField | ||
@@ -90,3 +92,4 @@ | CustomTypeModelRichTextField | ||
| CustomTypeModelKeyTextField | ||
| CustomTypeModelTimestampField; | ||
| CustomTypeModelTimestampField | ||
| CustomTypeModelSeparatorField; | ||
@@ -113,2 +116,14 @@ /** | ||
UID: "UID", | ||
/** | ||
* @deprecated - Legacy field type. Use `Number` instead. | ||
*/ | ||
Range: "Range", | ||
/** | ||
* @deprecated - Legacy field type. Do not use. | ||
*/ | ||
Separator: "Separator", | ||
/** | ||
* @deprecated - Legacy field type. Use `Slices` instead. | ||
*/ | ||
LegacySlices: "Choice", | ||
} as const; | ||
@@ -123,4 +138,7 @@ | ||
type: typeof CustomTypeModelFieldType.Boolean; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
default_value?: boolean; | ||
placeholder_true?: string; | ||
placeholder_false?: string; | ||
}; | ||
@@ -136,4 +154,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Color; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -150,5 +168,6 @@ }; | ||
type: typeof CustomTypeModelFieldType.Date; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
default?: string; | ||
}; | ||
@@ -164,4 +183,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Embed; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -178,4 +197,4 @@ }; | ||
type: typeof CustomTypeModelFieldType.GeoPoint; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
}; | ||
@@ -198,5 +217,5 @@ } | ||
type: typeof CustomTypeModelFieldType.Group; | ||
config: { | ||
label: string; | ||
fields: Fields; | ||
config?: { | ||
label?: string | null; | ||
fields?: Fields; | ||
}; | ||
@@ -214,6 +233,6 @@ } | ||
type: typeof CustomTypeModelFieldType.Image; | ||
config: { | ||
label: string; | ||
constraint: CustomTypeModelImageConstraint | Record<string, never>; | ||
thumbnails: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[]; | ||
config?: { | ||
label?: string | null; | ||
constraint?: CustomTypeModelImageConstraint; | ||
thumbnails?: readonly CustomTypeModelImageThumbnail<ThumbnailNames>[]; | ||
}; | ||
@@ -228,4 +247,4 @@ } | ||
export interface CustomTypeModelImageConstraint { | ||
width: number | null; | ||
height: number | null; | ||
width?: number | null; | ||
height?: number | null; | ||
} | ||
@@ -250,6 +269,6 @@ | ||
type: typeof CustomTypeModelFieldType.IntegrationFields; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
catalog: string; | ||
catalog?: string; | ||
}; | ||
@@ -266,2 +285,3 @@ } | ||
Media: "media", | ||
Web: "web", | ||
} as const; | ||
@@ -279,4 +299,4 @@ | ||
type: typeof CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -296,7 +316,9 @@ select: typeof CustomTypeModelLinkSelectType.Document; | ||
type: typeof CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
select?: null; | ||
allowTargetBlank?: true; | ||
select?: | ||
| null | ||
| typeof CustomTypeModelLinkSelectType[keyof typeof CustomTypeModelLinkSelectType]; | ||
allowTargetBlank?: boolean; | ||
}; | ||
@@ -312,4 +334,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Link; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -327,5 +349,7 @@ select: typeof CustomTypeModelLinkSelectType.Media; | ||
type: typeof CustomTypeModelFieldType.Number; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
min?: number; | ||
max?: number; | ||
}; | ||
@@ -335,2 +359,16 @@ } | ||
/** | ||
* @deprecated - Legacy field. Use `CustomTypeModelNumberField` instead. | ||
*/ | ||
export interface CustomTypeModelRangeField { | ||
type: typeof CustomTypeModelFieldType.Range; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
min?: number; | ||
max?: number; | ||
step?: number; | ||
}; | ||
} | ||
/** | ||
* A Select Custom Type field. | ||
@@ -348,6 +386,6 @@ * | ||
type: typeof CustomTypeModelFieldType.Select; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
options: Option[]; | ||
options?: readonly Option[]; | ||
default_value?: DefaultValue; | ||
@@ -373,7 +411,7 @@ }; | ||
type: typeof CustomTypeModelFieldType.StructuredText; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
allowTargetBlank?: true; | ||
multi: string; | ||
allowTargetBlank?: boolean; | ||
multi?: string; | ||
}; | ||
@@ -389,7 +427,7 @@ } | ||
type: typeof CustomTypeModelFieldType.StructuredText; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
allowTargetBlank?: true; | ||
single: string; | ||
allowTargetBlank?: boolean; | ||
single?: string; | ||
}; | ||
@@ -412,4 +450,4 @@ } | ||
type: typeof CustomTypeModelFieldType.Text; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -426,5 +464,6 @@ }; | ||
type: typeof CustomTypeModelFieldType.Timestamp; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
default?: string; | ||
}; | ||
@@ -440,4 +479,4 @@ } | ||
type: typeof CustomTypeModelFieldType.UID; | ||
config: { | ||
label: string; | ||
config?: { | ||
label?: string | null; | ||
placeholder?: string; | ||
@@ -448,2 +487,12 @@ }; | ||
/** | ||
* @deprecated - Legacy field. Do not use. | ||
*/ | ||
export interface CustomTypeModelSeparatorField { | ||
type: typeof CustomTypeModelFieldType.Separator; | ||
config?: { | ||
label?: string | null; | ||
}; | ||
} | ||
/** | ||
* A Slice Zone Custom Type field. | ||
@@ -456,10 +505,19 @@ * | ||
string, | ||
CustomTypeModelSlice | CustomTypeModelSharedSlice | ||
> = Record<string, CustomTypeModelSlice | CustomTypeModelSharedSlice>, | ||
| CustomTypeModelSlice | ||
| CustomTypeModelSharedSlice | ||
| CustomTypeModelLegacySlice | ||
> = Record< | ||
string, | ||
| CustomTypeModelSlice | ||
| CustomTypeModelSharedSlice | ||
| CustomTypeModelLegacySlice | ||
>, | ||
> { | ||
type: typeof CustomTypeModelFieldType.Slices; | ||
fieldset: "Slice zone"; | ||
config: { | ||
labels: Record<string, readonly CustomTypeModelSliceLabel[]>; | ||
choices: Slices; | ||
type: | ||
| typeof CustomTypeModelFieldType.Slices | ||
| typeof CustomTypeModelFieldType.LegacySlices; | ||
fieldset?: string | null; | ||
config?: { | ||
labels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null; | ||
choices?: Slices; | ||
}; | ||
@@ -475,3 +533,3 @@ } | ||
name: string; | ||
display: string; | ||
display?: string; | ||
} | ||
@@ -518,8 +576,10 @@ | ||
type: typeof CustomTypeModelSliceType.Slice; | ||
fieldset: string; | ||
description: string; | ||
icon: string; | ||
display: typeof CustomTypeModelSliceDisplay[keyof typeof CustomTypeModelSliceDisplay]; | ||
"non-repeat": NonRepeatFields; | ||
repeat: RepeatFields; | ||
fieldset?: string | null; | ||
description?: string; | ||
icon?: string; | ||
display?: | ||
| typeof CustomTypeModelSliceDisplay[keyof typeof CustomTypeModelSliceDisplay] | ||
| string; | ||
"non-repeat"?: NonRepeatFields; | ||
repeat?: RepeatFields; | ||
} | ||
@@ -556,3 +616,3 @@ | ||
name: string; | ||
description: string; | ||
description?: string; | ||
variations: readonly Variation[]; | ||
@@ -588,4 +648,12 @@ } | ||
description: string; | ||
primary: PrimaryFields; | ||
items: ItemFields; | ||
primary?: PrimaryFields; | ||
items?: ItemFields; | ||
imageUrl: string; | ||
} | ||
/** | ||
* @deprecated - Legacy slice type. Do not use. | ||
*/ | ||
export type CustomTypeModelLegacySlice = | ||
| CustomTypeModelGroupField | ||
| CustomTypeModelFieldForGroup; |
@@ -146,2 +146,3 @@ export type { | ||
CustomTypeModelNumberField, | ||
CustomTypeModelRangeField, | ||
CustomTypeModelRichTextField, | ||
@@ -154,2 +155,3 @@ CustomTypeModelRichTextMultiField, | ||
CustomTypeModelUIDField, | ||
CustomTypeModelSeparatorField, | ||
// Slices | ||
@@ -160,2 +162,3 @@ CustomTypeModelSliceZoneField, | ||
CustomTypeModelSharedSlice, | ||
CustomTypeModelLegacySlice, | ||
// SharedSlices | ||
@@ -162,0 +165,0 @@ SharedSliceModel, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
219702
3718
17