@wordpress/core-data 4.13.0 → 5.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.
Files changed (202) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +148 -65
  3. package/build/entities.js +38 -51
  4. package/build/entities.js.map +1 -1
  5. package/build/hooks/index.js +14 -0
  6. package/build/hooks/index.js.map +1 -1
  7. package/build/hooks/use-entity-record.js +10 -6
  8. package/build/hooks/use-entity-record.js.map +1 -1
  9. package/build/hooks/use-entity-records.js +2 -0
  10. package/build/hooks/use-entity-records.js.map +1 -1
  11. package/build/hooks/use-query-select.js +5 -2
  12. package/build/hooks/use-query-select.js.map +1 -1
  13. package/build/hooks/use-resource-permissions.js +74 -11
  14. package/build/hooks/use-resource-permissions.js.map +1 -1
  15. package/build/index.js +1 -30
  16. package/build/index.js.map +1 -1
  17. package/build/resolvers.js +59 -39
  18. package/build/resolvers.js.map +1 -1
  19. package/build/selectors.js +9 -46
  20. package/build/selectors.js.map +1 -1
  21. package/build-module/entities.js +38 -52
  22. package/build-module/entities.js.map +1 -1
  23. package/build-module/hooks/index.js +1 -0
  24. package/build-module/hooks/index.js.map +1 -1
  25. package/build-module/hooks/use-entity-record.js +10 -6
  26. package/build-module/hooks/use-entity-record.js.map +1 -1
  27. package/build-module/hooks/use-entity-records.js +2 -0
  28. package/build-module/hooks/use-entity-records.js.map +1 -1
  29. package/build-module/hooks/use-query-select.js +4 -1
  30. package/build-module/hooks/use-query-select.js.map +1 -1
  31. package/build-module/hooks/use-resource-permissions.js +70 -10
  32. package/build-module/hooks/use-resource-permissions.js.map +1 -1
  33. package/build-module/index.js +0 -5
  34. package/build-module/index.js.map +1 -1
  35. package/build-module/resolvers.js +59 -39
  36. package/build-module/resolvers.js.map +1 -1
  37. package/build-module/selectors.js +7 -44
  38. package/build-module/selectors.js.map +1 -1
  39. package/build-types/actions.d.ts +188 -0
  40. package/build-types/actions.d.ts.map +1 -0
  41. package/build-types/batch/create-batch.d.ts +71 -0
  42. package/build-types/batch/create-batch.d.ts.map +1 -0
  43. package/build-types/batch/default-processor.d.ts +11 -0
  44. package/build-types/batch/default-processor.d.ts.map +1 -0
  45. package/build-types/batch/index.d.ts +3 -0
  46. package/build-types/batch/index.d.ts.map +1 -0
  47. package/build-types/entities.d.ts +128 -0
  48. package/build-types/entities.d.ts.map +1 -0
  49. package/build-types/entity-provider.d.ts +68 -0
  50. package/build-types/entity-provider.d.ts.map +1 -0
  51. package/build-types/entity-types/attachment.d.ts +121 -0
  52. package/build-types/entity-types/attachment.d.ts.map +1 -0
  53. package/build-types/entity-types/base-entity-records.d.ts +37 -0
  54. package/build-types/entity-types/base-entity-records.d.ts.map +1 -0
  55. package/build-types/entity-types/comment.d.ts +82 -0
  56. package/build-types/entity-types/comment.d.ts.map +1 -0
  57. package/build-types/entity-types/helpers.d.ts +123 -0
  58. package/build-types/entity-types/helpers.d.ts.map +1 -0
  59. package/build-types/entity-types/index.d.ts +64 -0
  60. package/build-types/entity-types/index.d.ts.map +1 -0
  61. package/build-types/entity-types/menu-location.d.ts +25 -0
  62. package/build-types/entity-types/menu-location.d.ts.map +1 -0
  63. package/build-types/entity-types/nav-menu-item.d.ts +88 -0
  64. package/build-types/entity-types/nav-menu-item.d.ts.map +1 -0
  65. package/build-types/entity-types/nav-menu.d.ts +45 -0
  66. package/build-types/entity-types/nav-menu.d.ts.map +1 -0
  67. package/build-types/entity-types/page.d.ts +120 -0
  68. package/build-types/entity-types/page.d.ts.map +1 -0
  69. package/build-types/entity-types/plugin.d.ts +62 -0
  70. package/build-types/entity-types/plugin.d.ts.map +1 -0
  71. package/build-types/entity-types/post.d.ts +128 -0
  72. package/build-types/entity-types/post.d.ts.map +1 -0
  73. package/build-types/entity-types/settings.d.ts +89 -0
  74. package/build-types/entity-types/settings.d.ts.map +1 -0
  75. package/build-types/entity-types/sidebar.d.ts +55 -0
  76. package/build-types/entity-types/sidebar.d.ts.map +1 -0
  77. package/build-types/entity-types/taxonomy.d.ts +83 -0
  78. package/build-types/entity-types/taxonomy.d.ts.map +1 -0
  79. package/build-types/entity-types/theme.d.ts +206 -0
  80. package/build-types/entity-types/theme.d.ts.map +1 -0
  81. package/build-types/entity-types/type.d.ts +71 -0
  82. package/build-types/entity-types/type.d.ts.map +1 -0
  83. package/build-types/entity-types/user.d.ts +93 -0
  84. package/build-types/entity-types/user.d.ts.map +1 -0
  85. package/build-types/entity-types/widget-type.d.ts +33 -0
  86. package/build-types/entity-types/widget-type.d.ts.map +1 -0
  87. package/build-types/entity-types/widget.d.ts +59 -0
  88. package/build-types/entity-types/widget.d.ts.map +1 -0
  89. package/build-types/entity-types/wp-template-part.d.ts +80 -0
  90. package/build-types/entity-types/wp-template-part.d.ts.map +1 -0
  91. package/build-types/entity-types/wp-template.d.ts +80 -0
  92. package/build-types/entity-types/wp-template.d.ts.map +1 -0
  93. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts +139 -0
  94. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts.map +1 -0
  95. package/build-types/fetch/__experimental-fetch-url-data.d.ts +35 -0
  96. package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -0
  97. package/build-types/fetch/index.d.ts +3 -0
  98. package/build-types/fetch/index.d.ts.map +1 -0
  99. package/build-types/hooks/constants.d.ts +7 -0
  100. package/build-types/hooks/constants.d.ts.map +1 -0
  101. package/build-types/hooks/index.d.ts +4 -0
  102. package/build-types/hooks/index.d.ts.map +1 -0
  103. package/build-types/hooks/memoize.d.ts +3 -0
  104. package/build-types/hooks/memoize.d.ts.map +1 -0
  105. package/build-types/hooks/use-entity-record.d.ts +124 -0
  106. package/build-types/hooks/use-entity-record.d.ts.map +1 -0
  107. package/build-types/hooks/use-entity-records.d.ts +49 -0
  108. package/build-types/hooks/use-entity-records.d.ts.map +1 -0
  109. package/build-types/hooks/use-query-select.d.ts +46 -0
  110. package/build-types/hooks/use-query-select.d.ts.map +1 -0
  111. package/build-types/hooks/use-resource-permissions.d.ts +99 -0
  112. package/build-types/hooks/use-resource-permissions.d.ts.map +1 -0
  113. package/build-types/index.d.ts +131 -0
  114. package/build-types/index.d.ts.map +1 -0
  115. package/build-types/locks/actions.d.ts +7 -0
  116. package/build-types/locks/actions.d.ts.map +1 -0
  117. package/build-types/locks/engine.d.ts +5 -0
  118. package/build-types/locks/engine.d.ts.map +1 -0
  119. package/build-types/locks/reducer.d.ts +10 -0
  120. package/build-types/locks/reducer.d.ts.map +1 -0
  121. package/build-types/locks/selectors.d.ts +5 -0
  122. package/build-types/locks/selectors.d.ts.map +1 -0
  123. package/build-types/locks/utils.d.ts +8 -0
  124. package/build-types/locks/utils.d.ts.map +1 -0
  125. package/build-types/name.d.ts +8 -0
  126. package/build-types/name.d.ts.map +1 -0
  127. package/build-types/queried-data/actions.d.ts +32 -0
  128. package/build-types/queried-data/actions.d.ts.map +1 -0
  129. package/build-types/queried-data/get-query-parts.d.ts +60 -0
  130. package/build-types/queried-data/get-query-parts.d.ts.map +1 -0
  131. package/build-types/queried-data/index.d.ts +4 -0
  132. package/build-types/queried-data/index.d.ts.map +1 -0
  133. package/build-types/queried-data/reducer.d.ts +54 -0
  134. package/build-types/queried-data/reducer.d.ts.map +1 -0
  135. package/build-types/queried-data/selectors.d.ts +16 -0
  136. package/build-types/queried-data/selectors.d.ts.map +1 -0
  137. package/build-types/reducer.d.ts +156 -0
  138. package/build-types/reducer.d.ts.map +1 -0
  139. package/build-types/resolvers.d.ts +75 -0
  140. package/build-types/resolvers.d.ts.map +1 -0
  141. package/build-types/selectors.d.ts +524 -0
  142. package/build-types/selectors.d.ts.map +1 -0
  143. package/build-types/types.d.ts +4 -0
  144. package/build-types/types.d.ts.map +1 -0
  145. package/build-types/utils/conservative-map-item.d.ts +12 -0
  146. package/build-types/utils/conservative-map-item.d.ts.map +1 -0
  147. package/build-types/utils/forward-resolver.d.ts +10 -0
  148. package/build-types/utils/forward-resolver.d.ts.map +1 -0
  149. package/build-types/utils/get-normalized-comma-separable.d.ts +12 -0
  150. package/build-types/utils/get-normalized-comma-separable.d.ts.map +1 -0
  151. package/build-types/utils/if-matching-action.d.ts +14 -0
  152. package/build-types/utils/if-matching-action.d.ts.map +1 -0
  153. package/build-types/utils/index.d.ts +9 -0
  154. package/build-types/utils/index.d.ts.map +1 -0
  155. package/build-types/utils/is-raw-attribute.d.ts +10 -0
  156. package/build-types/utils/is-raw-attribute.d.ts.map +1 -0
  157. package/build-types/utils/on-sub-key.d.ts +4 -0
  158. package/build-types/utils/on-sub-key.d.ts.map +1 -0
  159. package/build-types/utils/replace-action.d.ts +13 -0
  160. package/build-types/utils/replace-action.d.ts.map +1 -0
  161. package/build-types/utils/with-weak-map-cache.d.ts +12 -0
  162. package/build-types/utils/with-weak-map-cache.d.ts.map +1 -0
  163. package/package.json +13 -11
  164. package/src/entities.js +325 -0
  165. package/src/entity-types/attachment.ts +3 -4
  166. package/src/entity-types/comment.ts +3 -4
  167. package/src/entity-types/index.ts +31 -88
  168. package/src/entity-types/menu-location.ts +3 -4
  169. package/src/entity-types/nav-menu-item.ts +3 -4
  170. package/src/entity-types/nav-menu.ts +3 -3
  171. package/src/entity-types/page.ts +3 -3
  172. package/src/entity-types/plugin.ts +3 -3
  173. package/src/entity-types/post.ts +3 -3
  174. package/src/entity-types/settings.ts +3 -3
  175. package/src/entity-types/sidebar.ts +3 -4
  176. package/src/entity-types/taxonomy.ts +3 -4
  177. package/src/entity-types/theme.ts +7 -3
  178. package/src/entity-types/type.ts +3 -3
  179. package/src/entity-types/user.ts +3 -3
  180. package/src/entity-types/widget-type.ts +3 -4
  181. package/src/entity-types/widget.ts +3 -3
  182. package/src/entity-types/wp-template-part.ts +3 -4
  183. package/src/entity-types/wp-template.ts +3 -4
  184. package/src/hooks/index.ts +4 -0
  185. package/src/hooks/test/use-entity-record.js +41 -1
  186. package/src/hooks/test/use-resource-permissions.js +32 -36
  187. package/src/hooks/use-entity-record.ts +18 -6
  188. package/src/hooks/use-entity-records.ts +2 -0
  189. package/src/hooks/use-query-select.ts +4 -1
  190. package/src/hooks/use-resource-permissions.ts +84 -20
  191. package/src/index.js +0 -5
  192. package/src/resolvers.js +80 -45
  193. package/src/selectors.ts +202 -341
  194. package/src/test/resolvers.js +118 -4
  195. package/tsconfig.json +21 -0
  196. package/tsconfig.tsbuildinfo +1 -0
  197. package/build/entity-types/entities.js +0 -6
  198. package/build/entity-types/entities.js.map +0 -1
  199. package/build-module/entity-types/entities.js +0 -2
  200. package/build-module/entity-types/entities.js.map +0 -1
  201. package/src/entities.ts +0 -548
  202. package/src/entity-types/entities.ts +0 -130
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CommentingStatus, Context, ContextualField, PingStatus, PostFormat, PostStatus, RenderedText, OmitNevers } from './helpers';
5
+ import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
+ declare module './base-entity-records' {
7
+ namespace BaseEntityRecords {
8
+ interface Post<C extends Context> {
9
+ /**
10
+ * The date the post was published, in the site's timezone.
11
+ */
12
+ date: string | null;
13
+ /**
14
+ * The date the post was published, as GMT.
15
+ */
16
+ date_gmt: ContextualField<string | null, 'view' | 'edit', C>;
17
+ /**
18
+ * The globally unique identifier for the post.
19
+ */
20
+ guid: ContextualField<RenderedText<C>, 'view' | 'edit', C>;
21
+ /**
22
+ * Unique identifier for the post.
23
+ */
24
+ id: number;
25
+ /**
26
+ * URL to the post.
27
+ */
28
+ link: string;
29
+ /**
30
+ * The date the post was last modified, in the site's timezone.
31
+ */
32
+ modified: ContextualField<string, 'view' | 'edit', C>;
33
+ /**
34
+ * The date the post was last modified, as GMT.
35
+ */
36
+ modified_gmt: ContextualField<string, 'view' | 'edit', C>;
37
+ /**
38
+ * An alphanumeric identifier for the post unique to its type.
39
+ */
40
+ slug: string;
41
+ /**
42
+ * A named status for the post.
43
+ */
44
+ status: ContextualField<PostStatus, 'view' | 'edit', C>;
45
+ /**
46
+ * Type of post.
47
+ */
48
+ type: string;
49
+ /**
50
+ * A password to protect access to the content and excerpt.
51
+ */
52
+ password: ContextualField<string, 'edit', C>;
53
+ /**
54
+ * Permalink template for the post.
55
+ */
56
+ permalink_template: ContextualField<string, 'edit', C>;
57
+ /**
58
+ * Slug automatically generated from the post title.
59
+ */
60
+ generated_slug: ContextualField<string, 'edit', C>;
61
+ /**
62
+ * The title for the post.
63
+ */
64
+ title: RenderedText<C>;
65
+ /**
66
+ * The content for the post.
67
+ */
68
+ content: ContextualField<RenderedText<C> & {
69
+ /**
70
+ * Whether the content is protected with a password.
71
+ */
72
+ is_protected: boolean;
73
+ /**
74
+ * Version of the content block format used by the page.
75
+ */
76
+ block_version: ContextualField<string, 'edit', C>;
77
+ }, 'view' | 'edit', C>;
78
+ /**
79
+ * The ID for the author of the post.
80
+ */
81
+ author: number;
82
+ /**
83
+ * The excerpt for the post.
84
+ */
85
+ excerpt: RenderedText<C> & {
86
+ protected: boolean;
87
+ };
88
+ /**
89
+ * The ID of the featured media for the post.
90
+ */
91
+ featured_media: number;
92
+ /**
93
+ * Whether or not comments are open on the post.
94
+ */
95
+ comment_status: ContextualField<CommentingStatus, 'view' | 'edit', C>;
96
+ /**
97
+ * Whether or not the post can be pinged.
98
+ */
99
+ ping_status: ContextualField<PingStatus, 'view' | 'edit', C>;
100
+ /**
101
+ * The format for the post.
102
+ */
103
+ format: ContextualField<PostFormat, 'view' | 'edit', C>;
104
+ /**
105
+ * Meta fields.
106
+ */
107
+ meta: ContextualField<Record<string, string>, 'view' | 'edit', C>;
108
+ /**
109
+ * Whether or not the post should be treated as sticky.
110
+ */
111
+ sticky: ContextualField<boolean, 'view' | 'edit', C>;
112
+ /**
113
+ * The theme file to use to display the post.
114
+ */
115
+ template: ContextualField<string, 'view' | 'edit', C>;
116
+ /**
117
+ * The terms assigned to the post in the category taxonomy.
118
+ */
119
+ categories: ContextualField<number[], 'view' | 'edit', C>;
120
+ /**
121
+ * The terms assigned to the post in the post_tag taxonomy.
122
+ */
123
+ tags: ContextualField<number[], 'view' | 'edit', C>;
124
+ }
125
+ }
126
+ }
127
+ export declare type Post<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.Post<C>>;
128
+ //# sourceMappingURL=post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/entity-types/post.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAiB,iBAAiB,CAAC;QAClC,UAAiB,IAAI,CAAE,CAAC,SAAS,OAAO;YACvC;;eAEG;YACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;YACpB;;eAEG;YACH,QAAQ,EAAE,eAAe,CAAE,MAAM,GAAG,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YAC/D;;eAEG;YACH,IAAI,EAAE,eAAe,CAAE,YAAY,CAAE,CAAC,CAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YAC/D;;eAEG;YACH,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,QAAQ,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YACxD;;eAEG;YACH,YAAY,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YAC5D;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,MAAM,EAAE,eAAe,CAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,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G;YACH,MAAM,EAAE,eAAe,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YACvD;;eAEG;YACH,QAAQ,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YACxD;;eAEG;YACH,UAAU,EAAE,eAAe,CAAE,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YAC5D;;eAEG;YACH,IAAI,EAAE,eAAe,CAAE,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;SACtD;KACD;CACD;AAED,oBAAY,IAAI,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAC1D,kBAAkB,CAAC,IAAI,CAAE,CAAC,CAAE,CAC5B,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CommentingStatus, Context, OmitNevers, PingStatus } from './helpers';
5
+ import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
+ declare module './base-entity-records' {
7
+ namespace BaseEntityRecords {
8
+ interface Settings<C extends Context> {
9
+ /**
10
+ * What to show on the front page
11
+ */
12
+ show_on_front: string;
13
+ /**
14
+ * The ID of the page that should be displayed on the front page
15
+ */
16
+ page_on_front: number;
17
+ /**
18
+ * Site title.
19
+ */
20
+ title: string;
21
+ /**
22
+ * Site tagline.
23
+ */
24
+ description: string;
25
+ /**
26
+ * Site URL.
27
+ */
28
+ url: string;
29
+ /**
30
+ * This address is used for admin purposes, like new user notification.
31
+ */
32
+ email: string;
33
+ /**
34
+ * A city in the same timezone as you.
35
+ */
36
+ timezone: string;
37
+ /**
38
+ * A date format for all date strings.
39
+ */
40
+ date_format: string;
41
+ /**
42
+ * A time format for all time strings.
43
+ */
44
+ time_format: string;
45
+ /**
46
+ * A day number of the week that the week should start on.
47
+ */
48
+ start_of_week: number;
49
+ /**
50
+ * WordPress locale code.
51
+ */
52
+ language: string;
53
+ /**
54
+ * Convert emoticons like :-) and :-P to graphics on display.
55
+ */
56
+ use_smilies: boolean;
57
+ /**
58
+ * Default post category.
59
+ */
60
+ default_category: number;
61
+ /**
62
+ * Default post format.
63
+ */
64
+ default_post_format: string;
65
+ /**
66
+ * Blog pages show at most.
67
+ */
68
+ posts_per_page: number;
69
+ /**
70
+ * Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.
71
+ */
72
+ default_ping_status: PingStatus;
73
+ /**
74
+ * Allow people to submit comments on new posts.
75
+ */
76
+ default_comment_status: CommentingStatus;
77
+ /**
78
+ * Site logo.
79
+ */
80
+ site_logo: number;
81
+ /**
82
+ * Site icon.
83
+ */
84
+ site_icon: number;
85
+ }
86
+ }
87
+ }
88
+ export declare type Settings<C extends Context = 'view'> = OmitNevers<_BaseEntityRecords.Settings<C>>;
89
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/entity-types/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,UAAU,EACV,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAiB,iBAAiB,CAAC;QAClC,UAAiB,QAAQ,CAAE,CAAC,SAAS,OAAO;YAC3C;;eAEG;YACH,aAAa,EAAE,MAAM,CAAC;YACtB;;eAEG;YACH,aAAa,EAAE,MAAM,CAAC;YACtB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,GAAG,EAAE,MAAM,CAAC;YACZ;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,QAAQ,EAAE,MAAM,CAAC;YACjB;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,aAAa,EAAE,MAAM,CAAC;YACtB;;eAEG;YACH,QAAQ,EAAE,MAAM,CAAC;YACjB;;eAEG;YACH,WAAW,EAAE,OAAO,CAAC;YACrB;;eAEG;YACH,gBAAgB,EAAE,MAAM,CAAC;YACzB;;eAEG;YACH,mBAAmB,EAAE,MAAM,CAAC;YAC5B;;eAEG;YACH,cAAc,EAAE,MAAM,CAAC;YACvB;;eAEG;YACH,mBAAmB,EAAE,UAAU,CAAC;YAChC;;eAEG;YACH,sBAAsB,EAAE,gBAAgB,CAAC;YACzC;;eAEG;YACH,SAAS,EAAE,MAAM,CAAC;YAClB;;eAEG;YACH,SAAS,EAAE,MAAM,CAAC;SAClB;KACD;CACD;AAED,oBAAY,QAAQ,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAC9D,kBAAkB,CAAC,QAAQ,CAAE,CAAC,CAAE,CAChC,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { Context, OmitNevers } from './helpers';
5
+ import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
+ declare module './base-entity-records' {
7
+ namespace BaseEntityRecords {
8
+ interface Sidebar<C extends Context> {
9
+ /**
10
+ * ID of sidebar.
11
+ */
12
+ id: string;
13
+ /**
14
+ * Unique name identifying the sidebar.
15
+ */
16
+ name: string;
17
+ /**
18
+ * Description of sidebar.
19
+ */
20
+ description: string;
21
+ /**
22
+ * Extra CSS class to assign to the sidebar in the Widgets interface.
23
+ */
24
+ class: string;
25
+ /**
26
+ * HTML content to prepend to each widget's HTML output when assigned to this sidebar. Default is an opening list item element.
27
+ */
28
+ before_widget: string;
29
+ /**
30
+ * HTML content to append to each widget's HTML output when assigned to this sidebar. Default is a closing list item element.
31
+ */
32
+ after_widget: string;
33
+ /**
34
+ * HTML content to prepend to the sidebar title when displayed. Default is an opening h2 element.
35
+ */
36
+ before_title: string;
37
+ /**
38
+ * HTML content to append to the sidebar title when displayed. Default is a closing h2 element.
39
+ */
40
+ after_title: string;
41
+ /**
42
+ * Status of sidebar.
43
+ */
44
+ status: SidebarStatus;
45
+ /**
46
+ * Nested widgets.
47
+ */
48
+ widgets: (BaseEntityRecords.Widget<C> | string)[];
49
+ }
50
+ }
51
+ }
52
+ declare type SidebarStatus = 'active' | 'inactive';
53
+ export declare type Sidebar<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.Sidebar<C>>;
54
+ export {};
55
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/entity-types/sidebar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAiB,iBAAiB,CAAC;QAClC,UAAiB,OAAO,CAAE,CAAC,SAAS,OAAO;YAC1C;;eAEG;YACH,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,aAAa,EAAE,MAAM,CAAC;YACtB;;eAEG;YACH,YAAY,EAAE,MAAM,CAAC;YACrB;;eAEG;YACH,YAAY,EAAE,MAAM,CAAC;YACrB;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,MAAM,EAAE,aAAa,CAAC;YACtB;;eAEG;YACH,OAAO,EAAE,CAAE,iBAAiB,CAAC,MAAM,CAAE,CAAC,CAAE,GAAG,MAAM,CAAE,EAAE,CAAC;SACtD;KACD;CACD;AAED,aAAK,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE3C,oBAAY,OAAO,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAC7D,kBAAkB,CAAC,OAAO,CAAE,CAAC,CAAE,CAC/B,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { Context, ContextualField, OmitNevers } from './helpers';
5
+ import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
+ declare module './base-entity-records' {
7
+ namespace BaseEntityRecords {
8
+ interface Taxonomy<C extends Context> {
9
+ /**
10
+ * All capabilities used by the taxonomy.
11
+ */
12
+ capabilities: ContextualField<Record<string, string>, 'edit', C>;
13
+ /**
14
+ * A human-readable description of the taxonomy.
15
+ */
16
+ description: ContextualField<string, 'view' | 'edit', C>;
17
+ /**
18
+ * Whether or not the taxonomy should have children.
19
+ */
20
+ hierarchical: ContextualField<boolean, 'view' | 'edit', C>;
21
+ /**
22
+ * Human-readable labels for the taxonomy for various contexts.
23
+ */
24
+ labels: ContextualField<Record<string, string>, 'edit', C>;
25
+ /**
26
+ * The title for the taxonomy.
27
+ */
28
+ name: string;
29
+ /**
30
+ * An alphanumeric identifier for the taxonomy.
31
+ */
32
+ slug: string;
33
+ /**
34
+ * Whether or not the term cloud should be displayed.
35
+ */
36
+ show_cloud: ContextualField<boolean, 'edit', C>;
37
+ /**
38
+ * Types associated with the taxonomy.
39
+ */
40
+ types: ContextualField<string[], 'view' | 'edit', C>;
41
+ /**
42
+ * REST base route for the taxonomy.
43
+ */
44
+ rest_base: string;
45
+ /**
46
+ * REST namespace route for the taxonomy.
47
+ */
48
+ rest_namespace: string;
49
+ /**
50
+ * The visibility settings for the taxonomy.
51
+ */
52
+ visibility: TaxonomyVisibility;
53
+ }
54
+ interface TaxonomyVisibility {
55
+ /**
56
+ * Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.
57
+ */
58
+ public: boolean;
59
+ /**
60
+ * Whether the taxonomy is publicly queryable.
61
+ */
62
+ publicly_queryable: boolean;
63
+ /**
64
+ * Whether to generate a default UI for managing this taxonomy.
65
+ */
66
+ show_ui: boolean;
67
+ /**
68
+ * Whether to allow automatic creation of taxonomy columns on associated post-types table.
69
+ */
70
+ show_admin_column: boolean;
71
+ /**
72
+ * Whether to make the taxonomy available for selection in navigation menus.
73
+ */
74
+ show_in_nav_menus: boolean;
75
+ /**
76
+ * Whether to show the taxonomy in the quick/bulk edit panel.
77
+ */
78
+ show_in_quick_edit: boolean;
79
+ }
80
+ }
81
+ }
82
+ export declare type Taxonomy<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.Taxonomy<C>>;
83
+ //# sourceMappingURL=taxonomy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../src/entity-types/taxonomy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAiB,iBAAiB,CAAC;QAClC,UAAiB,QAAQ,CAAE,CAAC,SAAS,OAAO;YAC3C;;eAEG;YACH,YAAY,EAAE,eAAe,CAC5B,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,EACxB,MAAM,EACN,CAAC,CACD,CAAC;YACF;;eAEG;YACH,WAAW,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YAC3D;;eAEG;YACH,YAAY,EAAE,eAAe,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YAC7D;;eAEG;YACH,MAAM,EAAE,eAAe,CAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC/D;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,UAAU,EAAE,eAAe,CAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAClD;;eAEG;YACH,KAAK,EAAE,eAAe,CAAE,MAAM,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAE,CAAC;YACvD;;eAEG;YACH,SAAS,EAAE,MAAM,CAAC;YAClB;;eAEG;YACH,cAAc,EAAE,MAAM,CAAC;YACvB;;eAEG;YACH,UAAU,EAAE,kBAAkB,CAAC;SAC/B;QAED,UAAiB,kBAAkB;YAClC;;eAEG;YACH,MAAM,EAAE,OAAO,CAAC;YAChB;;eAEG;YACH,kBAAkB,EAAE,OAAO,CAAC;YAC5B;;eAEG;YACH,OAAO,EAAE,OAAO,CAAC;YACjB;;eAEG;YACH,iBAAiB,EAAE,OAAO,CAAC;YAC3B;;eAEG;YACH,iBAAiB,EAAE,OAAO,CAAC;YAC3B;;eAEG;YACH,kBAAkB,EAAE,OAAO,CAAC;SAC5B;KACD;CACD;AAED,oBAAY,QAAQ,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAC9D,kBAAkB,CAAC,QAAQ,CAAE,CAAC,CAAE,CAChC,CAAC"}
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { Context, PostFormat, RenderedText, OmitNevers } from './helpers';
5
+ import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
+ declare module './base-entity-records' {
7
+ namespace BaseEntityRecords {
8
+ interface Theme<C extends Context> {
9
+ /**
10
+ * The theme's stylesheet. This uniquely identifies the theme.
11
+ */
12
+ stylesheet: string;
13
+ /**
14
+ * The theme's template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme's stylesheet.
15
+ */
16
+ template: string;
17
+ /**
18
+ * The theme author.
19
+ */
20
+ author: RenderedText<'edit'>;
21
+ /**
22
+ * The website of the theme author.
23
+ */
24
+ author_uri: RenderedText<'edit'>;
25
+ /**
26
+ * A description of the theme.
27
+ */
28
+ description: RenderedText<'edit'>;
29
+ /**
30
+ * The name of the theme.
31
+ */
32
+ name: RenderedText<'edit'>;
33
+ /**
34
+ * The minimum PHP version required for the theme to work.
35
+ */
36
+ requires_php: string;
37
+ /**
38
+ * The minimum WordPress version required for the theme to work.
39
+ */
40
+ requires_wp: string;
41
+ /**
42
+ * The theme's screenshot URL.
43
+ */
44
+ screenshot: string;
45
+ /**
46
+ * Tags indicating styles and features of the theme.
47
+ */
48
+ tags: RenderedText<'edit'>;
49
+ /**
50
+ * The theme's text domain.
51
+ */
52
+ textdomain: string;
53
+ /**
54
+ * Features supported by this theme.
55
+ */
56
+ theme_supports: ThemeSupports;
57
+ /**
58
+ * The URI of the theme's webpage.
59
+ */
60
+ theme_uri: RenderedText<'edit'>;
61
+ /**
62
+ * The theme's current version.
63
+ */
64
+ version: string;
65
+ /**
66
+ * A named status for the theme.
67
+ */
68
+ status: ThemeStatus;
69
+ }
70
+ type ThemeStatus = 'active' | 'inactive';
71
+ interface ThemeSupports {
72
+ /**
73
+ * Whether theme opts in to wide alignment CSS class.
74
+ */
75
+ 'align-wide': boolean;
76
+ /**
77
+ * Whether appearanceTools are enabled in Global Styles.
78
+ */
79
+ 'appearance-tools': boolean;
80
+ /**
81
+ * Whether posts and comments RSS feed links are added to head.
82
+ */
83
+ 'automatic-feed-links': boolean;
84
+ /**
85
+ * Custom background if defined by the theme.
86
+ */
87
+ 'custom-background': boolean | CustomBackground;
88
+ /**
89
+ * Custom header if defined by the theme.
90
+ */
91
+ 'custom-header': boolean | CustomHeader;
92
+ /**
93
+ * Custom logo if defined by the theme.
94
+ */
95
+ 'custom-logo': boolean | CustomLogo;
96
+ /**
97
+ * Whether the theme enables Selective Refresh for Widgets being managed with the Customizer.
98
+ */
99
+ 'customize-selective-refresh-widgets': boolean;
100
+ /**
101
+ * Whether theme opts in to the dark editor style UI.
102
+ */
103
+ 'dark-editor-style': boolean;
104
+ /**
105
+ * Whether the theme disables custom colors.
106
+ */
107
+ 'disable-custom-colors': boolean;
108
+ /**
109
+ * Whether the theme disables custom font sizes.
110
+ */
111
+ 'disable-custom-font-sizes': boolean;
112
+ /**
113
+ * Whether the theme disables custom gradients.
114
+ */
115
+ 'disable-custom-gradients': boolean;
116
+ /**
117
+ * Custom color palette if defined by the theme.
118
+ */
119
+ 'editor-color-palette': boolean | Color[];
120
+ /**
121
+ * Custom font sizes if defined by the theme.
122
+ */
123
+ 'editor-font-sizes': boolean | FontSize[];
124
+ /**
125
+ * Custom gradient presets if defined by the theme.
126
+ */
127
+ 'editor-gradient-presets': boolean | GradientPreset[];
128
+ /**
129
+ * Whether theme opts in to the editor styles CSS wrapper.
130
+ */
131
+ 'editor-styles': boolean;
132
+ /**
133
+ * Allows use of HTML5 markup for search forms, comment forms, comment lists, gallery, and caption.
134
+ */
135
+ html5: boolean | Html5Option[];
136
+ /**
137
+ * Post formats supported.
138
+ */
139
+ formats: PostFormat[];
140
+ /**
141
+ * The post types that support thumbnails or true if all post types are supported.
142
+ */
143
+ 'post-thumbnails': boolean | string[];
144
+ /**
145
+ * Whether the theme supports responsive embedded content.
146
+ */
147
+ 'responsive-embeds': boolean;
148
+ /**
149
+ * Whether the theme can manage the document title tag.
150
+ */
151
+ 'title-tag': boolean;
152
+ /**
153
+ * Whether theme opts in to default WordPress block styles for viewing.
154
+ */
155
+ 'wp-block-styles': boolean;
156
+ }
157
+ interface CustomBackground {
158
+ 'default-image': string;
159
+ 'default-preset': 'default' | 'fill' | 'fit' | 'repeat' | 'custom';
160
+ 'default-position-x': 'left' | 'center' | 'right';
161
+ 'default-position-y': 'left' | 'center' | 'right';
162
+ 'default-size': 'auto' | 'contain' | 'cover';
163
+ 'default-repeat': 'repeat-x' | 'repeat-y' | 'repeat' | 'no-repeat';
164
+ 'default-attachment': 'scroll' | 'fixed';
165
+ 'default-color': string;
166
+ }
167
+ interface CustomHeader {
168
+ 'default-image': string;
169
+ 'random-default': boolean;
170
+ width: number;
171
+ height: number;
172
+ 'flex-height': boolean;
173
+ 'flex-width': boolean;
174
+ 'default-text-color': string;
175
+ 'header-text': boolean;
176
+ uploads: boolean;
177
+ video: boolean;
178
+ }
179
+ interface CustomLogo {
180
+ width: number;
181
+ height: number;
182
+ 'flex-width': boolean;
183
+ 'flex-height': boolean;
184
+ 'header-text': string[];
185
+ 'unlink-homepage-logo': boolean;
186
+ }
187
+ interface Color {
188
+ name: string;
189
+ slug: string;
190
+ color: string;
191
+ }
192
+ interface FontSize {
193
+ name: string;
194
+ size: number;
195
+ slug: string;
196
+ }
197
+ interface GradientPreset {
198
+ name: string;
199
+ gradient: string;
200
+ slug: string;
201
+ }
202
+ type Html5Option = 'search-form' | 'comment-form' | 'comment-list' | 'gallery' | 'caption' | 'script' | 'style';
203
+ }
204
+ }
205
+ export declare type Theme<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.Theme<C>>;
206
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/entity-types/theme.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/E,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAiB,iBAAiB,CAAC;QAClC,UAAiB,KAAK,CAAE,CAAC,SAAS,OAAO;YACxC;;eAEG;YACH,UAAU,EAAE,MAAM,CAAC;YACnB;;eAEG;YACH,QAAQ,EAAE,MAAM,CAAC;YACjB;;eAEG;YACH,MAAM,EAAE,YAAY,CAAE,MAAM,CAAE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AO,CAAC;YACvB,OAAO,EAAE,OAAO,CAAC;YACjB,KAAK,EAAE,OAAO,CAAC;SACf;QAED,UAAiB,UAAU;YAC1B,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,CAAC;YACf,YAAY,EAAE,OAAO,CAAC;YACtB,aAAa,EAAE,OAAO,CAAC;YACvB,aAAa,EAAE,MAAM,EAAE,CAAC;YACxB,sBAAsB,EAAE,OAAO,CAAC;SAChC;QAED,UAAiB,KAAK;YACrB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;SACd;QAED,UAAiB,QAAQ;YACxB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SACb;QAED,UAAiB,cAAc;YAC9B,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;YACjB,IAAI,EAAE,MAAM,CAAC;SACb;QAED,KAAY,WAAW,GACpB,aAAa,GACb,cAAc,GACd,cAAc,GACd,SAAS,GACT,SAAS,GACT,QAAQ,GACR,OAAO,CAAC;KACX;CACD;AAED,oBAAY,KAAK,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAC3D,kBAAkB,CAAC,KAAK,CAAE,CAAC,CAAE,CAC7B,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { Context, ContextualField, OmitNevers } from './helpers';
5
+ import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
+ declare module './base-entity-records' {
7
+ namespace BaseEntityRecords {
8
+ interface Type<C extends Context> {
9
+ /**
10
+ * All capabilities used by the post type.
11
+ */
12
+ capabilities: ContextualField<Record<string, string>, 'edit', C>;
13
+ /**
14
+ * A human-readable description of the post type.
15
+ */
16
+ description: ContextualField<string, 'view' | 'edit', C>;
17
+ /**
18
+ * Whether or not the post type should have children.
19
+ */
20
+ hierarchical: ContextualField<boolean, 'view' | 'edit', C>;
21
+ /**
22
+ * Whether or not the post type can be viewed.
23
+ */
24
+ viewable: ContextualField<boolean, 'edit', C>;
25
+ /**
26
+ * Human-readable labels for the post type for various contexts.
27
+ */
28
+ labels: ContextualField<Record<string, string>, 'edit', C>;
29
+ /**
30
+ * The title for the post type.
31
+ */
32
+ name: string;
33
+ /**
34
+ * An alphanumeric identifier for the post type.
35
+ */
36
+ slug: string;
37
+ /**
38
+ * All features, supported by the post type.
39
+ */
40
+ supports: ContextualField<Record<string, string>, 'edit', C>;
41
+ /**
42
+ * Taxonomies associated with post type.
43
+ */
44
+ taxonomies: ContextualField<string[], 'view' | 'edit', C>;
45
+ /**
46
+ * REST base route for the post type.
47
+ */
48
+ rest_base: string;
49
+ /**
50
+ * REST route's namespace for the post type.
51
+ */
52
+ rest_namespace: string;
53
+ /**
54
+ * The visibility settings for the post type.
55
+ */
56
+ visibility: ContextualField<TypeVisibility, 'edit', C>;
57
+ }
58
+ interface TypeVisibility {
59
+ /**
60
+ * Whether to generate a default UI for managing this post type.
61
+ */
62
+ show_ui: boolean;
63
+ /**
64
+ * Whether to make the post type is available for selection in navigation menus.
65
+ */
66
+ show_in_nav_menus: boolean;
67
+ }
68
+ }
69
+ }
70
+ export declare type Type<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.Type<C>>;
71
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/entity-types/type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAiB,iBAAiB,CAAC;QAClC,UAAiB,IAAI,CAAE,CAAC,SA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