@wordpress/core-data 4.1.0 → 4.1.2

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 (158) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +9 -3
  3. package/build/actions.js +1 -1
  4. package/build/actions.js.map +1 -1
  5. package/build/hooks/constants.js +18 -0
  6. package/build/hooks/constants.js.map +1 -0
  7. package/build/hooks/memoize.js +18 -0
  8. package/build/hooks/memoize.js.map +1 -0
  9. package/build/hooks/use-entity-record.js +60 -0
  10. package/build/hooks/use-entity-record.js.map +1 -0
  11. package/build/hooks/use-entity-records.js +67 -0
  12. package/build/hooks/use-entity-records.js.map +1 -0
  13. package/build/hooks/use-query-select.js +130 -0
  14. package/build/hooks/use-query-select.js.map +1 -0
  15. package/build/index.js +34 -3
  16. package/build/index.js.map +1 -1
  17. package/build/resolvers.js +2 -17
  18. package/build/resolvers.js.map +1 -1
  19. package/build/types/attachment.js +6 -0
  20. package/build/types/attachment.js.map +1 -0
  21. package/build/types/base-entity-types.js +47 -0
  22. package/build/types/base-entity-types.js.map +1 -0
  23. package/build/types/comment.js +6 -0
  24. package/build/types/comment.js.map +1 -0
  25. package/build/types/helpers.js +6 -0
  26. package/build/types/helpers.js.map +1 -0
  27. package/build/types/index.js +6 -0
  28. package/build/types/index.js.map +1 -0
  29. package/build/types/menu-location.js +6 -0
  30. package/build/types/menu-location.js.map +1 -0
  31. package/build/types/nav-menu-item.js +6 -0
  32. package/build/types/nav-menu-item.js.map +1 -0
  33. package/build/types/nav-menu.js +6 -0
  34. package/build/types/nav-menu.js.map +1 -0
  35. package/build/types/navigation-area.js +6 -0
  36. package/build/types/navigation-area.js.map +1 -0
  37. package/build/types/page.js +6 -0
  38. package/build/types/page.js.map +1 -0
  39. package/build/types/plugin.js +6 -0
  40. package/build/types/plugin.js.map +1 -0
  41. package/build/types/post.js +6 -0
  42. package/build/types/post.js.map +1 -0
  43. package/build/types/settings.js +6 -0
  44. package/build/types/settings.js.map +1 -0
  45. package/build/types/sidebar.js +6 -0
  46. package/build/types/sidebar.js.map +1 -0
  47. package/build/types/taxonomy.js +6 -0
  48. package/build/types/taxonomy.js.map +1 -0
  49. package/build/types/theme.js +6 -0
  50. package/build/types/theme.js.map +1 -0
  51. package/build/types/type.js +6 -0
  52. package/build/types/type.js.map +1 -0
  53. package/build/types/user.js +6 -0
  54. package/build/types/user.js.map +1 -0
  55. package/build/types/widget-type.js +6 -0
  56. package/build/types/widget-type.js.map +1 -0
  57. package/build/types/widget.js +6 -0
  58. package/build/types/widget.js.map +1 -0
  59. package/build/types/wp-template-part.js +6 -0
  60. package/build/types/wp-template-part.js.map +1 -0
  61. package/build/types/wp-template.js +6 -0
  62. package/build/types/wp-template.js.map +1 -0
  63. package/build-module/actions.js +1 -1
  64. package/build-module/actions.js.map +1 -1
  65. package/build-module/hooks/constants.js +10 -0
  66. package/build-module/hooks/constants.js.map +1 -0
  67. package/build-module/hooks/memoize.js +7 -0
  68. package/build-module/hooks/memoize.js.map +1 -0
  69. package/build-module/hooks/use-entity-record.js +49 -0
  70. package/build-module/hooks/use-entity-record.js.map +1 -0
  71. package/build-module/hooks/use-entity-records.js +56 -0
  72. package/build-module/hooks/use-entity-records.js.map +1 -0
  73. package/build-module/hooks/use-query-select.js +116 -0
  74. package/build-module/hooks/use-query-select.js.map +1 -0
  75. package/build-module/index.js +4 -2
  76. package/build-module/index.js.map +1 -1
  77. package/build-module/resolvers.js +3 -18
  78. package/build-module/resolvers.js.map +1 -1
  79. package/build-module/types/attachment.js +2 -0
  80. package/build-module/types/attachment.js.map +1 -0
  81. package/build-module/types/base-entity-types.js +39 -0
  82. package/build-module/types/base-entity-types.js.map +1 -0
  83. package/build-module/types/comment.js +2 -0
  84. package/build-module/types/comment.js.map +1 -0
  85. package/build-module/types/helpers.js +2 -0
  86. package/build-module/types/helpers.js.map +1 -0
  87. package/build-module/types/index.js +2 -0
  88. package/build-module/types/index.js.map +1 -0
  89. package/build-module/types/menu-location.js +2 -0
  90. package/build-module/types/menu-location.js.map +1 -0
  91. package/build-module/types/nav-menu-item.js +2 -0
  92. package/build-module/types/nav-menu-item.js.map +1 -0
  93. package/build-module/types/nav-menu.js +2 -0
  94. package/build-module/types/nav-menu.js.map +1 -0
  95. package/build-module/types/navigation-area.js +2 -0
  96. package/build-module/types/navigation-area.js.map +1 -0
  97. package/build-module/types/page.js +2 -0
  98. package/build-module/types/page.js.map +1 -0
  99. package/build-module/types/plugin.js +2 -0
  100. package/build-module/types/plugin.js.map +1 -0
  101. package/build-module/types/post.js +2 -0
  102. package/build-module/types/post.js.map +1 -0
  103. package/build-module/types/settings.js +2 -0
  104. package/build-module/types/settings.js.map +1 -0
  105. package/build-module/types/sidebar.js +2 -0
  106. package/build-module/types/sidebar.js.map +1 -0
  107. package/build-module/types/taxonomy.js +2 -0
  108. package/build-module/types/taxonomy.js.map +1 -0
  109. package/build-module/types/theme.js +2 -0
  110. package/build-module/types/theme.js.map +1 -0
  111. package/build-module/types/type.js +2 -0
  112. package/build-module/types/type.js.map +1 -0
  113. package/build-module/types/user.js +2 -0
  114. package/build-module/types/user.js.map +1 -0
  115. package/build-module/types/widget-type.js +2 -0
  116. package/build-module/types/widget-type.js.map +1 -0
  117. package/build-module/types/widget.js +2 -0
  118. package/build-module/types/widget.js.map +1 -0
  119. package/build-module/types/wp-template-part.js +2 -0
  120. package/build-module/types/wp-template-part.js.map +1 -0
  121. package/build-module/types/wp-template.js +2 -0
  122. package/build-module/types/wp-template.js.map +1 -0
  123. package/package.json +12 -11
  124. package/src/actions.js +1 -1
  125. package/src/hooks/constants.ts +7 -0
  126. package/src/hooks/memoize.js +7 -0
  127. package/src/hooks/test/use-entity-record.js +74 -0
  128. package/src/hooks/test/use-entity-records.js +78 -0
  129. package/src/hooks/test/use-query-select.js +194 -0
  130. package/src/hooks/use-entity-record.ts +72 -0
  131. package/src/hooks/use-entity-records.ts +79 -0
  132. package/src/hooks/use-query-select.ts +131 -0
  133. package/src/index.js +3 -1
  134. package/src/resolvers.js +3 -17
  135. package/src/test/resolvers.js +4 -10
  136. package/src/types/README.md +193 -0
  137. package/src/types/attachment.ts +146 -0
  138. package/src/types/base-entity-types.ts +36 -0
  139. package/src/types/comment.ts +96 -0
  140. package/src/types/helpers.ts +153 -0
  141. package/src/types/index.ts +72 -0
  142. package/src/types/menu-location.ts +29 -0
  143. package/src/types/nav-menu-item.ts +106 -0
  144. package/src/types/nav-menu.ts +53 -0
  145. package/src/types/navigation-area.ts +29 -0
  146. package/src/types/page.ts +144 -0
  147. package/src/types/plugin.ts +74 -0
  148. package/src/types/post.ts +153 -0
  149. package/src/types/settings.ts +93 -0
  150. package/src/types/sidebar.ts +60 -0
  151. package/src/types/taxonomy.ts +92 -0
  152. package/src/types/theme.ts +222 -0
  153. package/src/types/type.ts +80 -0
  154. package/src/types/user.ts +109 -0
  155. package/src/types/widget-type.ts +37 -0
  156. package/src/types/widget.ts +64 -0
  157. package/src/types/wp-template-part.ts +94 -0
  158. package/src/types/wp-template.ts +94 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { Context, OmitNevers } from './helpers';
5
+
6
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
7
+
8
+ declare module './base-entity-types' {
9
+ export namespace BaseEntityTypes {
10
+ export interface MenuLocation< C extends Context > {
11
+ /**
12
+ * The name of the menu location.
13
+ */
14
+ name: string;
15
+ /**
16
+ * The description of the menu location.
17
+ */
18
+ description: string;
19
+ /**
20
+ * The ID of the assigned menu.
21
+ */
22
+ menu: number;
23
+ }
24
+ }
25
+ }
26
+
27
+ export type MenuLocation< C extends Context > = OmitNevers<
28
+ _BaseEntityTypes.MenuLocation< C >
29
+ >;
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { RenderedText, Context, ContextualField, OmitNevers } from './helpers';
5
+
6
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
7
+
8
+ export type NavMenuItemType =
9
+ | 'taxonomy'
10
+ | 'post_type'
11
+ | 'post_type_archive'
12
+ | 'custom';
13
+ export type NavMenuItemStatus =
14
+ | 'publish'
15
+ | 'future'
16
+ | 'draft'
17
+ | 'pending'
18
+ | 'private';
19
+ export type Target = '_blank' | '';
20
+
21
+ declare module './base-entity-types' {
22
+ export namespace BaseEntityTypes {
23
+ export interface NavMenuItem< C extends Context > {
24
+ /**
25
+ * The title for the object.
26
+ */
27
+ title: RenderedText< C >;
28
+ /**
29
+ * Unique identifier for the object.
30
+ */
31
+ id: number;
32
+ /**
33
+ * The singular label used to describe this type of menu item.
34
+ */
35
+ type_label: string;
36
+ /**
37
+ * The family of objects originally represented, such as "post_type" or "taxonomy".
38
+ */
39
+ type: NavMenuItemType;
40
+ /**
41
+ * A named status for the object.
42
+ */
43
+ status: NavMenuItemStatus;
44
+ /**
45
+ * The ID for the parent of the object.
46
+ */
47
+ parent: number;
48
+ /**
49
+ * Text for the title attribute of the link element for this menu item.
50
+ */
51
+ attr_title: string;
52
+ /**
53
+ * Class names for the link element of this menu item.
54
+ */
55
+ classes: string[];
56
+ /**
57
+ * The description of this menu item.
58
+ */
59
+ description: string;
60
+ /**
61
+ * The DB ID of the nav_menu_item that is this item's menu parent, if any, otherwise 0.
62
+ */
63
+ menu_order: number;
64
+ /**
65
+ * The type of object originally represented, such as "category", "post", or "attachment".
66
+ */
67
+ object: string;
68
+ /**
69
+ * The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.
70
+ */
71
+ object_id: number;
72
+ /**
73
+ * The target attribute of the link element for this menu item.
74
+ */
75
+ target: Target;
76
+ /**
77
+ * The URL to which this menu item points.
78
+ */
79
+ url: string;
80
+ /**
81
+ * The XFN relationship expressed in the link of this menu item.
82
+ */
83
+ xfn: string[];
84
+ /**
85
+ * Whether the menu item represents an object that no longer exists.
86
+ */
87
+ invalid: boolean;
88
+ /**
89
+ * The terms assigned to the object in the nav_menu taxonomy.
90
+ */
91
+ menus: ContextualField< number, 'view' | 'edit', C >;
92
+ /**
93
+ * Meta fields.
94
+ */
95
+ meta: ContextualField<
96
+ Record< string, string >,
97
+ 'view' | 'edit',
98
+ C
99
+ >;
100
+ }
101
+ }
102
+ }
103
+
104
+ export type NavMenuItem< C extends Context > = OmitNevers<
105
+ _BaseEntityTypes.NavMenuItem< C >
106
+ >;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { Context, ContextualField, OmitNevers } from './helpers';
5
+
6
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
7
+
8
+ declare module './base-entity-types' {
9
+ export namespace BaseEntityTypes {
10
+ export interface NavMenu< C extends Context > {
11
+ /**
12
+ * Unique identifier for the term.
13
+ */
14
+ id: number;
15
+ /**
16
+ * HTML description of the term.
17
+ */
18
+ description: ContextualField< string, 'view' | 'edit', C >;
19
+ /**
20
+ * HTML title for the term.
21
+ */
22
+ name: string;
23
+ /**
24
+ * An alphanumeric identifier for the term unique to its type.
25
+ */
26
+ slug: string;
27
+ /**
28
+ * Meta fields.
29
+ */
30
+ meta: ContextualField<
31
+ Record< string, string >,
32
+ 'view' | 'edit',
33
+ C
34
+ >;
35
+ /**
36
+ * The locations assigned to the menu.
37
+ */
38
+ locations: ContextualField< string[], 'view' | 'edit', C >;
39
+ /**
40
+ * The DB ID of the original object this menu item represents, e . g . ID for posts and term_id for categories.
41
+ */
42
+ object_id: number;
43
+ /**
44
+ * Whether to automatically add top level pages to this menu.
45
+ */
46
+ auto_add: ContextualField< boolean, 'view' | 'edit', C >;
47
+ }
48
+ }
49
+ }
50
+
51
+ export type NavMenu< C extends Context > = OmitNevers<
52
+ _BaseEntityTypes.NavMenu< C >
53
+ >;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { Context, OmitNevers } from './helpers';
5
+
6
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
7
+
8
+ declare module './base-entity-types' {
9
+ export namespace BaseEntityTypes {
10
+ export interface NavigationArea< C extends Context > {
11
+ /**
12
+ * The name of the navigation area.
13
+ */
14
+ name: string;
15
+ /**
16
+ * The description of the navigation area.
17
+ */
18
+ description: string;
19
+ /**
20
+ * The ID of the assigned navigation.
21
+ */
22
+ navigation: number;
23
+ }
24
+ }
25
+ }
26
+
27
+ export type NavigationArea< C extends Context > = OmitNevers<
28
+ _BaseEntityTypes.NavigationArea< C >
29
+ >;
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import {
5
+ CommentingStatus,
6
+ Context,
7
+ ContextualField,
8
+ PingStatus,
9
+ PostStatus,
10
+ RenderedText,
11
+ OmitNevers,
12
+ } from './helpers';
13
+
14
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
15
+
16
+ declare module './base-entity-types' {
17
+ export namespace BaseEntityTypes {
18
+ export interface Page< C extends Context > {
19
+ /**
20
+ * The date the post was published, in the site's timezone.
21
+ */
22
+ date: string | null;
23
+ /**
24
+ * The date the post was published, as GMT.
25
+ */
26
+ date_gmt: ContextualField< string | null, 'view' | 'edit', C >;
27
+ /**
28
+ * The globally unique identifier for the post.
29
+ */
30
+ guid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;
31
+ /**
32
+ * Unique identifier for the post.
33
+ */
34
+ id: number;
35
+ /**
36
+ * URL to the post.
37
+ */
38
+ link: string;
39
+ /**
40
+ * The date the post was last modified, in the site's timezone.
41
+ */
42
+ modified: ContextualField< string, 'view' | 'edit', C >;
43
+ /**
44
+ * The date the post was last modified, as GMT.
45
+ */
46
+ modified_gmt: ContextualField< string, 'view' | 'edit', C >;
47
+ /**
48
+ * An alphanumeric identifier for the post unique to its type.
49
+ */
50
+ slug: string;
51
+ /**
52
+ * A named status for the post.
53
+ */
54
+ status: ContextualField< PostStatus, 'view' | 'edit', C >;
55
+ /**
56
+ * Type of post.
57
+ */
58
+ type: string;
59
+ /**
60
+ * A password to protect access to the content and excerpt.
61
+ */
62
+ password: ContextualField< string, 'edit', C >;
63
+ /**
64
+ * Permalink template for the post.
65
+ */
66
+ permalink_template: ContextualField< string, 'edit', C >;
67
+ /**
68
+ * Slug automatically generated from the post title.
69
+ */
70
+ generated_slug: ContextualField< string, 'edit', C >;
71
+ /**
72
+ * The ID for the parent of the post.
73
+ */
74
+ parent: ContextualField< number, 'view' | 'edit', C >;
75
+ /**
76
+ * The title for the post.
77
+ */
78
+ title: RenderedText< C >;
79
+ /**
80
+ * The content for the post.
81
+ */
82
+ content: ContextualField<
83
+ RenderedText< C > & {
84
+ /**
85
+ * Whether the content is protected with a password.
86
+ */
87
+ is_protected: boolean;
88
+ /**
89
+ * Version of the content block format used by the page.
90
+ */
91
+ block_version: ContextualField< string, 'edit', C >;
92
+ },
93
+ 'view' | 'edit',
94
+ C
95
+ >;
96
+ /**
97
+ * The ID for the author of the post.
98
+ */
99
+ author: number;
100
+ /**
101
+ * The excerpt for the post.
102
+ */
103
+ excerpt: RenderedText< C > & {
104
+ protected: boolean;
105
+ };
106
+ /**
107
+ * The ID of the featured media for the post.
108
+ */
109
+ featured_media: number;
110
+ /**
111
+ * Whether or not comments are open on the post.
112
+ */
113
+ comment_status: ContextualField<
114
+ CommentingStatus,
115
+ 'view' | 'edit',
116
+ C
117
+ >;
118
+ /**
119
+ * Whether or not the post can be pinged.
120
+ */
121
+ ping_status: ContextualField< PingStatus, 'view' | 'edit', C >;
122
+ /**
123
+ * The order of the post in relation to other posts.
124
+ */
125
+ menu_order: ContextualField< number, 'view' | 'edit', C >;
126
+ /**
127
+ * Meta fields.
128
+ */
129
+ meta: ContextualField<
130
+ Record< string, string >,
131
+ 'view' | 'edit',
132
+ C
133
+ >;
134
+ /**
135
+ * The theme file to use to display the post.
136
+ */
137
+ template: ContextualField< string, 'view' | 'edit', C >;
138
+ }
139
+ }
140
+ }
141
+
142
+ export type Page< C extends Context > = OmitNevers<
143
+ _BaseEntityTypes.Page< C >
144
+ >;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { Context, ContextualField, RenderedText, OmitNevers } from './helpers';
5
+
6
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
7
+
8
+ declare module './base-entity-types' {
9
+ export namespace BaseEntityTypes {
10
+ export interface Plugin< C extends Context > {
11
+ /**
12
+ * The plugin file.
13
+ */
14
+ plugin: string;
15
+ /**
16
+ * The plugin activation status.
17
+ */
18
+ status: PluginStatus;
19
+ /**
20
+ * The plugin name.
21
+ */
22
+ name: string;
23
+ /**
24
+ * The plugin's website address.
25
+ */
26
+ plugin_uri: ContextualField< string, 'view' | 'edit', C >;
27
+ /**
28
+ * The plugin author.
29
+ */
30
+ author: ContextualField<
31
+ Record< string, string >,
32
+ 'view' | 'edit',
33
+ C
34
+ >;
35
+ /**
36
+ * Plugin author's website address.
37
+ */
38
+ author_uri: ContextualField< string, 'view' | 'edit', C >;
39
+ /**
40
+ * The plugin description.
41
+ */
42
+ description: ContextualField<
43
+ RenderedText< 'edit' >,
44
+ 'view' | 'edit',
45
+ C
46
+ >;
47
+ /**
48
+ * The plugin version number.
49
+ */
50
+ version: ContextualField< string, 'view' | 'edit', C >;
51
+ /**
52
+ * Whether the plugin can only be activated network-wide.
53
+ */
54
+ network_only: boolean;
55
+ /**
56
+ * Minimum required version of WordPress.
57
+ */
58
+ requires_wp: string;
59
+ /**
60
+ * Minimum required version of PHP.
61
+ */
62
+ requires_php: string;
63
+ /**
64
+ * The plugin's text domain.
65
+ */
66
+ textdomain: ContextualField< string, 'view' | 'edit', C >;
67
+ }
68
+ }
69
+ }
70
+
71
+ export type PluginStatus = 'active' | 'inactive';
72
+ export type Plugin< C extends Context > = OmitNevers<
73
+ _BaseEntityTypes.Plugin< C >
74
+ >;
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import {
5
+ CommentingStatus,
6
+ Context,
7
+ ContextualField,
8
+ PingStatus,
9
+ PostFormat,
10
+ PostStatus,
11
+ RenderedText,
12
+ OmitNevers,
13
+ } from './helpers';
14
+
15
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
16
+
17
+ declare module './base-entity-types' {
18
+ export namespace BaseEntityTypes {
19
+ export interface Post< C extends Context > {
20
+ /**
21
+ * The date the post was published, in the site's timezone.
22
+ */
23
+ date: string | null;
24
+ /**
25
+ * The date the post was published, as GMT.
26
+ */
27
+ date_gmt: ContextualField< string | null, 'view' | 'edit', C >;
28
+ /**
29
+ * The globally unique identifier for the post.
30
+ */
31
+ guid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;
32
+ /**
33
+ * Unique identifier for the post.
34
+ */
35
+ id: number;
36
+ /**
37
+ * URL to the post.
38
+ */
39
+ link: string;
40
+ /**
41
+ * The date the post was last modified, in the site's timezone.
42
+ */
43
+ modified: ContextualField< string, 'view' | 'edit', C >;
44
+ /**
45
+ * The date the post was last modified, as GMT.
46
+ */
47
+ modified_gmt: ContextualField< string, 'view' | 'edit', C >;
48
+ /**
49
+ * An alphanumeric identifier for the post unique to its type.
50
+ */
51
+ slug: string;
52
+ /**
53
+ * A named status for the post.
54
+ */
55
+ status: ContextualField< PostStatus, 'view' | 'edit', C >;
56
+ /**
57
+ * Type of post.
58
+ */
59
+ type: string;
60
+ /**
61
+ * A password to protect access to the content and excerpt.
62
+ */
63
+ password: ContextualField< string, 'edit', C >;
64
+ /**
65
+ * Permalink template for the post.
66
+ */
67
+ permalink_template: ContextualField< string, 'edit', C >;
68
+ /**
69
+ * Slug automatically generated from the post title.
70
+ */
71
+ generated_slug: ContextualField< string, 'edit', C >;
72
+ /**
73
+ * The title for the post.
74
+ */
75
+ title: RenderedText< C >;
76
+ /**
77
+ * The content for the post.
78
+ */
79
+ content: ContextualField<
80
+ RenderedText< C > & {
81
+ /**
82
+ * Whether the content is protected with a password.
83
+ */
84
+ is_protected: boolean;
85
+ /**
86
+ * Version of the content block format used by the page.
87
+ */
88
+ block_version: ContextualField< string, 'edit', C >;
89
+ },
90
+ 'view' | 'edit',
91
+ C
92
+ >;
93
+ /**
94
+ * The ID for the author of the post.
95
+ */
96
+ author: number;
97
+ /**
98
+ * The excerpt for the post.
99
+ */
100
+ excerpt: RenderedText< C > & {
101
+ protected: boolean;
102
+ };
103
+ /**
104
+ * The ID of the featured media for the post.
105
+ */
106
+ featured_media: number;
107
+ /**
108
+ * Whether or not comments are open on the post.
109
+ */
110
+ comment_status: ContextualField<
111
+ CommentingStatus,
112
+ 'view' | 'edit',
113
+ C
114
+ >;
115
+ /**
116
+ * Whether or not the post can be pinged.
117
+ */
118
+ ping_status: ContextualField< PingStatus, 'view' | 'edit', C >;
119
+ /**
120
+ * The format for the post.
121
+ */
122
+ format: ContextualField< PostFormat, 'view' | 'edit', C >;
123
+ /**
124
+ * Meta fields.
125
+ */
126
+ meta: ContextualField<
127
+ Record< string, string >,
128
+ 'view' | 'edit',
129
+ C
130
+ >;
131
+ /**
132
+ * Whether or not the post should be treated as sticky.
133
+ */
134
+ sticky: ContextualField< boolean, 'view' | 'edit', C >;
135
+ /**
136
+ * The theme file to use to display the post.
137
+ */
138
+ template: ContextualField< string, 'view' | 'edit', C >;
139
+ /**
140
+ * The terms assigned to the post in the category taxonomy.
141
+ */
142
+ categories: ContextualField< number[], 'view' | 'edit', C >;
143
+ /**
144
+ * The terms assigned to the post in the post_tag taxonomy.
145
+ */
146
+ tags: ContextualField< number[], 'view' | 'edit', C >;
147
+ }
148
+ }
149
+ }
150
+
151
+ export type Post< C extends Context > = OmitNevers<
152
+ _BaseEntityTypes.Post< C >
153
+ >;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { CommentingStatus, Context, OmitNevers, PingStatus } from './helpers';
5
+
6
+ import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
7
+
8
+ declare module './base-entity-types' {
9
+ export namespace BaseEntityTypes {
10
+ export interface Settings< C extends Context > {
11
+ /**
12
+ * What to show on the front page
13
+ */
14
+ show_on_front: string;
15
+ /**
16
+ * The ID of the page that should be displayed on the front page
17
+ */
18
+ page_on_front: number;
19
+ /**
20
+ * Site title.
21
+ */
22
+ title: string;
23
+ /**
24
+ * Site tagline.
25
+ */
26
+ description: string;
27
+ /**
28
+ * Site URL.
29
+ */
30
+ url: string;
31
+ /**
32
+ * This address is used for admin purposes, like new user notification.
33
+ */
34
+ email: string;
35
+ /**
36
+ * A city in the same timezone as you.
37
+ */
38
+ timezone: string;
39
+ /**
40
+ * A date format for all date strings.
41
+ */
42
+ date_format: string;
43
+ /**
44
+ * A time format for all time strings.
45
+ */
46
+ time_format: string;
47
+ /**
48
+ * A day number of the week that the week should start on.
49
+ */
50
+ start_of_week: number;
51
+ /**
52
+ * WordPress locale code.
53
+ */
54
+ language: string;
55
+ /**
56
+ * Convert emoticons like :-) and :-P to graphics on display.
57
+ */
58
+ use_smilies: boolean;
59
+ /**
60
+ * Default post category.
61
+ */
62
+ default_category: number;
63
+ /**
64
+ * Default post format.
65
+ */
66
+ default_post_format: string;
67
+ /**
68
+ * Blog pages show at most.
69
+ */
70
+ posts_per_page: number;
71
+ /**
72
+ * Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.
73
+ */
74
+ default_ping_status: PingStatus;
75
+ /**
76
+ * Allow people to submit comments on new posts.
77
+ */
78
+ default_comment_status: CommentingStatus;
79
+ /**
80
+ * Site logo.
81
+ */
82
+ site_logo: number;
83
+ /**
84
+ * Site icon.
85
+ */
86
+ site_icon: number;
87
+ }
88
+ }
89
+ }
90
+
91
+ export type Settings< C extends Context > = OmitNevers<
92
+ _BaseEntityTypes.Settings< C >
93
+ >;