@wordpress/core-data 4.1.1 → 4.2.0-next.e230fbab09.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/CHANGELOG.md +6 -0
- package/README.md +2 -10
- package/build/actions.js +9 -13
- package/build/actions.js.map +1 -1
- package/build/batch/create-batch.js +17 -12
- package/build/batch/create-batch.js.map +1 -1
- package/build/entities.js +1 -1
- package/build/entities.js.map +1 -1
- package/build/entity-types/attachment.js +6 -0
- package/build/entity-types/attachment.js.map +1 -0
- package/build/entity-types/base-entity-types.js +47 -0
- package/build/entity-types/base-entity-types.js.map +1 -0
- package/build/entity-types/comment.js +6 -0
- package/build/entity-types/comment.js.map +1 -0
- package/build/entity-types/helpers.js +6 -0
- package/build/entity-types/helpers.js.map +1 -0
- package/build/entity-types/index.js +6 -0
- package/build/entity-types/index.js.map +1 -0
- package/build/entity-types/menu-location.js +6 -0
- package/build/entity-types/menu-location.js.map +1 -0
- package/build/entity-types/nav-menu-item.js +6 -0
- package/build/entity-types/nav-menu-item.js.map +1 -0
- package/build/entity-types/nav-menu.js +6 -0
- package/build/entity-types/nav-menu.js.map +1 -0
- package/build/entity-types/navigation-area.js +6 -0
- package/build/entity-types/navigation-area.js.map +1 -0
- package/build/entity-types/page.js +6 -0
- package/build/entity-types/page.js.map +1 -0
- package/build/entity-types/plugin.js +6 -0
- package/build/entity-types/plugin.js.map +1 -0
- package/build/entity-types/post.js +6 -0
- package/build/entity-types/post.js.map +1 -0
- package/build/entity-types/settings.js +6 -0
- package/build/entity-types/settings.js.map +1 -0
- package/build/entity-types/sidebar.js +6 -0
- package/build/entity-types/sidebar.js.map +1 -0
- package/build/entity-types/taxonomy.js +6 -0
- package/build/entity-types/taxonomy.js.map +1 -0
- package/build/entity-types/theme.js +6 -0
- package/build/entity-types/theme.js.map +1 -0
- package/build/entity-types/type.js +6 -0
- package/build/entity-types/type.js.map +1 -0
- package/build/entity-types/user.js +6 -0
- package/build/entity-types/user.js.map +1 -0
- package/build/entity-types/widget-type.js +6 -0
- package/build/entity-types/widget-type.js.map +1 -0
- package/build/entity-types/widget.js +6 -0
- package/build/entity-types/widget.js.map +1 -0
- package/build/entity-types/wp-template-part.js +6 -0
- package/build/entity-types/wp-template-part.js.map +1 -0
- package/build/entity-types/wp-template.js +6 -0
- package/build/entity-types/wp-template.js.map +1 -0
- package/build/fetch/__experimental-fetch-link-suggestions.js +2 -2
- package/build/fetch/__experimental-fetch-link-suggestions.js.map +1 -1
- package/build/hooks/constants.js +18 -0
- package/build/hooks/constants.js.map +1 -0
- package/build/hooks/memoize.js +18 -0
- package/build/hooks/memoize.js.map +1 -0
- package/build/hooks/use-entity-record.js +60 -0
- package/build/hooks/use-entity-record.js.map +1 -0
- package/build/hooks/use-entity-records.js +77 -0
- package/build/hooks/use-entity-records.js.map +1 -0
- package/build/hooks/use-query-select.js +130 -0
- package/build/hooks/use-query-select.js.map +1 -0
- package/build/index.js +34 -3
- package/build/index.js.map +1 -1
- package/build/reducer.js +1 -1
- package/build/reducer.js.map +1 -1
- package/build/resolvers.js +7 -17
- package/build/resolvers.js.map +1 -1
- package/build-module/actions.js +9 -13
- package/build-module/actions.js.map +1 -1
- package/build-module/batch/create-batch.js +17 -12
- package/build-module/batch/create-batch.js.map +1 -1
- package/build-module/entities.js +1 -1
- package/build-module/entities.js.map +1 -1
- package/build-module/entity-types/attachment.js +2 -0
- package/build-module/entity-types/attachment.js.map +1 -0
- package/build-module/entity-types/base-entity-types.js +39 -0
- package/build-module/entity-types/base-entity-types.js.map +1 -0
- package/build-module/entity-types/comment.js +2 -0
- package/build-module/entity-types/comment.js.map +1 -0
- package/build-module/entity-types/helpers.js +2 -0
- package/build-module/entity-types/helpers.js.map +1 -0
- package/build-module/entity-types/index.js +2 -0
- package/build-module/entity-types/index.js.map +1 -0
- package/build-module/entity-types/menu-location.js +2 -0
- package/build-module/entity-types/menu-location.js.map +1 -0
- package/build-module/entity-types/nav-menu-item.js +2 -0
- package/build-module/entity-types/nav-menu-item.js.map +1 -0
- package/build-module/entity-types/nav-menu.js +2 -0
- package/build-module/entity-types/nav-menu.js.map +1 -0
- package/build-module/entity-types/navigation-area.js +2 -0
- package/build-module/entity-types/navigation-area.js.map +1 -0
- package/build-module/entity-types/page.js +2 -0
- package/build-module/entity-types/page.js.map +1 -0
- package/build-module/entity-types/plugin.js +2 -0
- package/build-module/entity-types/plugin.js.map +1 -0
- package/build-module/entity-types/post.js +2 -0
- package/build-module/entity-types/post.js.map +1 -0
- package/build-module/entity-types/settings.js +2 -0
- package/build-module/entity-types/settings.js.map +1 -0
- package/build-module/entity-types/sidebar.js +2 -0
- package/build-module/entity-types/sidebar.js.map +1 -0
- package/build-module/entity-types/taxonomy.js +2 -0
- package/build-module/entity-types/taxonomy.js.map +1 -0
- package/build-module/entity-types/theme.js +2 -0
- package/build-module/entity-types/theme.js.map +1 -0
- package/build-module/entity-types/type.js +2 -0
- package/build-module/entity-types/type.js.map +1 -0
- package/build-module/entity-types/user.js +2 -0
- package/build-module/entity-types/user.js.map +1 -0
- package/build-module/entity-types/widget-type.js +2 -0
- package/build-module/entity-types/widget-type.js.map +1 -0
- package/build-module/entity-types/widget.js +2 -0
- package/build-module/entity-types/widget.js.map +1 -0
- package/build-module/entity-types/wp-template-part.js +2 -0
- package/build-module/entity-types/wp-template-part.js.map +1 -0
- package/build-module/entity-types/wp-template.js +2 -0
- package/build-module/entity-types/wp-template.js.map +1 -0
- package/build-module/fetch/__experimental-fetch-link-suggestions.js +2 -2
- package/build-module/fetch/__experimental-fetch-link-suggestions.js.map +1 -1
- package/build-module/hooks/constants.js +10 -0
- package/build-module/hooks/constants.js.map +1 -0
- package/build-module/hooks/memoize.js +7 -0
- package/build-module/hooks/memoize.js.map +1 -0
- package/build-module/hooks/use-entity-record.js +49 -0
- package/build-module/hooks/use-entity-record.js.map +1 -0
- package/build-module/hooks/use-entity-records.js +65 -0
- package/build-module/hooks/use-entity-records.js.map +1 -0
- package/build-module/hooks/use-query-select.js +116 -0
- package/build-module/hooks/use-query-select.js.map +1 -0
- package/build-module/index.js +4 -2
- package/build-module/index.js.map +1 -1
- package/build-module/reducer.js +1 -1
- package/build-module/reducer.js.map +1 -1
- package/build-module/resolvers.js +8 -18
- package/build-module/resolvers.js.map +1 -1
- package/package.json +15 -11
- package/src/actions.js +9 -13
- package/src/batch/create-batch.js +16 -12
- package/src/entities.js +1 -1
- package/src/entity-types/README.md +193 -0
- package/src/entity-types/attachment.ts +146 -0
- package/src/entity-types/base-entity-types.ts +36 -0
- package/src/entity-types/comment.ts +96 -0
- package/src/entity-types/helpers.ts +153 -0
- package/src/entity-types/index.ts +72 -0
- package/src/entity-types/menu-location.ts +29 -0
- package/src/entity-types/nav-menu-item.ts +106 -0
- package/src/entity-types/nav-menu.ts +53 -0
- package/src/entity-types/navigation-area.ts +29 -0
- package/src/entity-types/page.ts +144 -0
- package/src/entity-types/plugin.ts +74 -0
- package/src/entity-types/post.ts +153 -0
- package/src/entity-types/settings.ts +93 -0
- package/src/entity-types/sidebar.ts +60 -0
- package/src/entity-types/taxonomy.ts +92 -0
- package/src/entity-types/theme.ts +222 -0
- package/src/entity-types/type.ts +80 -0
- package/src/entity-types/user.ts +109 -0
- package/src/entity-types/widget-type.ts +37 -0
- package/src/entity-types/widget.ts +64 -0
- package/src/entity-types/wp-template-part.ts +94 -0
- package/src/entity-types/wp-template.ts +94 -0
- package/src/fetch/__experimental-fetch-link-suggestions.js +2 -2
- package/src/hooks/constants.ts +7 -0
- package/src/hooks/memoize.js +7 -0
- package/src/hooks/test/use-entity-record.js +74 -0
- package/src/hooks/test/use-entity-records.js +78 -0
- package/src/hooks/test/use-query-select.js +194 -0
- package/src/hooks/use-entity-record.ts +72 -0
- package/src/hooks/use-entity-records.ts +89 -0
- package/src/hooks/use-query-select.ts +131 -0
- package/src/index.js +3 -1
- package/src/locks/test/engine.js +13 -13
- package/src/locks/test/reducer.js +3 -3
- package/src/locks/test/utils.js +2 -2
- package/src/reducer.js +1 -1
- package/src/resolvers.js +6 -17
- package/src/test/resolvers.js +17 -23
- package/src/test/selectors.js +2 -3
|
@@ -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
|
+
>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Widget } from './widget';
|
|
5
|
+
import { Context, OmitNevers } from './helpers';
|
|
6
|
+
|
|
7
|
+
import { BaseEntityTypes as _BaseEntityTypes } from './base-entity-types';
|
|
8
|
+
|
|
9
|
+
declare module './base-entity-types' {
|
|
10
|
+
export namespace BaseEntityTypes {
|
|
11
|
+
export interface Sidebar< C extends Context > {
|
|
12
|
+
/**
|
|
13
|
+
* ID of sidebar.
|
|
14
|
+
*/
|
|
15
|
+
id: string;
|
|
16
|
+
/**
|
|
17
|
+
* Unique name identifying the sidebar.
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Description of sidebar.
|
|
22
|
+
*/
|
|
23
|
+
description: string;
|
|
24
|
+
/**
|
|
25
|
+
* Extra CSS class to assign to the sidebar in the Widgets interface.
|
|
26
|
+
*/
|
|
27
|
+
class: string;
|
|
28
|
+
/**
|
|
29
|
+
* HTML content to prepend to each widget's HTML output when assigned to this sidebar. Default is an opening list item element.
|
|
30
|
+
*/
|
|
31
|
+
before_widget: string;
|
|
32
|
+
/**
|
|
33
|
+
* HTML content to append to each widget's HTML output when assigned to this sidebar. Default is a closing list item element.
|
|
34
|
+
*/
|
|
35
|
+
after_widget: string;
|
|
36
|
+
/**
|
|
37
|
+
* HTML content to prepend to the sidebar title when displayed. Default is an opening h2 element.
|
|
38
|
+
*/
|
|
39
|
+
before_title: string;
|
|
40
|
+
/**
|
|
41
|
+
* HTML content to append to the sidebar title when displayed. Default is a closing h2 element.
|
|
42
|
+
*/
|
|
43
|
+
after_title: string;
|
|
44
|
+
/**
|
|
45
|
+
* Status of sidebar.
|
|
46
|
+
*/
|
|
47
|
+
status: SidebarStatus;
|
|
48
|
+
/**
|
|
49
|
+
* Nested widgets.
|
|
50
|
+
*/
|
|
51
|
+
widgets: ( Widget< C > | string )[];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type SidebarStatus = 'active' | 'inactive';
|
|
57
|
+
|
|
58
|
+
export type Sidebar< C extends Context > = OmitNevers<
|
|
59
|
+
_BaseEntityTypes.Sidebar< C >
|
|
60
|
+
>;
|
|
@@ -0,0 +1,92 @@
|
|
|
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 Taxonomy< C extends Context > {
|
|
11
|
+
/**
|
|
12
|
+
* All capabilities used by the taxonomy.
|
|
13
|
+
*/
|
|
14
|
+
capabilities: ContextualField<
|
|
15
|
+
Record< string, string >,
|
|
16
|
+
'edit',
|
|
17
|
+
C
|
|
18
|
+
>;
|
|
19
|
+
/**
|
|
20
|
+
* A human-readable description of the taxonomy.
|
|
21
|
+
*/
|
|
22
|
+
description: ContextualField< string, 'view' | 'edit', C >;
|
|
23
|
+
/**
|
|
24
|
+
* Whether or not the taxonomy should have children.
|
|
25
|
+
*/
|
|
26
|
+
hierarchical: ContextualField< boolean, 'view' | 'edit', C >;
|
|
27
|
+
/**
|
|
28
|
+
* Human-readable labels for the taxonomy for various contexts.
|
|
29
|
+
*/
|
|
30
|
+
labels: ContextualField< Record< string, string >, 'edit', C >;
|
|
31
|
+
/**
|
|
32
|
+
* The title for the taxonomy.
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* An alphanumeric identifier for the taxonomy.
|
|
37
|
+
*/
|
|
38
|
+
slug: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether or not the term cloud should be displayed.
|
|
41
|
+
*/
|
|
42
|
+
show_cloud: ContextualField< boolean, 'edit', C >;
|
|
43
|
+
/**
|
|
44
|
+
* Types associated with the taxonomy.
|
|
45
|
+
*/
|
|
46
|
+
types: ContextualField< string[], 'view' | 'edit', C >;
|
|
47
|
+
/**
|
|
48
|
+
* REST base route for the taxonomy.
|
|
49
|
+
*/
|
|
50
|
+
rest_base: string;
|
|
51
|
+
/**
|
|
52
|
+
* REST namespace route for the taxonomy.
|
|
53
|
+
*/
|
|
54
|
+
rest_namespace: string;
|
|
55
|
+
/**
|
|
56
|
+
* The visibility settings for the taxonomy.
|
|
57
|
+
*/
|
|
58
|
+
visibility: TaxonomyVisibility;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface TaxonomyVisibility {
|
|
62
|
+
/**
|
|
63
|
+
* Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.
|
|
64
|
+
*/
|
|
65
|
+
public: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the taxonomy is publicly queryable.
|
|
68
|
+
*/
|
|
69
|
+
publicly_queryable: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether to generate a default UI for managing this taxonomy.
|
|
72
|
+
*/
|
|
73
|
+
show_ui: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether to allow automatic creation of taxonomy columns on associated post-types table.
|
|
76
|
+
*/
|
|
77
|
+
show_admin_column: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether to make the taxonomy available for selection in navigation menus.
|
|
80
|
+
*/
|
|
81
|
+
show_in_nav_menus: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Whether to show the taxonomy in the quick/bulk edit panel.
|
|
84
|
+
*/
|
|
85
|
+
show_in_quick_edit: boolean;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type Taxonomy< C extends Context > = OmitNevers<
|
|
91
|
+
_BaseEntityTypes.Taxonomy< C >
|
|
92
|
+
>;
|