@prismicio/client 7.0.0-alpha.4 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.ts +4 -4
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/createClient.cjs +24 -24
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.d.ts +28 -28
- package/dist/createClient.js +24 -24
- package/dist/createClient.js.map +1 -1
- package/dist/filter.cjs +1 -1
- package/dist/filter.cjs.map +1 -1
- package/dist/filter.d.ts +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.js.map +1 -1
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.d.ts +2 -2
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs +5 -5
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.ts +21 -21
- package/dist/helpers/asHTML.js +5 -5
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +5 -5
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +3 -3
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +6 -6
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.ts +14 -14
- package/dist/helpers/asLink.js.map +1 -1
- package/dist/helpers/asLinkAttrs.cjs.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +5 -5
- package/dist/helpers/asLinkAttrs.js.map +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.ts +8 -8
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/documentToLinkField.cjs.map +1 -1
- package/dist/helpers/documentToLinkField.js.map +1 -1
- package/dist/helpers/isFilled.cjs +3 -1
- package/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/helpers/isFilled.d.ts +24 -20
- package/dist/helpers/isFilled.js +3 -1
- package/dist/helpers/isFilled.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/types/api/repository.d.ts +2 -2
- package/dist/types/model/boolean.d.ts +1 -1
- package/dist/types/model/color.d.ts +1 -1
- package/dist/types/model/contentRelationship.d.ts +1 -1
- package/dist/types/model/customType.d.ts +11 -11
- package/dist/types/model/date.d.ts +1 -1
- package/dist/types/model/embed.d.ts +1 -1
- package/dist/types/model/geoPoint.d.ts +1 -1
- package/dist/types/model/group.d.ts +1 -1
- package/dist/types/model/image.d.ts +3 -3
- package/dist/types/model/{integrationFields.d.ts → integration.d.ts} +3 -3
- package/dist/types/model/keyText.d.ts +1 -1
- package/dist/types/model/link.cjs.map +1 -1
- package/dist/types/model/link.d.ts +2 -2
- package/dist/types/model/link.js.map +1 -1
- package/dist/types/model/linkToMedia.d.ts +1 -1
- package/dist/types/model/number.d.ts +1 -1
- package/dist/types/model/richText.d.ts +3 -3
- package/dist/types/model/select.d.ts +1 -1
- package/dist/types/model/sharedSlice.d.ts +2 -2
- package/dist/types/model/sharedSliceVariation.d.ts +1 -1
- package/dist/types/model/slice.cjs.map +1 -1
- package/dist/types/model/slice.d.ts +1 -1
- package/dist/types/model/slice.js.map +1 -1
- package/dist/types/model/sliceZone.cjs.map +1 -1
- package/dist/types/model/sliceZone.d.ts +2 -2
- package/dist/types/model/sliceZone.js.map +1 -1
- package/dist/types/model/timestamp.d.ts +1 -1
- package/dist/types/model/title.d.ts +1 -1
- package/dist/types/model/types.cjs +5 -1
- package/dist/types/model/types.cjs.map +1 -1
- package/dist/types/model/types.d.ts +10 -6
- package/dist/types/model/types.js +5 -1
- package/dist/types/model/types.js.map +1 -1
- package/dist/types/model/uid.d.ts +1 -1
- package/dist/types/value/boolean.d.ts +1 -1
- package/dist/types/value/color.d.ts +1 -1
- package/dist/types/value/contentRelationship.d.ts +1 -1
- package/dist/types/value/date.d.ts +1 -1
- package/dist/types/value/document.d.ts +4 -4
- package/dist/types/value/embed.cjs.map +1 -1
- package/dist/types/value/embed.d.ts +1 -1
- package/dist/types/value/embed.js.map +1 -1
- package/dist/types/value/geoPoint.d.ts +1 -1
- package/dist/types/value/group.d.ts +1 -1
- package/dist/types/value/image.d.ts +3 -3
- package/dist/types/value/{integrationFields.d.ts → integration.d.ts} +2 -2
- package/dist/types/value/keyText.d.ts +1 -1
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.ts +2 -2
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/linkToMedia.d.ts +2 -2
- package/dist/types/value/number.d.ts +1 -1
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.d.ts +26 -26
- package/dist/types/value/richText.js.map +1 -1
- package/dist/types/value/select.d.ts +1 -1
- package/dist/types/value/sharedSlice.d.ts +1 -1
- package/dist/types/value/sharedSliceVariation.d.ts +3 -0
- package/dist/types/value/slice.d.ts +1 -1
- package/dist/types/value/timestamp.d.ts +1 -1
- package/dist/types/value/title.d.ts +1 -1
- package/dist/types/value/types.d.ts +2 -2
- package/dist/types/webhook/apiUpdate.d.ts +1 -1
- package/package.json +2 -2
- package/src/buildQueryURL.ts +4 -4
- package/src/createClient.ts +28 -28
- package/src/filter.ts +1 -1
- package/src/helpers/asDate.ts +2 -2
- package/src/helpers/asHTML.ts +28 -29
- package/src/helpers/asImagePixelDensitySrcSet.ts +5 -5
- package/src/helpers/asImageSrc.ts +3 -3
- package/src/helpers/asImageWidthSrcSet.ts +6 -6
- package/src/helpers/asLink.ts +18 -18
- package/src/helpers/asLinkAttrs.ts +5 -5
- package/src/helpers/asText.ts +8 -8
- package/src/helpers/documentToLinkField.ts +1 -1
- package/src/helpers/isFilled.ts +27 -22
- package/src/index.ts +19 -3
- package/src/types/api/repository.ts +2 -2
- package/src/types/model/boolean.ts +1 -1
- package/src/types/model/color.ts +1 -1
- package/src/types/model/contentRelationship.ts +1 -1
- package/src/types/model/customType.ts +11 -11
- package/src/types/model/date.ts +1 -1
- package/src/types/model/embed.ts +1 -1
- package/src/types/model/geoPoint.ts +1 -1
- package/src/types/model/group.ts +1 -1
- package/src/types/model/image.ts +3 -3
- package/src/types/model/{integrationFields.ts → integration.ts} +3 -3
- package/src/types/model/keyText.ts +1 -1
- package/src/types/model/link.ts +2 -2
- package/src/types/model/linkToMedia.ts +1 -1
- package/src/types/model/number.ts +1 -1
- package/src/types/model/richText.ts +3 -3
- package/src/types/model/select.ts +1 -1
- package/src/types/model/sharedSlice.ts +2 -2
- package/src/types/model/sharedSliceVariation.ts +1 -1
- package/src/types/model/slice.ts +1 -1
- package/src/types/model/sliceZone.ts +2 -2
- package/src/types/model/timestamp.ts +1 -1
- package/src/types/model/title.ts +1 -1
- package/src/types/model/types.ts +10 -6
- package/src/types/model/uid.ts +1 -1
- package/src/types/value/boolean.ts +1 -1
- package/src/types/value/color.ts +1 -1
- package/src/types/value/contentRelationship.ts +1 -1
- package/src/types/value/date.ts +1 -1
- package/src/types/value/document.ts +4 -4
- package/src/types/value/embed.ts +1 -1
- package/src/types/value/geoPoint.ts +1 -1
- package/src/types/value/group.ts +1 -1
- package/src/types/value/image.ts +4 -4
- package/src/types/value/{integrationFields.ts → integration.ts} +2 -2
- package/src/types/value/keyText.ts +1 -1
- package/src/types/value/link.ts +2 -2
- package/src/types/value/linkToMedia.ts +2 -2
- package/src/types/value/number.ts +1 -1
- package/src/types/value/richText.ts +26 -26
- package/src/types/value/select.ts +1 -1
- package/src/types/value/sharedSlice.ts +1 -1
- package/src/types/value/sharedSliceVariation.ts +3 -0
- package/src/types/value/slice.ts +1 -1
- package/src/types/value/timestamp.ts +1 -1
- package/src/types/value/title.ts +1 -1
- package/src/types/value/types.ts +2 -2
- package/src/types/webhook/apiUpdate.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
* An
|
|
3
|
+
* An integration custom type field.
|
|
4
4
|
*
|
|
5
5
|
* More details: {@link https://prismic.io/docs/integration-fields}
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
8
|
-
type: typeof CustomTypeModelFieldType.
|
|
7
|
+
export interface CustomTypeModelIntegrationField {
|
|
8
|
+
type: typeof CustomTypeModelFieldType.Integration;
|
|
9
9
|
config?: {
|
|
10
10
|
label?: string | null;
|
|
11
11
|
placeholder?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.cjs","sources":["../../../../src/types/model/link.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\n/**\n * A
|
|
1
|
+
{"version":3,"file":"link.cjs","sources":["../../../../src/types/model/link.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\n/**\n * A link custom type field.\n *\n * More details:\n * {@link https://prismic.io/docs/link}\n */\nexport interface CustomTypeModelLinkField {\n\ttype: typeof CustomTypeModelFieldType.Link;\n\tconfig?: {\n\t\tlabel?: string | null;\n\t\tplaceholder?: string;\n\t\tselect?:\n\t\t\t| null\n\t\t\t| (typeof CustomTypeModelLinkSelectType)[keyof typeof CustomTypeModelLinkSelectType];\n\t\tallowTargetBlank?: boolean;\n\t};\n}\n\n/**\n * Type of a link custom type field.\n *\n * More details:\n * {@link https://prismic.io/docs/link}\n */\nexport const CustomTypeModelLinkSelectType = {\n\tDocument: \"document\",\n\tMedia: \"media\",\n\tWeb: \"web\",\n} as const;\n"],"names":[],"mappings":";;AA0BO,MAAM,gCAAgC;AAAA,EAC5C,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
* A
|
|
3
|
+
* A link custom type field.
|
|
4
4
|
*
|
|
5
5
|
* More details:
|
|
6
6
|
* {@link https://prismic.io/docs/link}
|
|
@@ -15,7 +15,7 @@ export interface CustomTypeModelLinkField {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Type of a
|
|
18
|
+
* Type of a link custom type field.
|
|
19
19
|
*
|
|
20
20
|
* More details:
|
|
21
21
|
* {@link https://prismic.io/docs/link}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":["../../../../src/types/model/link.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\n/**\n * A
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../../../src/types/model/link.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\n/**\n * A link custom type field.\n *\n * More details:\n * {@link https://prismic.io/docs/link}\n */\nexport interface CustomTypeModelLinkField {\n\ttype: typeof CustomTypeModelFieldType.Link;\n\tconfig?: {\n\t\tlabel?: string | null;\n\t\tplaceholder?: string;\n\t\tselect?:\n\t\t\t| null\n\t\t\t| (typeof CustomTypeModelLinkSelectType)[keyof typeof CustomTypeModelLinkSelectType];\n\t\tallowTargetBlank?: boolean;\n\t};\n}\n\n/**\n * Type of a link custom type field.\n *\n * More details:\n * {@link https://prismic.io/docs/link}\n */\nexport const CustomTypeModelLinkSelectType = {\n\tDocument: \"document\",\n\tMedia: \"media\",\n\tWeb: \"web\",\n} as const;\n"],"names":[],"mappings":"AA0BO,MAAM,gCAAgC;AAAA,EAC5C,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types";
|
|
2
2
|
import type { CustomTypeModelLinkSelectType } from "./link";
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
4
|
+
* A link to media custom type field.
|
|
5
5
|
*
|
|
6
6
|
* More details:
|
|
7
7
|
* {@link https://prismic.io/docs/media}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
* A
|
|
3
|
+
* A rich text custom type field.
|
|
4
4
|
*
|
|
5
5
|
* More details: {@link https://prismic.io/docs/rich-text-title}
|
|
6
6
|
*/
|
|
7
7
|
export type CustomTypeModelRichTextField = CustomTypeModelRichTextMultiField | CustomTypeModelRichTextSingleField;
|
|
8
8
|
/**
|
|
9
|
-
* A
|
|
9
|
+
* A rich text custom type field which supports multiple blocks of content.
|
|
10
10
|
*
|
|
11
11
|
* More details: {@link https://prismic.io/docs/rich-text-title}
|
|
12
12
|
*/
|
|
@@ -20,7 +20,7 @@ export interface CustomTypeModelRichTextMultiField {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* A
|
|
23
|
+
* A rich text custom type field which supports one block of content.
|
|
24
24
|
*
|
|
25
25
|
* More details: {@link https://prismic.io/docs/rich-text-title}
|
|
26
26
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { SharedSliceModelVariation } from "./sharedSliceVariation";
|
|
2
2
|
import type { CustomTypeModelSliceType } from "./sliceZone";
|
|
3
3
|
/**
|
|
4
|
-
* A Prismic
|
|
4
|
+
* A Prismic shared Slice model.
|
|
5
5
|
*
|
|
6
6
|
* More details: {@link https://prismic.io/docs/slice}
|
|
7
7
|
*
|
|
8
|
-
* @typeParam Variation - A variation for the
|
|
8
|
+
* @typeParam Variation - A variation for the shared Slice.
|
|
9
9
|
*/
|
|
10
10
|
export interface SharedSliceModel<ID extends string = string, Variation extends SharedSliceModelVariation = SharedSliceModelVariation> {
|
|
11
11
|
type: typeof CustomTypeModelSliceType.SharedSlice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice.cjs","sources":["../../../../src/types/model/slice.ts"],"sourcesContent":["import type { CustomTypeModelFieldForGroup } from \"./types\";\n\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelSliceType } from \"./sliceZone\";\n\n/**\n * A Slice for a
|
|
1
|
+
{"version":3,"file":"slice.cjs","sources":["../../../../src/types/model/slice.ts"],"sourcesContent":["import type { CustomTypeModelFieldForGroup } from \"./types\";\n\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelSliceType } from \"./sliceZone\";\n\n/**\n * A Slice for a custom type.\n *\n * More details: {@link https://prismic.io/docs/slice}\n *\n * @typeParam NonRepeatFields - A record of fields that cannnot be repeated.\n * @typeParam RepeatFields - A record of fields that can be repeated.\n */\nexport interface CustomTypeModelSlice<\n\tNonRepeatFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n\tRepeatFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n> {\n\ttype: typeof CustomTypeModelSliceType.Slice;\n\tfieldset?: string | null;\n\tdescription?: string;\n\ticon?: string;\n\tdisplay?:\n\t\t| (typeof CustomTypeModelSliceDisplay)[keyof typeof CustomTypeModelSliceDisplay]\n\t\t| string;\n\t\"non-repeat\"?: NonRepeatFields;\n\trepeat?: RepeatFields;\n}\n\n/**\n * Display type for a Slice.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport const CustomTypeModelSliceDisplay = {\n\tList: \"list\",\n\tGrid: \"grid\",\n} as const;\n\n/**\n * @deprecated - Legacy slice type. Do not use.\n */\nexport type CustomTypeModelLegacySlice =\n\t| CustomTypeModelGroupField\n\t| CustomTypeModelFieldForGroup;\n"],"names":[],"mappings":";;AAuCO,MAAM,8BAA8B;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM;;;"}
|
|
@@ -2,7 +2,7 @@ import type { CustomTypeModelFieldForGroup } from "./types";
|
|
|
2
2
|
import type { CustomTypeModelGroupField } from "./group";
|
|
3
3
|
import type { CustomTypeModelSliceType } from "./sliceZone";
|
|
4
4
|
/**
|
|
5
|
-
* A Slice for a
|
|
5
|
+
* A Slice for a custom type.
|
|
6
6
|
*
|
|
7
7
|
* More details: {@link https://prismic.io/docs/slice}
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice.js","sources":["../../../../src/types/model/slice.ts"],"sourcesContent":["import type { CustomTypeModelFieldForGroup } from \"./types\";\n\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelSliceType } from \"./sliceZone\";\n\n/**\n * A Slice for a
|
|
1
|
+
{"version":3,"file":"slice.js","sources":["../../../../src/types/model/slice.ts"],"sourcesContent":["import type { CustomTypeModelFieldForGroup } from \"./types\";\n\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelSliceType } from \"./sliceZone\";\n\n/**\n * A Slice for a custom type.\n *\n * More details: {@link https://prismic.io/docs/slice}\n *\n * @typeParam NonRepeatFields - A record of fields that cannnot be repeated.\n * @typeParam RepeatFields - A record of fields that can be repeated.\n */\nexport interface CustomTypeModelSlice<\n\tNonRepeatFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n\tRepeatFields extends Record<string, CustomTypeModelFieldForGroup> = Record<\n\t\tstring,\n\t\tCustomTypeModelFieldForGroup\n\t>,\n> {\n\ttype: typeof CustomTypeModelSliceType.Slice;\n\tfieldset?: string | null;\n\tdescription?: string;\n\ticon?: string;\n\tdisplay?:\n\t\t| (typeof CustomTypeModelSliceDisplay)[keyof typeof CustomTypeModelSliceDisplay]\n\t\t| string;\n\t\"non-repeat\"?: NonRepeatFields;\n\trepeat?: RepeatFields;\n}\n\n/**\n * Display type for a Slice.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport const CustomTypeModelSliceDisplay = {\n\tList: \"list\",\n\tGrid: \"grid\",\n} as const;\n\n/**\n * @deprecated - Legacy slice type. Do not use.\n */\nexport type CustomTypeModelLegacySlice =\n\t| CustomTypeModelGroupField\n\t| CustomTypeModelFieldForGroup;\n"],"names":[],"mappings":"AAuCO,MAAM,8BAA8B;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliceZone.cjs","sources":["../../../../src/types/model/sliceZone.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\nimport type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from \"./slice\";\n\n/**\n * A Slice Zone
|
|
1
|
+
{"version":3,"file":"sliceZone.cjs","sources":["../../../../src/types/model/sliceZone.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\nimport type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from \"./slice\";\n\n/**\n * A Slice Zone custom type field.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport interface CustomTypeModelSliceZoneField<\n\tSlices extends Record<\n\t\tstring,\n\t\t| CustomTypeModelSlice\n\t\t| CustomTypeModelSharedSlice\n\t\t| CustomTypeModelLegacySlice\n\t> = Record<\n\t\tstring,\n\t\t| CustomTypeModelSlice\n\t\t| CustomTypeModelSharedSlice\n\t\t| CustomTypeModelLegacySlice\n\t>,\n> {\n\ttype:\n\t\t| typeof CustomTypeModelFieldType.Slices\n\t\t| typeof CustomTypeModelFieldType.LegacySlices;\n\tfieldset?: string | null;\n\tconfig?: {\n\t\tlabels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null;\n\t\tchoices?: Slices;\n\t};\n}\n\n/**\n * Label for a Slice.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport interface CustomTypeModelSliceLabel {\n\tname: string;\n\tdisplay?: string;\n}\n\n/**\n * Type identifier for a Slice.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport const CustomTypeModelSliceType = {\n\tSlice: \"Slice\",\n\tSharedSlice: \"SharedSlice\",\n} as const;\n\n/**\n * A shared Slice for a custom type.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport interface CustomTypeModelSharedSlice {\n\ttype: typeof CustomTypeModelSliceType.SharedSlice;\n}\n"],"names":[],"mappings":";;AA+CO,MAAM,2BAA2B;AAAA,EACvC,OAAO;AAAA,EACP,aAAa;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CustomTypeModelFieldType } from "./types";
|
|
2
2
|
import type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./slice";
|
|
3
3
|
/**
|
|
4
|
-
* A Slice Zone
|
|
4
|
+
* A Slice Zone custom type field.
|
|
5
5
|
*
|
|
6
6
|
* More details: {@link https://prismic.io/docs/slice}
|
|
7
7
|
*/
|
|
@@ -32,7 +32,7 @@ export declare const CustomTypeModelSliceType: {
|
|
|
32
32
|
readonly SharedSlice: "SharedSlice";
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
* A
|
|
35
|
+
* A shared Slice for a custom type.
|
|
36
36
|
*
|
|
37
37
|
* More details: {@link https://prismic.io/docs/slice}
|
|
38
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliceZone.js","sources":["../../../../src/types/model/sliceZone.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\nimport type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from \"./slice\";\n\n/**\n * A Slice Zone
|
|
1
|
+
{"version":3,"file":"sliceZone.js","sources":["../../../../src/types/model/sliceZone.ts"],"sourcesContent":["import type { CustomTypeModelFieldType } from \"./types\";\n\nimport type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from \"./slice\";\n\n/**\n * A Slice Zone custom type field.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport interface CustomTypeModelSliceZoneField<\n\tSlices extends Record<\n\t\tstring,\n\t\t| CustomTypeModelSlice\n\t\t| CustomTypeModelSharedSlice\n\t\t| CustomTypeModelLegacySlice\n\t> = Record<\n\t\tstring,\n\t\t| CustomTypeModelSlice\n\t\t| CustomTypeModelSharedSlice\n\t\t| CustomTypeModelLegacySlice\n\t>,\n> {\n\ttype:\n\t\t| typeof CustomTypeModelFieldType.Slices\n\t\t| typeof CustomTypeModelFieldType.LegacySlices;\n\tfieldset?: string | null;\n\tconfig?: {\n\t\tlabels?: Record<string, readonly CustomTypeModelSliceLabel[]> | null;\n\t\tchoices?: Slices;\n\t};\n}\n\n/**\n * Label for a Slice.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport interface CustomTypeModelSliceLabel {\n\tname: string;\n\tdisplay?: string;\n}\n\n/**\n * Type identifier for a Slice.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport const CustomTypeModelSliceType = {\n\tSlice: \"Slice\",\n\tSharedSlice: \"SharedSlice\",\n} as const;\n\n/**\n * A shared Slice for a custom type.\n *\n * More details: {@link https://prismic.io/docs/slice}\n */\nexport interface CustomTypeModelSharedSlice {\n\ttype: typeof CustomTypeModelSliceType.SharedSlice;\n}\n"],"names":[],"mappings":"AA+CO,MAAM,2BAA2B;AAAA,EACvC,OAAO;AAAA,EACP,aAAa;;"}
|
|
@@ -8,7 +8,7 @@ const CustomTypeModelFieldType = {
|
|
|
8
8
|
GeoPoint: "GeoPoint",
|
|
9
9
|
Group: "Group",
|
|
10
10
|
Image: "Image",
|
|
11
|
-
|
|
11
|
+
Integration: "IntegrationFields",
|
|
12
12
|
Link: "Link",
|
|
13
13
|
Number: "Number",
|
|
14
14
|
Select: "Select",
|
|
@@ -17,6 +17,10 @@ const CustomTypeModelFieldType = {
|
|
|
17
17
|
Text: "Text",
|
|
18
18
|
Timestamp: "Timestamp",
|
|
19
19
|
UID: "UID",
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated - Renamed to `Integration`.
|
|
22
|
+
*/
|
|
23
|
+
IntegrationFields: "IntegrationFields",
|
|
20
24
|
/**
|
|
21
25
|
* @deprecated - Legacy field type. Use `Number` instead.
|
|
22
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../../src/types/model/types.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"./boolean\";\nimport type { CustomTypeModelColorField } from \"./color\";\nimport type { CustomTypeModelContentRelationshipField } from \"./contentRelationship\";\nimport type { CustomTypeModelDateField } from \"./date\";\nimport type { CustomTypeModelEmbedField } from \"./embed\";\nimport type { CustomTypeModelGeoPointField } from \"./geoPoint\";\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelImageField } from \"./image\";\nimport type {
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../src/types/model/types.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"./boolean\";\nimport type { CustomTypeModelColorField } from \"./color\";\nimport type { CustomTypeModelContentRelationshipField } from \"./contentRelationship\";\nimport type { CustomTypeModelDateField } from \"./date\";\nimport type { CustomTypeModelEmbedField } from \"./embed\";\nimport type { CustomTypeModelGeoPointField } from \"./geoPoint\";\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelImageField } from \"./image\";\nimport type { CustomTypeModelIntegrationField } from \"./integration\";\nimport type { CustomTypeModelKeyTextField } from \"./keyText\";\nimport type { CustomTypeModelLinkField } from \"./link\";\nimport type { CustomTypeModelLinkToMediaField } from \"./linkToMedia\";\nimport type { CustomTypeModelNumberField } from \"./number\";\nimport type { CustomTypeModelRangeField } from \"./range\";\nimport type { CustomTypeModelRichTextField } from \"./richText\";\nimport type { CustomTypeModelSelectField } from \"./select\";\nimport type { CustomTypeModelSeparatorField } from \"./separator\";\nimport type { CustomTypeModelSliceZoneField } from \"./sliceZone\";\nimport type { CustomTypeModelTimestampField } from \"./timestamp\";\nimport type { CustomTypeModelTitleField } from \"./title\";\nimport type { CustomTypeModelUIDField } from \"./uid\";\n\n/**\n * Type identifier for a custom type field.\n */\nexport const CustomTypeModelFieldType = {\n\tBoolean: \"Boolean\",\n\tColor: \"Color\",\n\tDate: \"Date\",\n\tEmbed: \"Embed\",\n\tGeoPoint: \"GeoPoint\",\n\tGroup: \"Group\",\n\tImage: \"Image\",\n\tIntegration: \"IntegrationFields\",\n\tLink: \"Link\",\n\tNumber: \"Number\",\n\tSelect: \"Select\",\n\tSlices: \"Slices\",\n\tStructuredText: \"StructuredText\",\n\tText: \"Text\",\n\tTimestamp: \"Timestamp\",\n\tUID: \"UID\",\n\t/**\n\t * @deprecated - Renamed to `Integration`.\n\t */\n\tIntegrationFields: \"IntegrationFields\",\n\t/**\n\t * @deprecated - Legacy field type. Use `Number` instead.\n\t */\n\tRange: \"Range\",\n\t/**\n\t * @deprecated - Legacy field type. Do not use.\n\t */\n\tSeparator: \"Separator\",\n\t/**\n\t * @deprecated - Legacy field type. Use `Slices` instead.\n\t */\n\tLegacySlices: \"Choice\",\n} as const;\n\n/**\n * A custom type field.\n */\nexport type CustomTypeModelField =\n\t| CustomTypeModelUIDField\n\t| CustomTypeModelGroupField\n\t| CustomTypeModelSliceZoneField\n\t| CustomTypeModelFieldForGroup;\n\n/**\n * Any custom type field that is valid for a group field.\n */\nexport type CustomTypeModelFieldForGroup =\n\t| CustomTypeModelBooleanField\n\t| CustomTypeModelColorField\n\t| CustomTypeModelDateField\n\t| CustomTypeModelEmbedField\n\t| CustomTypeModelGeoPointField\n\t| CustomTypeModelImageField\n\t| CustomTypeModelIntegrationField\n\t| CustomTypeModelContentRelationshipField\n\t| CustomTypeModelLinkField\n\t| CustomTypeModelLinkToMediaField\n\t| CustomTypeModelNumberField\n\t| CustomTypeModelRangeField\n\t| CustomTypeModelSelectField\n\t| CustomTypeModelRichTextField\n\t| CustomTypeModelTitleField\n\t| CustomTypeModelKeyTextField\n\t| CustomTypeModelTimestampField\n\t| CustomTypeModelSeparatorField;\n"],"names":[],"mappings":";;AAyBO,MAAM,2BAA2B;AAAA,EACvC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,KAAK;AAAA;AAAA;AAAA;AAAA,EAIL,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAInB,OAAO;AAAA;AAAA;AAAA;AAAA,EAIP,WAAW;AAAA;AAAA;AAAA;AAAA,EAIX,cAAc;;;"}
|
|
@@ -6,7 +6,7 @@ import type { CustomTypeModelEmbedField } from "./embed";
|
|
|
6
6
|
import type { CustomTypeModelGeoPointField } from "./geoPoint";
|
|
7
7
|
import type { CustomTypeModelGroupField } from "./group";
|
|
8
8
|
import type { CustomTypeModelImageField } from "./image";
|
|
9
|
-
import type {
|
|
9
|
+
import type { CustomTypeModelIntegrationField } from "./integration";
|
|
10
10
|
import type { CustomTypeModelKeyTextField } from "./keyText";
|
|
11
11
|
import type { CustomTypeModelLinkField } from "./link";
|
|
12
12
|
import type { CustomTypeModelLinkToMediaField } from "./linkToMedia";
|
|
@@ -20,7 +20,7 @@ import type { CustomTypeModelTimestampField } from "./timestamp";
|
|
|
20
20
|
import type { CustomTypeModelTitleField } from "./title";
|
|
21
21
|
import type { CustomTypeModelUIDField } from "./uid";
|
|
22
22
|
/**
|
|
23
|
-
* Type identifier for a
|
|
23
|
+
* Type identifier for a custom type field.
|
|
24
24
|
*/
|
|
25
25
|
export declare const CustomTypeModelFieldType: {
|
|
26
26
|
readonly Boolean: "Boolean";
|
|
@@ -30,7 +30,7 @@ export declare const CustomTypeModelFieldType: {
|
|
|
30
30
|
readonly GeoPoint: "GeoPoint";
|
|
31
31
|
readonly Group: "Group";
|
|
32
32
|
readonly Image: "Image";
|
|
33
|
-
readonly
|
|
33
|
+
readonly Integration: "IntegrationFields";
|
|
34
34
|
readonly Link: "Link";
|
|
35
35
|
readonly Number: "Number";
|
|
36
36
|
readonly Select: "Select";
|
|
@@ -39,6 +39,10 @@ export declare const CustomTypeModelFieldType: {
|
|
|
39
39
|
readonly Text: "Text";
|
|
40
40
|
readonly Timestamp: "Timestamp";
|
|
41
41
|
readonly UID: "UID";
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated - Renamed to `Integration`.
|
|
44
|
+
*/
|
|
45
|
+
readonly IntegrationFields: "IntegrationFields";
|
|
42
46
|
/**
|
|
43
47
|
* @deprecated - Legacy field type. Use `Number` instead.
|
|
44
48
|
*/
|
|
@@ -53,10 +57,10 @@ export declare const CustomTypeModelFieldType: {
|
|
|
53
57
|
readonly LegacySlices: "Choice";
|
|
54
58
|
};
|
|
55
59
|
/**
|
|
56
|
-
* A
|
|
60
|
+
* A custom type field.
|
|
57
61
|
*/
|
|
58
62
|
export type CustomTypeModelField = CustomTypeModelUIDField | CustomTypeModelGroupField | CustomTypeModelSliceZoneField | CustomTypeModelFieldForGroup;
|
|
59
63
|
/**
|
|
60
|
-
* Any
|
|
64
|
+
* Any custom type field that is valid for a group field.
|
|
61
65
|
*/
|
|
62
|
-
export type CustomTypeModelFieldForGroup = CustomTypeModelBooleanField | CustomTypeModelColorField | CustomTypeModelDateField | CustomTypeModelEmbedField | CustomTypeModelGeoPointField | CustomTypeModelImageField |
|
|
66
|
+
export type CustomTypeModelFieldForGroup = CustomTypeModelBooleanField | CustomTypeModelColorField | CustomTypeModelDateField | CustomTypeModelEmbedField | CustomTypeModelGeoPointField | CustomTypeModelImageField | CustomTypeModelIntegrationField | CustomTypeModelContentRelationshipField | CustomTypeModelLinkField | CustomTypeModelLinkToMediaField | CustomTypeModelNumberField | CustomTypeModelRangeField | CustomTypeModelSelectField | CustomTypeModelRichTextField | CustomTypeModelTitleField | CustomTypeModelKeyTextField | CustomTypeModelTimestampField | CustomTypeModelSeparatorField;
|
|
@@ -6,7 +6,7 @@ const CustomTypeModelFieldType = {
|
|
|
6
6
|
GeoPoint: "GeoPoint",
|
|
7
7
|
Group: "Group",
|
|
8
8
|
Image: "Image",
|
|
9
|
-
|
|
9
|
+
Integration: "IntegrationFields",
|
|
10
10
|
Link: "Link",
|
|
11
11
|
Number: "Number",
|
|
12
12
|
Select: "Select",
|
|
@@ -15,6 +15,10 @@ const CustomTypeModelFieldType = {
|
|
|
15
15
|
Text: "Text",
|
|
16
16
|
Timestamp: "Timestamp",
|
|
17
17
|
UID: "UID",
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated - Renamed to `Integration`.
|
|
20
|
+
*/
|
|
21
|
+
IntegrationFields: "IntegrationFields",
|
|
18
22
|
/**
|
|
19
23
|
* @deprecated - Legacy field type. Use `Number` instead.
|
|
20
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../src/types/model/types.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"./boolean\";\nimport type { CustomTypeModelColorField } from \"./color\";\nimport type { CustomTypeModelContentRelationshipField } from \"./contentRelationship\";\nimport type { CustomTypeModelDateField } from \"./date\";\nimport type { CustomTypeModelEmbedField } from \"./embed\";\nimport type { CustomTypeModelGeoPointField } from \"./geoPoint\";\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelImageField } from \"./image\";\nimport type {
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/types/model/types.ts"],"sourcesContent":["import type { CustomTypeModelBooleanField } from \"./boolean\";\nimport type { CustomTypeModelColorField } from \"./color\";\nimport type { CustomTypeModelContentRelationshipField } from \"./contentRelationship\";\nimport type { CustomTypeModelDateField } from \"./date\";\nimport type { CustomTypeModelEmbedField } from \"./embed\";\nimport type { CustomTypeModelGeoPointField } from \"./geoPoint\";\nimport type { CustomTypeModelGroupField } from \"./group\";\nimport type { CustomTypeModelImageField } from \"./image\";\nimport type { CustomTypeModelIntegrationField } from \"./integration\";\nimport type { CustomTypeModelKeyTextField } from \"./keyText\";\nimport type { CustomTypeModelLinkField } from \"./link\";\nimport type { CustomTypeModelLinkToMediaField } from \"./linkToMedia\";\nimport type { CustomTypeModelNumberField } from \"./number\";\nimport type { CustomTypeModelRangeField } from \"./range\";\nimport type { CustomTypeModelRichTextField } from \"./richText\";\nimport type { CustomTypeModelSelectField } from \"./select\";\nimport type { CustomTypeModelSeparatorField } from \"./separator\";\nimport type { CustomTypeModelSliceZoneField } from \"./sliceZone\";\nimport type { CustomTypeModelTimestampField } from \"./timestamp\";\nimport type { CustomTypeModelTitleField } from \"./title\";\nimport type { CustomTypeModelUIDField } from \"./uid\";\n\n/**\n * Type identifier for a custom type field.\n */\nexport const CustomTypeModelFieldType = {\n\tBoolean: \"Boolean\",\n\tColor: \"Color\",\n\tDate: \"Date\",\n\tEmbed: \"Embed\",\n\tGeoPoint: \"GeoPoint\",\n\tGroup: \"Group\",\n\tImage: \"Image\",\n\tIntegration: \"IntegrationFields\",\n\tLink: \"Link\",\n\tNumber: \"Number\",\n\tSelect: \"Select\",\n\tSlices: \"Slices\",\n\tStructuredText: \"StructuredText\",\n\tText: \"Text\",\n\tTimestamp: \"Timestamp\",\n\tUID: \"UID\",\n\t/**\n\t * @deprecated - Renamed to `Integration`.\n\t */\n\tIntegrationFields: \"IntegrationFields\",\n\t/**\n\t * @deprecated - Legacy field type. Use `Number` instead.\n\t */\n\tRange: \"Range\",\n\t/**\n\t * @deprecated - Legacy field type. Do not use.\n\t */\n\tSeparator: \"Separator\",\n\t/**\n\t * @deprecated - Legacy field type. Use `Slices` instead.\n\t */\n\tLegacySlices: \"Choice\",\n} as const;\n\n/**\n * A custom type field.\n */\nexport type CustomTypeModelField =\n\t| CustomTypeModelUIDField\n\t| CustomTypeModelGroupField\n\t| CustomTypeModelSliceZoneField\n\t| CustomTypeModelFieldForGroup;\n\n/**\n * Any custom type field that is valid for a group field.\n */\nexport type CustomTypeModelFieldForGroup =\n\t| CustomTypeModelBooleanField\n\t| CustomTypeModelColorField\n\t| CustomTypeModelDateField\n\t| CustomTypeModelEmbedField\n\t| CustomTypeModelGeoPointField\n\t| CustomTypeModelImageField\n\t| CustomTypeModelIntegrationField\n\t| CustomTypeModelContentRelationshipField\n\t| CustomTypeModelLinkField\n\t| CustomTypeModelLinkToMediaField\n\t| CustomTypeModelNumberField\n\t| CustomTypeModelRangeField\n\t| CustomTypeModelSelectField\n\t| CustomTypeModelRichTextField\n\t| CustomTypeModelTitleField\n\t| CustomTypeModelKeyTextField\n\t| CustomTypeModelTimestampField\n\t| CustomTypeModelSeparatorField;\n"],"names":[],"mappings":"AAyBO,MAAM,2BAA2B;AAAA,EACvC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,KAAK;AAAA;AAAA;AAAA;AAAA,EAIL,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAInB,OAAO;AAAA;AAAA;AAAA;AAAA,EAIP,WAAW;AAAA;AAAA;AAAA;AAAA,EAIX,cAAc;;"}
|
|
@@ -13,7 +13,7 @@ import type { SliceZone } from "./sliceZone";
|
|
|
13
13
|
*/
|
|
14
14
|
export type ContentRelationshipField<TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown, State extends FieldState = FieldState> = State extends "empty" ? EmptyLinkField<typeof LinkType.Document> : FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface>;
|
|
15
15
|
/**
|
|
16
|
-
* Links that refer to
|
|
16
|
+
* Links that refer to documents
|
|
17
17
|
*/
|
|
18
18
|
export interface FilledContentRelationshipField<TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown> {
|
|
19
19
|
link_type: typeof LinkType.Document;
|
|
@@ -11,7 +11,7 @@ export interface AlternateLanguage<TypeEnum = string, LangEnum = string> {
|
|
|
11
11
|
lang: LangEnum;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Metadata for Prismic
|
|
14
|
+
* Metadata for Prismic document
|
|
15
15
|
*/
|
|
16
16
|
export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
17
17
|
/**
|
|
@@ -72,7 +72,7 @@ export interface PrismicDocumentHeader<TypeEnum = string, LangEnum = string> {
|
|
|
72
72
|
/**
|
|
73
73
|
* A Prismic document served through REST API v2.
|
|
74
74
|
*
|
|
75
|
-
* @see More details on
|
|
75
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
76
76
|
*/
|
|
77
77
|
export interface PrismicDocument<DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> = Record<string, any>, TypeEnum = string, LangEnum = string> extends PrismicDocumentHeader<TypeEnum, LangEnum> {
|
|
78
78
|
/**
|
|
@@ -84,7 +84,7 @@ export interface PrismicDocument<DataInterface extends Record<string, AnyRegular
|
|
|
84
84
|
* A Prismic document served through REST API v2. Does not contain a UID (a
|
|
85
85
|
* unique identifier).
|
|
86
86
|
*
|
|
87
|
-
* @see More details on
|
|
87
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
88
88
|
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
89
89
|
*/
|
|
90
90
|
export interface PrismicDocumentWithoutUID<DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> = Record<string, any>, TypeEnum = string, LangEnum = string> extends PrismicDocument<DataInterface, TypeEnum, LangEnum> {
|
|
@@ -101,7 +101,7 @@ export interface PrismicDocumentWithoutUID<DataInterface extends Record<string,
|
|
|
101
101
|
* A Prismic document served through REST API v2. Contains a UID (a unique
|
|
102
102
|
* identifier).
|
|
103
103
|
*
|
|
104
|
-
* @see More details on
|
|
104
|
+
* @see More details on custom types: {@link https://prismic.io/docs/custom-types}
|
|
105
105
|
* @see More details on the UID field: {@link https://prismic.io/docs/uid}
|
|
106
106
|
*/
|
|
107
107
|
export interface PrismicDocumentWithUID<DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> = Record<string, any>, TypeEnum = string, LangEnum = string> extends PrismicDocument<DataInterface, TypeEnum, LangEnum> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.cjs","sources":["../../../../src/types/value/embed.ts"],"sourcesContent":["import type { EmptyObjectField, FieldState } from \"./types\";\n\n/**\n * oEmbed 1.0 possible types.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport const OEmbedType = {\n\tPhoto: \"photo\",\n\tVideo: \"video\",\n\tLink: \"link\",\n\tRich: \"rich\",\n} as const;\n\n/**\n * oEmbed response base fields. Those are every mandatory fields an oEmbed\n * response must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\ntype OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {\n\t/**\n\t * oEmbed resource type.\n\t */\n\ttype: TType;\n\n\t/**\n\t * oEmbed version number, this must be \"1.0\".\n\t */\n\tversion: string;\n};\n\n/**\n * oEmbed response extra fields. Those are every non-mandatory and unknown\n * fields an oEmbed response can feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type OEmbedExtra = {\n\t/**\n\t * oEmbed text title, describing the resource.\n\t */\n\ttitle?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner name.\n\t */\n\tauthor_name?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner URL.\n\t */\n\tauthor_url?: string | null;\n\n\t/**\n\t * oEmbed resource provider name.\n\t */\n\tprovider_name?: string | null;\n\n\t/**\n\t * oEmbed resource provider URL.\n\t */\n\tprovider_url?: string | null;\n\n\t/**\n\t * oEmbed suggested cache lifetime for the resource, in seconds.\n\t */\n\tcache_age?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail URL.\n\t */\n\tthumbnail_url?: string | null;\n\n\t/**\n\t * oEmbed resource thumbnail width.\n\t */\n\tthumbnail_width?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail height.\n\t */\n\tthumbnail_height?: number | null;\n\n\t/**\n\t * Providers may optionally include any parameters not specified in this\n\t * document (so long as they use the same key-value format) and consumers may\n\t * choose to ignore these. Consumers must ignore parameters they do not\n\t * understand.\n\t *\n\t * @see oEmbed specification: {@link https://oembed.com}\n\t */\n\t[key: string]: unknown | null;\n};\n\n/**\n * oEmbed photo type. Those are every mandatory fields an oEmbed photo response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {\n\t/**\n\t * oEmbed source URL of the image.\n\t */\n\turl: string;\n\n\t/**\n\t * oEmbed width in pixels of the image.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels of the image.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed video type. Those are every mandatory fields an oEmbed video response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {\n\t/**\n\t * oEmbed HTML required to embed a video player.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed link type. Those are every mandatory fields an oEmbed link response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>;\n\n/**\n * oEmbed rich type. Those are every mandatory fields an oEmbed rich response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {\n\t/**\n\t * oEmbed HTML required to display the resource.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * Any of the possible types of oEmbed response. Those contains only mandatory\n * fields their respective oEmbed response type must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;\n\n/**\n * An
|
|
1
|
+
{"version":3,"file":"embed.cjs","sources":["../../../../src/types/value/embed.ts"],"sourcesContent":["import type { EmptyObjectField, FieldState } from \"./types\";\n\n/**\n * oEmbed 1.0 possible types.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport const OEmbedType = {\n\tPhoto: \"photo\",\n\tVideo: \"video\",\n\tLink: \"link\",\n\tRich: \"rich\",\n} as const;\n\n/**\n * oEmbed response base fields. Those are every mandatory fields an oEmbed\n * response must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\ntype OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {\n\t/**\n\t * oEmbed resource type.\n\t */\n\ttype: TType;\n\n\t/**\n\t * oEmbed version number, this must be \"1.0\".\n\t */\n\tversion: string;\n};\n\n/**\n * oEmbed response extra fields. Those are every non-mandatory and unknown\n * fields an oEmbed response can feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type OEmbedExtra = {\n\t/**\n\t * oEmbed text title, describing the resource.\n\t */\n\ttitle?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner name.\n\t */\n\tauthor_name?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner URL.\n\t */\n\tauthor_url?: string | null;\n\n\t/**\n\t * oEmbed resource provider name.\n\t */\n\tprovider_name?: string | null;\n\n\t/**\n\t * oEmbed resource provider URL.\n\t */\n\tprovider_url?: string | null;\n\n\t/**\n\t * oEmbed suggested cache lifetime for the resource, in seconds.\n\t */\n\tcache_age?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail URL.\n\t */\n\tthumbnail_url?: string | null;\n\n\t/**\n\t * oEmbed resource thumbnail width.\n\t */\n\tthumbnail_width?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail height.\n\t */\n\tthumbnail_height?: number | null;\n\n\t/**\n\t * Providers may optionally include any parameters not specified in this\n\t * document (so long as they use the same key-value format) and consumers may\n\t * choose to ignore these. Consumers must ignore parameters they do not\n\t * understand.\n\t *\n\t * @see oEmbed specification: {@link https://oembed.com}\n\t */\n\t[key: string]: unknown | null;\n};\n\n/**\n * oEmbed photo type. Those are every mandatory fields an oEmbed photo response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {\n\t/**\n\t * oEmbed source URL of the image.\n\t */\n\turl: string;\n\n\t/**\n\t * oEmbed width in pixels of the image.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels of the image.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed video type. Those are every mandatory fields an oEmbed video response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {\n\t/**\n\t * oEmbed HTML required to embed a video player.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed link type. Those are every mandatory fields an oEmbed link response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>;\n\n/**\n * oEmbed rich type. Those are every mandatory fields an oEmbed rich response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {\n\t/**\n\t * oEmbed HTML required to display the resource.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * Any of the possible types of oEmbed response. Those contains only mandatory\n * fields their respective oEmbed response type must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;\n\n/**\n * An embed field.\n *\n * @typeParam Data - Data provided by the URL's oEmbed provider.\n * @typeParam State - State of the field which determines its shape.\n * @see More details: {@link https://prismic.io/docs/embed}\n */\nexport type EmbedField<\n\tData extends AnyOEmbed = AnyOEmbed & OEmbedExtra,\n\tState extends FieldState = FieldState,\n> = State extends \"empty\"\n\t? EmptyObjectField\n\t: Data & {\n\t\t\tembed_url: string;\n\t\t\thtml: string | null;\n\t };\n"],"names":[],"mappings":";;AAOO,MAAM,aAAa;AAAA,EACzB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;;;"}
|
|
@@ -154,7 +154,7 @@ export type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {
|
|
|
154
154
|
*/
|
|
155
155
|
export type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;
|
|
156
156
|
/**
|
|
157
|
-
* An
|
|
157
|
+
* An embed field.
|
|
158
158
|
*
|
|
159
159
|
* @typeParam Data - Data provided by the URL's oEmbed provider.
|
|
160
160
|
* @typeParam State - State of the field which determines its shape.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","sources":["../../../../src/types/value/embed.ts"],"sourcesContent":["import type { EmptyObjectField, FieldState } from \"./types\";\n\n/**\n * oEmbed 1.0 possible types.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport const OEmbedType = {\n\tPhoto: \"photo\",\n\tVideo: \"video\",\n\tLink: \"link\",\n\tRich: \"rich\",\n} as const;\n\n/**\n * oEmbed response base fields. Those are every mandatory fields an oEmbed\n * response must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\ntype OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {\n\t/**\n\t * oEmbed resource type.\n\t */\n\ttype: TType;\n\n\t/**\n\t * oEmbed version number, this must be \"1.0\".\n\t */\n\tversion: string;\n};\n\n/**\n * oEmbed response extra fields. Those are every non-mandatory and unknown\n * fields an oEmbed response can feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type OEmbedExtra = {\n\t/**\n\t * oEmbed text title, describing the resource.\n\t */\n\ttitle?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner name.\n\t */\n\tauthor_name?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner URL.\n\t */\n\tauthor_url?: string | null;\n\n\t/**\n\t * oEmbed resource provider name.\n\t */\n\tprovider_name?: string | null;\n\n\t/**\n\t * oEmbed resource provider URL.\n\t */\n\tprovider_url?: string | null;\n\n\t/**\n\t * oEmbed suggested cache lifetime for the resource, in seconds.\n\t */\n\tcache_age?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail URL.\n\t */\n\tthumbnail_url?: string | null;\n\n\t/**\n\t * oEmbed resource thumbnail width.\n\t */\n\tthumbnail_width?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail height.\n\t */\n\tthumbnail_height?: number | null;\n\n\t/**\n\t * Providers may optionally include any parameters not specified in this\n\t * document (so long as they use the same key-value format) and consumers may\n\t * choose to ignore these. Consumers must ignore parameters they do not\n\t * understand.\n\t *\n\t * @see oEmbed specification: {@link https://oembed.com}\n\t */\n\t[key: string]: unknown | null;\n};\n\n/**\n * oEmbed photo type. Those are every mandatory fields an oEmbed photo response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {\n\t/**\n\t * oEmbed source URL of the image.\n\t */\n\turl: string;\n\n\t/**\n\t * oEmbed width in pixels of the image.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels of the image.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed video type. Those are every mandatory fields an oEmbed video response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {\n\t/**\n\t * oEmbed HTML required to embed a video player.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed link type. Those are every mandatory fields an oEmbed link response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>;\n\n/**\n * oEmbed rich type. Those are every mandatory fields an oEmbed rich response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {\n\t/**\n\t * oEmbed HTML required to display the resource.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * Any of the possible types of oEmbed response. Those contains only mandatory\n * fields their respective oEmbed response type must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;\n\n/**\n * An
|
|
1
|
+
{"version":3,"file":"embed.js","sources":["../../../../src/types/value/embed.ts"],"sourcesContent":["import type { EmptyObjectField, FieldState } from \"./types\";\n\n/**\n * oEmbed 1.0 possible types.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport const OEmbedType = {\n\tPhoto: \"photo\",\n\tVideo: \"video\",\n\tLink: \"link\",\n\tRich: \"rich\",\n} as const;\n\n/**\n * oEmbed response base fields. Those are every mandatory fields an oEmbed\n * response must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\ntype OEmbedBase<TType extends (typeof OEmbedType)[keyof typeof OEmbedType]> = {\n\t/**\n\t * oEmbed resource type.\n\t */\n\ttype: TType;\n\n\t/**\n\t * oEmbed version number, this must be \"1.0\".\n\t */\n\tversion: string;\n};\n\n/**\n * oEmbed response extra fields. Those are every non-mandatory and unknown\n * fields an oEmbed response can feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type OEmbedExtra = {\n\t/**\n\t * oEmbed text title, describing the resource.\n\t */\n\ttitle?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner name.\n\t */\n\tauthor_name?: string | null;\n\n\t/**\n\t * oEmbed resource author/owner URL.\n\t */\n\tauthor_url?: string | null;\n\n\t/**\n\t * oEmbed resource provider name.\n\t */\n\tprovider_name?: string | null;\n\n\t/**\n\t * oEmbed resource provider URL.\n\t */\n\tprovider_url?: string | null;\n\n\t/**\n\t * oEmbed suggested cache lifetime for the resource, in seconds.\n\t */\n\tcache_age?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail URL.\n\t */\n\tthumbnail_url?: string | null;\n\n\t/**\n\t * oEmbed resource thumbnail width.\n\t */\n\tthumbnail_width?: number | null;\n\n\t/**\n\t * oEmbed resource thumbnail height.\n\t */\n\tthumbnail_height?: number | null;\n\n\t/**\n\t * Providers may optionally include any parameters not specified in this\n\t * document (so long as they use the same key-value format) and consumers may\n\t * choose to ignore these. Consumers must ignore parameters they do not\n\t * understand.\n\t *\n\t * @see oEmbed specification: {@link https://oembed.com}\n\t */\n\t[key: string]: unknown | null;\n};\n\n/**\n * oEmbed photo type. Those are every mandatory fields an oEmbed photo response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type PhotoOEmbed = OEmbedBase<typeof OEmbedType.Photo> & {\n\t/**\n\t * oEmbed source URL of the image.\n\t */\n\turl: string;\n\n\t/**\n\t * oEmbed width in pixels of the image.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels of the image.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed video type. Those are every mandatory fields an oEmbed video response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type VideoOEmbed = OEmbedBase<typeof OEmbedType.Video> & {\n\t/**\n\t * oEmbed HTML required to embed a video player.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * oEmbed link type. Those are every mandatory fields an oEmbed link response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type LinkOEmbed = OEmbedBase<typeof OEmbedType.Link>;\n\n/**\n * oEmbed rich type. Those are every mandatory fields an oEmbed rich response\n * must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type RichOEmbed = OEmbedBase<typeof OEmbedType.Rich> & {\n\t/**\n\t * oEmbed HTML required to display the resource.\n\t */\n\thtml: string;\n\n\t/**\n\t * oEmbed width in pixels required to display the HTML.\n\t */\n\twidth: number;\n\n\t/**\n\t * oEmbed height in pixels required to display the HTML.\n\t */\n\theight: number;\n};\n\n/**\n * Any of the possible types of oEmbed response. Those contains only mandatory\n * fields their respective oEmbed response type must feature.\n *\n * @see oEmbed specification: {@link https://oembed.com}\n */\nexport type AnyOEmbed = PhotoOEmbed | VideoOEmbed | LinkOEmbed | RichOEmbed;\n\n/**\n * An embed field.\n *\n * @typeParam Data - Data provided by the URL's oEmbed provider.\n * @typeParam State - State of the field which determines its shape.\n * @see More details: {@link https://prismic.io/docs/embed}\n */\nexport type EmbedField<\n\tData extends AnyOEmbed = AnyOEmbed & OEmbedExtra,\n\tState extends FieldState = FieldState,\n> = State extends \"empty\"\n\t? EmptyObjectField\n\t: Data & {\n\t\t\tembed_url: string;\n\t\t\thtml: string | null;\n\t };\n"],"names":[],"mappings":"AAOO,MAAM,aAAa;AAAA,EACzB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FieldState, Simplify } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
* An individual image within an
|
|
3
|
+
* An individual image within an image field. The base image and each thumbnail
|
|
4
4
|
* uses this type.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
-
* @see {@link ImageField} for a full
|
|
7
|
+
* @see {@link ImageField} for a full image field type.
|
|
8
8
|
*/
|
|
9
9
|
export type ImageFieldImage<State extends FieldState = FieldState> = State extends "empty" ? EmptyImageFieldImage : FilledImageFieldImage;
|
|
10
10
|
export interface FilledImageFieldImage {
|
|
@@ -23,7 +23,7 @@ export interface EmptyImageFieldImage {
|
|
|
23
23
|
copyright?: null;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* An image field.
|
|
27
27
|
*
|
|
28
28
|
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and
|
|
29
29
|
* will be removed in a future version. Use `never` instead.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { FieldState } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* An integration field.
|
|
4
4
|
*
|
|
5
5
|
* @typeParam Data - Data from the integrated API.
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
7
|
* @see More details: {@link https://prismic.io/docs/integration-fields}
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type IntegrationField<Data extends Record<string, unknown> = Record<string, unknown>, State extends FieldState = FieldState> = State extends "empty" ? null : Data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.cjs","sources":["../../../../src/types/value/link.ts"],"sourcesContent":["import type { AnyRegularField, FieldState } from \"./types\";\n\nimport type { ContentRelationshipField } from \"./contentRelationship\";\nimport type { GroupField } from \"./group\";\nimport type { LinkToMediaField } from \"./linkToMedia\";\nimport type { SliceZone } from \"./sliceZone\";\n\n/**\n * Link
|
|
1
|
+
{"version":3,"file":"link.cjs","sources":["../../../../src/types/value/link.ts"],"sourcesContent":["import type { AnyRegularField, FieldState } from \"./types\";\n\nimport type { ContentRelationshipField } from \"./contentRelationship\";\nimport type { GroupField } from \"./group\";\nimport type { LinkToMediaField } from \"./linkToMedia\";\nimport type { SliceZone } from \"./sliceZone\";\n\n/**\n * Link types\n */\nexport const LinkType = {\n\tAny: \"Any\",\n\tDocument: \"Document\",\n\tMedia: \"Media\",\n\tWeb: \"Web\",\n} as const;\n\n/**\n * For link fields that haven't been filled\n *\n * @typeParam Type - The type of link.\n */\nexport type EmptyLinkField<\n\tType extends (typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any,\n> = {\n\tlink_type: Type | string;\n};\n\n/**\n * Link that points to external website\n */\nexport interface FilledLinkToWebField {\n\tlink_type: typeof LinkType.Web;\n\turl: string;\n\ttarget?: string;\n}\n\n/**\n * A link field.\n *\n * @typeParam TypeEnum - Type API ID of the document.\n * @typeParam LangEnum - Language API ID of the document.\n * @typeParam DataInterface - Data fields for the document (filled in via\n * GraphQuery of `fetchLinks`).\n * @typeParam State - State of the field which determines its shape.\n */\nexport type LinkField<\n\tTypeEnum = string,\n\tLangEnum = string,\n\tDataInterface extends\n\t\t| Record<string, AnyRegularField | GroupField | SliceZone>\n\t\t| unknown = unknown,\n\tState extends FieldState = FieldState,\n> = State extends \"empty\"\n\t? EmptyLinkField<typeof LinkType.Any>\n\t:\n\t\t\t| ContentRelationshipField<TypeEnum, LangEnum, DataInterface, State>\n\t\t\t| FilledLinkToWebField\n\t\t\t| LinkToMediaField<State>;\n"],"names":[],"mappings":";;AAUO,MAAM,WAAW;AAAA,EACvB,KAAK;AAAA,EACL,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;;;"}
|