@prismicio/types-internal 2.6.0 → 2.7.0-alpha.1

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.
Files changed (36) hide show
  1. package/lib/content/Document.d.ts +409 -13
  2. package/lib/content/fields/WidgetContent.d.ts +408 -12
  3. package/lib/content/fields/nestable/LinkContent.d.ts +54 -8
  4. package/lib/content/fields/nestable/LinkContent.js +10 -1
  5. package/lib/content/fields/nestable/NestableContent.d.ts +68 -2
  6. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +129 -6
  7. package/lib/content/fields/nestable/RichTextContent/index.d.ts +60 -0
  8. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +136 -4
  9. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +32 -2
  10. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +136 -4
  11. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +68 -2
  12. package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +68 -2
  13. package/lib/content/fields/slices/Slice/index.d.ts +250 -10
  14. package/lib/content/fields/slices/SliceItem.d.ts +250 -10
  15. package/lib/content/fields/slices/SlicesContent.d.ts +340 -10
  16. package/lib/customtypes/CustomType.d.ts +342 -162
  17. package/lib/customtypes/Section.d.ts +342 -162
  18. package/lib/customtypes/diff/SharedSlice.d.ts +152 -72
  19. package/lib/customtypes/diff/Variation.d.ts +152 -72
  20. package/lib/customtypes/widgets/Group.d.ts +60 -0
  21. package/lib/customtypes/widgets/Widget.d.ts +318 -108
  22. package/lib/customtypes/widgets/nestable/Link.d.ts +20 -0
  23. package/lib/customtypes/widgets/nestable/Link.js +2 -0
  24. package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +10 -0
  25. package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +20 -0
  26. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +20 -0
  27. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +80 -0
  28. package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +87 -27
  29. package/lib/customtypes/widgets/slices/Slices.d.ts +424 -144
  30. package/package.json +1 -1
  31. package/src/content/fields/nestable/LinkContent.ts +12 -1
  32. package/src/customtypes/widgets/nestable/Link.ts +2 -0
  33. package/lib/content/fields/nestable/RichTextContent/TextBlock.d.ts +0 -727
  34. package/lib/content/fields/nestable/RichTextContent/TextBlock.js +0 -80
  35. package/lib/customtypes/widgets/slices/SliceWidget.d.ts +0 -327
  36. package/lib/customtypes/widgets/slices/SliceWidget.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "2.6.0",
3
+ "version": "2.7.0-alpha.1",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -23,6 +23,7 @@ const imageLinkLegacyCodec = t.exact(
23
23
  }),
24
24
  t.partial({
25
25
  date: StringOrNull,
26
+ text: t.string,
26
27
  }),
27
28
  ]),
28
29
  )
@@ -68,6 +69,7 @@ const fileLinkLegacyCodec = t.exact(
68
69
  }),
69
70
  t.partial({
70
71
  date: nullable(t.string),
72
+ text: t.string,
71
73
  }),
72
74
  ]),
73
75
  )
@@ -100,6 +102,7 @@ export const FileLinkContent = t.intersection([
100
102
  }),
101
103
  t.partial({
102
104
  size: withFallback(t.string, "0"),
105
+ text: t.string,
103
106
  }),
104
107
  ]),
105
108
  ),
@@ -108,7 +111,14 @@ export type FileLinkContent = t.TypeOf<typeof FileLinkContent>
108
111
 
109
112
  export const DocumentLinkType = "DocumentLink"
110
113
 
111
- const documentLinkLegacyCodec = t.strict({ id: NonEmptyString })
114
+ const documentLinkLegacyCodec = t.exact(
115
+ t.intersection([
116
+ t.type({ id: NonEmptyString }),
117
+ t.partial({
118
+ text: t.string,
119
+ }),
120
+ ]),
121
+ )
112
122
  type DocumentLinkLegacy = t.TypeOf<typeof documentLinkLegacyCodec>
113
123
  const DocumentLinkLegacy = new t.Type<DocumentLinkContent, DocumentLinkLegacy>(
114
124
  "DocumentLink",
@@ -152,6 +162,7 @@ const externalLinkLegacyCodec = t.exact(
152
162
  title: t.string,
153
163
  }),
154
164
  ),
165
+ text: t.string,
155
166
  }),
156
167
  ]),
157
168
  )
@@ -3,6 +3,7 @@ import * as t from "io-ts"
3
3
  import { withFallback } from "io-ts-types/lib/withFallback"
4
4
 
5
5
  import { StringOrNull } from "../../../validators"
6
+ import { Text } from "./Text"
6
7
 
7
8
  const arrayString = (
8
9
  entries:
@@ -78,6 +79,7 @@ export const LinkConfig = t.exact(
78
79
  masks: MasksArrayString,
79
80
  tags: MasksArrayString,
80
81
  allowTargetBlank: t.boolean,
82
+ text: Text,
81
83
  }),
82
84
  )
83
85
  export type LinkConfig = t.TypeOf<typeof LinkConfig>