@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.
- package/CHANGELOG.md +12 -0
- package/README.md +148 -65
- package/build/entities.js +38 -51
- package/build/entities.js.map +1 -1
- package/build/hooks/index.js +14 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-entity-record.js +10 -6
- package/build/hooks/use-entity-record.js.map +1 -1
- package/build/hooks/use-entity-records.js +2 -0
- package/build/hooks/use-entity-records.js.map +1 -1
- package/build/hooks/use-query-select.js +5 -2
- package/build/hooks/use-query-select.js.map +1 -1
- package/build/hooks/use-resource-permissions.js +74 -11
- package/build/hooks/use-resource-permissions.js.map +1 -1
- package/build/index.js +1 -30
- package/build/index.js.map +1 -1
- package/build/resolvers.js +59 -39
- package/build/resolvers.js.map +1 -1
- package/build/selectors.js +9 -46
- package/build/selectors.js.map +1 -1
- package/build-module/entities.js +38 -52
- package/build-module/entities.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-entity-record.js +10 -6
- package/build-module/hooks/use-entity-record.js.map +1 -1
- package/build-module/hooks/use-entity-records.js +2 -0
- package/build-module/hooks/use-entity-records.js.map +1 -1
- package/build-module/hooks/use-query-select.js +4 -1
- package/build-module/hooks/use-query-select.js.map +1 -1
- package/build-module/hooks/use-resource-permissions.js +70 -10
- package/build-module/hooks/use-resource-permissions.js.map +1 -1
- package/build-module/index.js +0 -5
- package/build-module/index.js.map +1 -1
- package/build-module/resolvers.js +59 -39
- package/build-module/resolvers.js.map +1 -1
- package/build-module/selectors.js +7 -44
- package/build-module/selectors.js.map +1 -1
- package/build-types/actions.d.ts +188 -0
- package/build-types/actions.d.ts.map +1 -0
- package/build-types/batch/create-batch.d.ts +71 -0
- package/build-types/batch/create-batch.d.ts.map +1 -0
- package/build-types/batch/default-processor.d.ts +11 -0
- package/build-types/batch/default-processor.d.ts.map +1 -0
- package/build-types/batch/index.d.ts +3 -0
- package/build-types/batch/index.d.ts.map +1 -0
- package/build-types/entities.d.ts +128 -0
- package/build-types/entities.d.ts.map +1 -0
- package/build-types/entity-provider.d.ts +68 -0
- package/build-types/entity-provider.d.ts.map +1 -0
- package/build-types/entity-types/attachment.d.ts +121 -0
- package/build-types/entity-types/attachment.d.ts.map +1 -0
- package/build-types/entity-types/base-entity-records.d.ts +37 -0
- package/build-types/entity-types/base-entity-records.d.ts.map +1 -0
- package/build-types/entity-types/comment.d.ts +82 -0
- package/build-types/entity-types/comment.d.ts.map +1 -0
- package/build-types/entity-types/helpers.d.ts +123 -0
- package/build-types/entity-types/helpers.d.ts.map +1 -0
- package/build-types/entity-types/index.d.ts +64 -0
- package/build-types/entity-types/index.d.ts.map +1 -0
- package/build-types/entity-types/menu-location.d.ts +25 -0
- package/build-types/entity-types/menu-location.d.ts.map +1 -0
- package/build-types/entity-types/nav-menu-item.d.ts +88 -0
- package/build-types/entity-types/nav-menu-item.d.ts.map +1 -0
- package/build-types/entity-types/nav-menu.d.ts +45 -0
- package/build-types/entity-types/nav-menu.d.ts.map +1 -0
- package/build-types/entity-types/page.d.ts +120 -0
- package/build-types/entity-types/page.d.ts.map +1 -0
- package/build-types/entity-types/plugin.d.ts +62 -0
- package/build-types/entity-types/plugin.d.ts.map +1 -0
- package/build-types/entity-types/post.d.ts +128 -0
- package/build-types/entity-types/post.d.ts.map +1 -0
- package/build-types/entity-types/settings.d.ts +89 -0
- package/build-types/entity-types/settings.d.ts.map +1 -0
- package/build-types/entity-types/sidebar.d.ts +55 -0
- package/build-types/entity-types/sidebar.d.ts.map +1 -0
- package/build-types/entity-types/taxonomy.d.ts +83 -0
- package/build-types/entity-types/taxonomy.d.ts.map +1 -0
- package/build-types/entity-types/theme.d.ts +206 -0
- package/build-types/entity-types/theme.d.ts.map +1 -0
- package/build-types/entity-types/type.d.ts +71 -0
- package/build-types/entity-types/type.d.ts.map +1 -0
- package/build-types/entity-types/user.d.ts +93 -0
- package/build-types/entity-types/user.d.ts.map +1 -0
- package/build-types/entity-types/widget-type.d.ts +33 -0
- package/build-types/entity-types/widget-type.d.ts.map +1 -0
- package/build-types/entity-types/widget.d.ts +59 -0
- package/build-types/entity-types/widget.d.ts.map +1 -0
- package/build-types/entity-types/wp-template-part.d.ts +80 -0
- package/build-types/entity-types/wp-template-part.d.ts.map +1 -0
- package/build-types/entity-types/wp-template.d.ts +80 -0
- package/build-types/entity-types/wp-template.d.ts.map +1 -0
- package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts +139 -0
- package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts.map +1 -0
- package/build-types/fetch/__experimental-fetch-url-data.d.ts +35 -0
- package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -0
- package/build-types/fetch/index.d.ts +3 -0
- package/build-types/fetch/index.d.ts.map +1 -0
- package/build-types/hooks/constants.d.ts +7 -0
- package/build-types/hooks/constants.d.ts.map +1 -0
- package/build-types/hooks/index.d.ts +4 -0
- package/build-types/hooks/index.d.ts.map +1 -0
- package/build-types/hooks/memoize.d.ts +3 -0
- package/build-types/hooks/memoize.d.ts.map +1 -0
- package/build-types/hooks/use-entity-record.d.ts +124 -0
- package/build-types/hooks/use-entity-record.d.ts.map +1 -0
- package/build-types/hooks/use-entity-records.d.ts +49 -0
- package/build-types/hooks/use-entity-records.d.ts.map +1 -0
- package/build-types/hooks/use-query-select.d.ts +46 -0
- package/build-types/hooks/use-query-select.d.ts.map +1 -0
- package/build-types/hooks/use-resource-permissions.d.ts +99 -0
- package/build-types/hooks/use-resource-permissions.d.ts.map +1 -0
- package/build-types/index.d.ts +131 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/locks/actions.d.ts +7 -0
- package/build-types/locks/actions.d.ts.map +1 -0
- package/build-types/locks/engine.d.ts +5 -0
- package/build-types/locks/engine.d.ts.map +1 -0
- package/build-types/locks/reducer.d.ts +10 -0
- package/build-types/locks/reducer.d.ts.map +1 -0
- package/build-types/locks/selectors.d.ts +5 -0
- package/build-types/locks/selectors.d.ts.map +1 -0
- package/build-types/locks/utils.d.ts +8 -0
- package/build-types/locks/utils.d.ts.map +1 -0
- package/build-types/name.d.ts +8 -0
- package/build-types/name.d.ts.map +1 -0
- package/build-types/queried-data/actions.d.ts +32 -0
- package/build-types/queried-data/actions.d.ts.map +1 -0
- package/build-types/queried-data/get-query-parts.d.ts +60 -0
- package/build-types/queried-data/get-query-parts.d.ts.map +1 -0
- package/build-types/queried-data/index.d.ts +4 -0
- package/build-types/queried-data/index.d.ts.map +1 -0
- package/build-types/queried-data/reducer.d.ts +54 -0
- package/build-types/queried-data/reducer.d.ts.map +1 -0
- package/build-types/queried-data/selectors.d.ts +16 -0
- package/build-types/queried-data/selectors.d.ts.map +1 -0
- package/build-types/reducer.d.ts +156 -0
- package/build-types/reducer.d.ts.map +1 -0
- package/build-types/resolvers.d.ts +75 -0
- package/build-types/resolvers.d.ts.map +1 -0
- package/build-types/selectors.d.ts +524 -0
- package/build-types/selectors.d.ts.map +1 -0
- package/build-types/types.d.ts +4 -0
- package/build-types/types.d.ts.map +1 -0
- package/build-types/utils/conservative-map-item.d.ts +12 -0
- package/build-types/utils/conservative-map-item.d.ts.map +1 -0
- package/build-types/utils/forward-resolver.d.ts +10 -0
- package/build-types/utils/forward-resolver.d.ts.map +1 -0
- package/build-types/utils/get-normalized-comma-separable.d.ts +12 -0
- package/build-types/utils/get-normalized-comma-separable.d.ts.map +1 -0
- package/build-types/utils/if-matching-action.d.ts +14 -0
- package/build-types/utils/if-matching-action.d.ts.map +1 -0
- package/build-types/utils/index.d.ts +9 -0
- package/build-types/utils/index.d.ts.map +1 -0
- package/build-types/utils/is-raw-attribute.d.ts +10 -0
- package/build-types/utils/is-raw-attribute.d.ts.map +1 -0
- package/build-types/utils/on-sub-key.d.ts +4 -0
- package/build-types/utils/on-sub-key.d.ts.map +1 -0
- package/build-types/utils/replace-action.d.ts +13 -0
- package/build-types/utils/replace-action.d.ts.map +1 -0
- package/build-types/utils/with-weak-map-cache.d.ts +12 -0
- package/build-types/utils/with-weak-map-cache.d.ts.map +1 -0
- package/package.json +13 -11
- package/src/entities.js +325 -0
- package/src/entity-types/attachment.ts +3 -4
- package/src/entity-types/comment.ts +3 -4
- package/src/entity-types/index.ts +31 -88
- package/src/entity-types/menu-location.ts +3 -4
- package/src/entity-types/nav-menu-item.ts +3 -4
- package/src/entity-types/nav-menu.ts +3 -3
- package/src/entity-types/page.ts +3 -3
- package/src/entity-types/plugin.ts +3 -3
- package/src/entity-types/post.ts +3 -3
- package/src/entity-types/settings.ts +3 -3
- package/src/entity-types/sidebar.ts +3 -4
- package/src/entity-types/taxonomy.ts +3 -4
- package/src/entity-types/theme.ts +7 -3
- package/src/entity-types/type.ts +3 -3
- package/src/entity-types/user.ts +3 -3
- package/src/entity-types/widget-type.ts +3 -4
- package/src/entity-types/widget.ts +3 -3
- package/src/entity-types/wp-template-part.ts +3 -4
- package/src/entity-types/wp-template.ts +3 -4
- package/src/hooks/index.ts +4 -0
- package/src/hooks/test/use-entity-record.js +41 -1
- package/src/hooks/test/use-resource-permissions.js +32 -36
- package/src/hooks/use-entity-record.ts +18 -6
- package/src/hooks/use-entity-records.ts +2 -0
- package/src/hooks/use-query-select.ts +4 -1
- package/src/hooks/use-resource-permissions.ts +84 -20
- package/src/index.js +0 -5
- package/src/resolvers.js +80 -45
- package/src/selectors.ts +202 -341
- package/src/test/resolvers.js +118 -4
- package/tsconfig.json +21 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/build/entity-types/entities.js +0 -6
- package/build/entity-types/entities.js.map +0 -1
- package/build-module/entity-types/entities.js +0 -2
- package/build-module/entity-types/entities.js.map +0 -1
- package/src/entities.ts +0 -548
- package/src/entity-types/entities.ts +0 -130
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { AvatarUrls, 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 User<C extends Context> {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier for the user.
|
|
11
|
+
*/
|
|
12
|
+
id: number;
|
|
13
|
+
/**
|
|
14
|
+
* Login name for the user.
|
|
15
|
+
*/
|
|
16
|
+
username: ContextualField<string, 'edit', C>;
|
|
17
|
+
/**
|
|
18
|
+
* Display name for the user.
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* First name for the user.
|
|
23
|
+
*/
|
|
24
|
+
first_name: ContextualField<string, 'edit', C>;
|
|
25
|
+
/**
|
|
26
|
+
* Last name for the user.
|
|
27
|
+
*/
|
|
28
|
+
last_name: ContextualField<string, 'edit', C>;
|
|
29
|
+
/**
|
|
30
|
+
* The email address for the user.
|
|
31
|
+
*/
|
|
32
|
+
email: ContextualField<string, 'edit', C>;
|
|
33
|
+
/**
|
|
34
|
+
* URL of the user.
|
|
35
|
+
*/
|
|
36
|
+
url: string;
|
|
37
|
+
/**
|
|
38
|
+
* Description of the user.
|
|
39
|
+
*/
|
|
40
|
+
description: string;
|
|
41
|
+
/**
|
|
42
|
+
* Author URL of the user.
|
|
43
|
+
*/
|
|
44
|
+
link: string;
|
|
45
|
+
/**
|
|
46
|
+
* Locale for the user.
|
|
47
|
+
*/
|
|
48
|
+
locale: ContextualField<string, 'edit', C>;
|
|
49
|
+
/**
|
|
50
|
+
* The nickname for the user.
|
|
51
|
+
*/
|
|
52
|
+
nickname: ContextualField<string, 'edit', C>;
|
|
53
|
+
/**
|
|
54
|
+
* An alphanumeric identifier for the user.
|
|
55
|
+
*/
|
|
56
|
+
slug: string;
|
|
57
|
+
/**
|
|
58
|
+
* Registration date for the user.
|
|
59
|
+
*/
|
|
60
|
+
registered_date: ContextualField<string, 'edit', C>;
|
|
61
|
+
/**
|
|
62
|
+
* Roles assigned to the user.
|
|
63
|
+
*/
|
|
64
|
+
roles: ContextualField<string[], 'edit', C>;
|
|
65
|
+
/**
|
|
66
|
+
* Password for the user.
|
|
67
|
+
*
|
|
68
|
+
* This is never sent from the server to the client
|
|
69
|
+
* but exists because we might send an update to the
|
|
70
|
+
* server with a new password to set.
|
|
71
|
+
*/
|
|
72
|
+
password?: string;
|
|
73
|
+
/**
|
|
74
|
+
* All capabilities assigned to the user.
|
|
75
|
+
*/
|
|
76
|
+
capabilities: ContextualField<Record<string, string>, 'edit', C>;
|
|
77
|
+
/**
|
|
78
|
+
* Any extra capabilities assigned to the user.
|
|
79
|
+
*/
|
|
80
|
+
extra_capabilities: ContextualField<Record<string, string>, 'edit', C>;
|
|
81
|
+
/**
|
|
82
|
+
* Avatar URLs for the user.
|
|
83
|
+
*/
|
|
84
|
+
avatar_urls: AvatarUrls;
|
|
85
|
+
/**
|
|
86
|
+
* Meta fields.
|
|
87
|
+
*/
|
|
88
|
+
meta: ContextualField<Record<string, string>, 'view' | 'edit', C>;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export declare type User<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.User<C>>;
|
|
93
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/entity-types/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,UAAU,EACV,OAAO,EACP,eAAe,EACf,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,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,QAAQ,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC/C;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,UAAU,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YACjD;;eAEG;YACH,SAAS,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAChD;;eAEG;YACH,KAAK,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC5C;;eAEG;YACH,GAAG,EAAE,MAAM,CAAC;YACZ;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,MAAM,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC7C;;eAEG;YACH,QAAQ,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC/C;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,eAAe,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YACtD;;eAEG;YACH,KAAK,EAAE,eAAe,CAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC9C;;;;;;eAMG;YACH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB;;eAEG;YACH,YAAY,EAAE,eAAe,CAC5B,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,EACxB,MAAM,EACN,CAAC,CACD,CAAC;YACF;;eAEG;YACH,kBAAkB,EAAE,eAAe,CAClC,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,EACxB,MAAM,EACN,CAAC,CACD,CAAC;YACF;;eAEG;YACH,WAAW,EAAE,UAAU,CAAC;YACxB;;eAEG;YACH,IAAI,EAAE,eAAe,CACpB,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,EACxB,MAAM,GAAG,MAAM,EACf,CAAC,CACD,CAAC;SACF;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,33 @@
|
|
|
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 WidgetType<C extends Context> {
|
|
9
|
+
/**
|
|
10
|
+
* Unique slug identifying the widget type.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Human-readable name identifying the widget type.
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Description of the widget.
|
|
19
|
+
*/
|
|
20
|
+
description: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the widget supports multiple instances
|
|
23
|
+
*/
|
|
24
|
+
is_multi: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Class name
|
|
27
|
+
*/
|
|
28
|
+
classname: string;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare type WidgetType<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.WidgetType<C>>;
|
|
33
|
+
//# sourceMappingURL=widget-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-type.d.ts","sourceRoot":"","sources":["../../src/entity-types/widget-type.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,UAAU,CAAE,CAAC,SAAS,OAAO;YAC7C;;eAEG;YACH,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,QAAQ,EAAE,OAAO,CAAC;YAClB;;eAEG;YACH,SAAS,EAAE,MAAM,CAAC;SAClB;KACD;CACD;AAED,oBAAY,UAAU,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAChE,kBAAkB,CAAC,UAAU,CAAE,CAAC,CAAE,CAClC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 Widget<C extends Context> {
|
|
9
|
+
/**
|
|
10
|
+
* Unique identifier for the widget.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of the widget. Corresponds to ID in widget-types endpoint.
|
|
15
|
+
*/
|
|
16
|
+
id_base: string;
|
|
17
|
+
/**
|
|
18
|
+
* The sidebar the widget belongs to.
|
|
19
|
+
*/
|
|
20
|
+
sidebar: string;
|
|
21
|
+
/**
|
|
22
|
+
* HTML representation of the widget.
|
|
23
|
+
*/
|
|
24
|
+
rendered: string;
|
|
25
|
+
/**
|
|
26
|
+
* HTML representation of the widget admin form.
|
|
27
|
+
*/
|
|
28
|
+
rendered_form: ContextualField<string, 'edit', C>;
|
|
29
|
+
/**
|
|
30
|
+
* Instance settings of the widget, if supported.
|
|
31
|
+
*/
|
|
32
|
+
instance: ContextualField<WidgetInstance, 'edit', C>;
|
|
33
|
+
/**
|
|
34
|
+
* URL-encoded form data from the widget admin form. Used
|
|
35
|
+
* to update a widget that does not support instance.
|
|
36
|
+
*
|
|
37
|
+
* This is never sent from the server to the client but exists
|
|
38
|
+
* because we might send an update.
|
|
39
|
+
*/
|
|
40
|
+
form_data?: string;
|
|
41
|
+
}
|
|
42
|
+
interface WidgetInstance {
|
|
43
|
+
/**
|
|
44
|
+
* Base64 encoded representation of the instance settings.
|
|
45
|
+
*/
|
|
46
|
+
encoded: string;
|
|
47
|
+
/**
|
|
48
|
+
* Cryptographic hash of the instance settings.
|
|
49
|
+
*/
|
|
50
|
+
hash: string;
|
|
51
|
+
/**
|
|
52
|
+
* Unencoded instance settings, if supported.
|
|
53
|
+
*/
|
|
54
|
+
raw: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export declare type Widget<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.Widget<C>>;
|
|
59
|
+
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../src/entity-types/widget.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,MAAM,CAAE,CAAC,SAAS,OAAO;YACzC;;eAEG;YACH,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAChB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAChB;;eAEG;YACH,QAAQ,EAAE,MAAM,CAAC;YACjB;;eAEG;YACH,aAAa,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YACpD;;eAEG;YACH,QAAQ,EAAE,eAAe,CAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YACvD;;;;;;eAMG;YACH,SAAS,CAAC,EAAE,MAAM,CAAC;SACnB;QAED,UAAU,cAAc;YACvB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAChB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,GAAG,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,CAAC;SAC9B;KACD;CACD;AAED,oBAAY,MAAM,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAC5D,kBAAkB,CAAC,MAAM,CAAE,CAAC,CAAE,CAC9B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Context, PostStatus, RenderedText, OmitNevers, ContextualField } from './helpers';
|
|
5
|
+
import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
|
|
6
|
+
declare module './base-entity-records' {
|
|
7
|
+
namespace BaseEntityRecords {
|
|
8
|
+
interface WpTemplatePart<C extends Context> {
|
|
9
|
+
/**
|
|
10
|
+
* ID of template.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Unique slug identifying the template.
|
|
15
|
+
*/
|
|
16
|
+
slug: string;
|
|
17
|
+
/**
|
|
18
|
+
* Theme identifier for the template.
|
|
19
|
+
*/
|
|
20
|
+
theme: string;
|
|
21
|
+
/**
|
|
22
|
+
* Type of template.
|
|
23
|
+
*/
|
|
24
|
+
type: string;
|
|
25
|
+
/**
|
|
26
|
+
* Source of template
|
|
27
|
+
*/
|
|
28
|
+
source: string;
|
|
29
|
+
/**
|
|
30
|
+
* Source of a customized template
|
|
31
|
+
*/
|
|
32
|
+
origin: string;
|
|
33
|
+
/**
|
|
34
|
+
* Content of template.
|
|
35
|
+
*
|
|
36
|
+
* This field never has a `rendered` property when reading but still uses
|
|
37
|
+
* the RenderedText type so it can be set as a string when sending updates to
|
|
38
|
+
* the server.
|
|
39
|
+
*
|
|
40
|
+
* TODO: Figure out how to mesh this with `RenderedText<C>`
|
|
41
|
+
*/
|
|
42
|
+
content: ContextualField<RenderedText<C> & {
|
|
43
|
+
/**
|
|
44
|
+
* Version of the content block format used by the template.
|
|
45
|
+
*/
|
|
46
|
+
block_version: ContextualField<number, 'edit', C>;
|
|
47
|
+
}, 'view' | 'edit', C>;
|
|
48
|
+
/**
|
|
49
|
+
* Title of template.
|
|
50
|
+
*/
|
|
51
|
+
title: RenderedText<'edit'>;
|
|
52
|
+
/**
|
|
53
|
+
* Description of template.
|
|
54
|
+
*/
|
|
55
|
+
description: string;
|
|
56
|
+
/**
|
|
57
|
+
* Status of template.
|
|
58
|
+
*/
|
|
59
|
+
status: PostStatus;
|
|
60
|
+
/**
|
|
61
|
+
* Post ID.
|
|
62
|
+
*/
|
|
63
|
+
wp_id: number;
|
|
64
|
+
/**
|
|
65
|
+
* Theme file exists.
|
|
66
|
+
*/
|
|
67
|
+
has_theme_file: Record<string, string>;
|
|
68
|
+
/**
|
|
69
|
+
* The ID for the author of the template.
|
|
70
|
+
*/
|
|
71
|
+
author: number;
|
|
72
|
+
/**
|
|
73
|
+
* Where the template part is intended for use (header, footer, etc.)
|
|
74
|
+
*/
|
|
75
|
+
area: string;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export declare type WpTemplatePart<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.WpTemplatePart<C>>;
|
|
80
|
+
//# sourceMappingURL=wp-template-part.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wp-template-part.d.ts","sourceRoot":"","sources":["../../src/entity-types/wp-template-part.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,OAAO,EACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,eAAe,EACf,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,cAAc,CAAE,CAAC,SAAS,OAAO;YACjD;;eAEG;YACH,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YACf;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YACf;;;;;;;;eAQG;YACH,OAAO,EAAE,eAAe,CACvB,YAAY,CAAE,CAAC,CAAE,GAAG;gBACnB;;mBAEG;gBACH,aAAa,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;aACpD,EACD,MAAM,GAAG,MAAM,EACf,CAAC,CACD,CAAC;YACF;;eAEG;YACH,KAAK,EAAE,YAAY,CAAE,MAAM,CAAE,CAAC;YAC9B;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,MAAM,EAAE,UAAU,CAAC;YACnB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,cAAc,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,CAAC;YACzC;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YACf;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;SACb;KACD;CACD;AAED,oBAAY,cAAc,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CACpE,kBAAkB,CAAC,cAAc,CAAE,CAAC,CAAE,CACtC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Context, PostStatus, RenderedText, OmitNevers, ContextualField } from './helpers';
|
|
5
|
+
import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
|
|
6
|
+
declare module './base-entity-records' {
|
|
7
|
+
namespace BaseEntityRecords {
|
|
8
|
+
interface WpTemplate<C extends Context> {
|
|
9
|
+
/**
|
|
10
|
+
* ID of template.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Unique slug identifying the template.
|
|
15
|
+
*/
|
|
16
|
+
slug: string;
|
|
17
|
+
/**
|
|
18
|
+
* Theme identifier for the template.
|
|
19
|
+
*/
|
|
20
|
+
theme: string;
|
|
21
|
+
/**
|
|
22
|
+
* Type of template.
|
|
23
|
+
*/
|
|
24
|
+
type: string;
|
|
25
|
+
/**
|
|
26
|
+
* Source of template
|
|
27
|
+
*/
|
|
28
|
+
source: string;
|
|
29
|
+
/**
|
|
30
|
+
* Source of a customized template
|
|
31
|
+
*/
|
|
32
|
+
origin: string;
|
|
33
|
+
/**
|
|
34
|
+
* Content of template.
|
|
35
|
+
*
|
|
36
|
+
* This field never has a `rendered` property when reading but still uses
|
|
37
|
+
* the RenderedText type so it can be set as a string when sending updates to
|
|
38
|
+
* the server.
|
|
39
|
+
*
|
|
40
|
+
* TODO: Figure out how to mesh this with `RenderedText<C>`
|
|
41
|
+
*/
|
|
42
|
+
content: ContextualField<RenderedText<C> & {
|
|
43
|
+
/**
|
|
44
|
+
* Version of the content block format used by the template.
|
|
45
|
+
*/
|
|
46
|
+
block_version: ContextualField<number, 'edit', C>;
|
|
47
|
+
}, 'view' | 'edit', C>;
|
|
48
|
+
/**
|
|
49
|
+
* Title of template.
|
|
50
|
+
*/
|
|
51
|
+
title: RenderedText<'edit'>;
|
|
52
|
+
/**
|
|
53
|
+
* Description of template.
|
|
54
|
+
*/
|
|
55
|
+
description: string;
|
|
56
|
+
/**
|
|
57
|
+
* Status of template.
|
|
58
|
+
*/
|
|
59
|
+
status: PostStatus;
|
|
60
|
+
/**
|
|
61
|
+
* Post ID.
|
|
62
|
+
*/
|
|
63
|
+
wp_id: number;
|
|
64
|
+
/**
|
|
65
|
+
* Theme file exists.
|
|
66
|
+
*/
|
|
67
|
+
has_theme_file: Record<string, string>;
|
|
68
|
+
/**
|
|
69
|
+
* The ID for the author of the template.
|
|
70
|
+
*/
|
|
71
|
+
author: number;
|
|
72
|
+
/**
|
|
73
|
+
* Whether a template is a custom template.
|
|
74
|
+
*/
|
|
75
|
+
is_custom: Record<string, string>;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export declare type WpTemplate<C extends Context = 'edit'> = OmitNevers<_BaseEntityRecords.WpTemplate<C>>;
|
|
80
|
+
//# sourceMappingURL=wp-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wp-template.d.ts","sourceRoot":"","sources":["../../src/entity-types/wp-template.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,OAAO,EACP,UAAU,EACV,YAAY,EACZ,UAAU,EACV,eAAe,EACf,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,UAAU,CAAE,CAAC,SAAS,OAAO;YAC7C;;eAEG;YACH,EAAE,EAAE,MAAM,CAAC;YACX;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YACb;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YACf;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YACf;;;;;;;;eAQG;YACH,OAAO,EAAE,eAAe,CACvB,YAAY,CAAE,CAAC,CAAE,GAAG;gBACnB;;mBAEG;gBACH,aAAa,EAAE,eAAe,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;aACpD,EACD,MAAM,GAAG,MAAM,EACf,CAAC,CACD,CAAC;YACF;;eAEG;YACH,KAAK,EAAE,YAAY,CAAE,MAAM,CAAE,CAAC;YAC9B;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;YACpB;;eAEG;YACH,MAAM,EAAE,UAAU,CAAC;YACnB;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YACd;;eAEG;YACH,cAAc,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,CAAC;YACzC;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YACf;;eAEG;YACH,SAAS,EAAE,MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,CAAC;SACpC;KACD;CACD;AAED,oBAAY,UAAU,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAChE,kBAAkB,CAAC,UAAU,CAAE,CAAC,CAAE,CAClC,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export default fetchLinkSuggestions;
|
|
2
|
+
/**
|
|
3
|
+
* Filters the search by type
|
|
4
|
+
*/
|
|
5
|
+
export type WPLinkSearchType = 'attachment' | 'post' | 'term' | 'post-format';
|
|
6
|
+
/**
|
|
7
|
+
* A link with an id may be of kind post-type or taxonomy
|
|
8
|
+
*/
|
|
9
|
+
export type WPKind = 'post-type' | 'taxonomy';
|
|
10
|
+
export type WPLinkSearchOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Displays initial search suggestions, when true.
|
|
13
|
+
*/
|
|
14
|
+
isInitialSuggestions?: boolean | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Filters by search type.
|
|
17
|
+
*/
|
|
18
|
+
type?: WPLinkSearchType | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Slug of the post-type or taxonomy.
|
|
21
|
+
*/
|
|
22
|
+
subtype?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Which page of results to return.
|
|
25
|
+
*/
|
|
26
|
+
page?: number | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Search results per page.
|
|
29
|
+
*/
|
|
30
|
+
perPage?: number | undefined;
|
|
31
|
+
};
|
|
32
|
+
export type WPLinkSearchResult = {
|
|
33
|
+
/**
|
|
34
|
+
* Post or term id.
|
|
35
|
+
*/
|
|
36
|
+
id: number;
|
|
37
|
+
/**
|
|
38
|
+
* Link url.
|
|
39
|
+
*/
|
|
40
|
+
url: string;
|
|
41
|
+
/**
|
|
42
|
+
* Title of the link.
|
|
43
|
+
*/
|
|
44
|
+
title: string;
|
|
45
|
+
/**
|
|
46
|
+
* The taxonomy or post type slug or type URL.
|
|
47
|
+
*/
|
|
48
|
+
type: string;
|
|
49
|
+
/**
|
|
50
|
+
* Link kind of post-type or taxonomy
|
|
51
|
+
*/
|
|
52
|
+
kind?: WPKind | undefined;
|
|
53
|
+
};
|
|
54
|
+
export type WPLinkSearchResultAugments = {
|
|
55
|
+
/**
|
|
56
|
+
* Contains kind information.
|
|
57
|
+
*/
|
|
58
|
+
meta?: {
|
|
59
|
+
kind: WPKind;
|
|
60
|
+
} | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Optional subtype if it exists.
|
|
63
|
+
*/
|
|
64
|
+
subtype?: WPKind | undefined;
|
|
65
|
+
};
|
|
66
|
+
export type WPLinkSearchResultAugmented = WPLinkSearchResult & WPLinkSearchResultAugments;
|
|
67
|
+
export type WPEditorSettings = {
|
|
68
|
+
/**
|
|
69
|
+
* Disables post formats, when true.
|
|
70
|
+
*/
|
|
71
|
+
disablePostFormats?: boolean | undefined;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Filters the search by type
|
|
75
|
+
*
|
|
76
|
+
* @typedef { 'attachment' | 'post' | 'term' | 'post-format' } WPLinkSearchType
|
|
77
|
+
*/
|
|
78
|
+
/**
|
|
79
|
+
* A link with an id may be of kind post-type or taxonomy
|
|
80
|
+
*
|
|
81
|
+
* @typedef { 'post-type' | 'taxonomy' } WPKind
|
|
82
|
+
*/
|
|
83
|
+
/**
|
|
84
|
+
* @typedef WPLinkSearchOptions
|
|
85
|
+
*
|
|
86
|
+
* @property {boolean} [isInitialSuggestions] Displays initial search suggestions, when true.
|
|
87
|
+
* @property {WPLinkSearchType} [type] Filters by search type.
|
|
88
|
+
* @property {string} [subtype] Slug of the post-type or taxonomy.
|
|
89
|
+
* @property {number} [page] Which page of results to return.
|
|
90
|
+
* @property {number} [perPage] Search results per page.
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* @typedef WPLinkSearchResult
|
|
94
|
+
*
|
|
95
|
+
* @property {number} id Post or term id.
|
|
96
|
+
* @property {string} url Link url.
|
|
97
|
+
* @property {string} title Title of the link.
|
|
98
|
+
* @property {string} type The taxonomy or post type slug or type URL.
|
|
99
|
+
* @property {WPKind} [kind] Link kind of post-type or taxonomy
|
|
100
|
+
*/
|
|
101
|
+
/**
|
|
102
|
+
* @typedef WPLinkSearchResultAugments
|
|
103
|
+
*
|
|
104
|
+
* @property {{kind: WPKind}} [meta] Contains kind information.
|
|
105
|
+
* @property {WPKind} [subtype] Optional subtype if it exists.
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* @typedef {WPLinkSearchResult & WPLinkSearchResultAugments} WPLinkSearchResultAugmented
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* @typedef WPEditorSettings
|
|
112
|
+
*
|
|
113
|
+
* @property {boolean} [ disablePostFormats ] Disables post formats, when true.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Fetches link suggestions from the API.
|
|
117
|
+
*
|
|
118
|
+
* @async
|
|
119
|
+
* @param {string} search
|
|
120
|
+
* @param {WPLinkSearchOptions} [searchOptions]
|
|
121
|
+
* @param {WPEditorSettings} [settings]
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```js
|
|
125
|
+
* import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
|
|
126
|
+
*
|
|
127
|
+
* //...
|
|
128
|
+
*
|
|
129
|
+
* export function initialize( id, settings ) {
|
|
130
|
+
*
|
|
131
|
+
* settings.__experimentalFetchLinkSuggestions = (
|
|
132
|
+
* search,
|
|
133
|
+
* searchOptions
|
|
134
|
+
* ) => fetchLinkSuggestions( search, searchOptions, settings );
|
|
135
|
+
* ```
|
|
136
|
+
* @return {Promise< WPLinkSearchResult[] >} List of search suggestions
|
|
137
|
+
*/
|
|
138
|
+
declare function fetchLinkSuggestions(search: string, searchOptions?: WPLinkSearchOptions | undefined, settings?: WPEditorSettings | undefined): Promise<WPLinkSearchResult[]>;
|
|
139
|
+
//# sourceMappingURL=__experimental-fetch-link-suggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__experimental-fetch-link-suggestions.d.ts","sourceRoot":"","sources":["../../src/fetch/__experimental-fetch-link-suggestions.js"],"names":[],"mappings":";;;;+BAWc,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa;;;;qBAM9C,WAAW,GAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgBxB,MAAM;;;;SACN,MAAM;;;;WACN,MAAM;;;;UACN,MAAM;;;;;;;;;;;cAOC,MAAM;;;;;;;0CAKd,kBAAkB,GAAG,0BAA0B;;;;;;;AAxC5D;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8CAnBW,MAAM,6FAiBL,QAAS,kBAAkB,EAAE,CAAE,CAiJ1C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default fetchUrlData;
|
|
2
|
+
export type WPRemoteUrlData = {
|
|
3
|
+
/**
|
|
4
|
+
* contents of the remote URL's `<title>` tag.
|
|
5
|
+
*/
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @typedef WPRemoteUrlData
|
|
10
|
+
*
|
|
11
|
+
* @property {string} title contents of the remote URL's `<title>` tag.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Fetches data about a remote URL.
|
|
15
|
+
* eg: <title> tag, favicon...etc.
|
|
16
|
+
*
|
|
17
|
+
* @async
|
|
18
|
+
* @param {string} url the URL to request details from.
|
|
19
|
+
* @param {Object?} options any options to pass to the underlying fetch.
|
|
20
|
+
* @example
|
|
21
|
+
* ```js
|
|
22
|
+
* import { __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
|
|
23
|
+
*
|
|
24
|
+
* //...
|
|
25
|
+
*
|
|
26
|
+
* export function initialize( id, settings ) {
|
|
27
|
+
*
|
|
28
|
+
* settings.__experimentalFetchUrlData = (
|
|
29
|
+
* url
|
|
30
|
+
* ) => fetchUrlData( url );
|
|
31
|
+
* ```
|
|
32
|
+
* @return {Promise< WPRemoteUrlData[] >} Remote URL data.
|
|
33
|
+
*/
|
|
34
|
+
declare function fetchUrlData(url: string, options?: any | null): Promise<WPRemoteUrlData[]>;
|
|
35
|
+
//# sourceMappingURL=__experimental-fetch-url-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__experimental-fetch-url-data.d.ts","sourceRoot":"","sources":["../../src/fetch/__experimental-fetch-url-data.js"],"names":[],"mappings":";;;;;WAsBc,MAAM;;AAHpB;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,mCAhBW,MAAM,yBAcL,QAAS,eAAe,EAAE,CAAE,CAuCvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fetch/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,0BAAkB,MAAM;IACvB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,OAAO,YAAY;CACnB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as useEntityRecord, __experimentalUseEntityRecord, } from './use-entity-record';
|
|
2
|
+
export { default as useEntityRecords, __experimentalUseEntityRecords, } from './use-entity-records';
|
|
3
|
+
export { default as useResourcePermissions, __experimentalUseResourcePermissions, } from './use-resource-permissions';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,IAAI,eAAe,EAC1B,6BAA6B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,OAAO,IAAI,gBAAgB,EAC3B,8BAA8B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,OAAO,IAAI,sBAAsB,EACjC,oCAAoC,GACpC,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../src/hooks/memoize.js"],"names":[],"mappings":""}
|