@vendure/ui-devkit 2.2.0-next.3 → 2.2.0-next.5

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.
@@ -1,109 +1,109 @@
1
- import { ActiveRouteData, NotificationMessage, WatchQueryFetchPolicy } from '@vendure/common/lib/extension-host-types';
2
- import { Observable } from 'rxjs';
3
- /**
4
- * @description
5
- * Set the [window.postMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
6
- * `targetOrigin`. The Vendure ui-devkit uses the postMessage API to
7
- * enable cross-frame and cross-origin communication between the ui extension code and the Admin UI
8
- * app. The `targetOrigin` is a security feature intended to provide control over where messages are sent.
9
- *
10
- * @docsCategory ui-devkit
11
- * @docsPage UiDevkitClient
12
- */
13
- export declare function setTargetOrigin(value: string): void;
14
- /**
15
- * @description
16
- * Retrieves information about the current route of the host application, since it is not possible
17
- * to otherwise get this information from within the child iframe.
18
- *
19
- * @example
20
- * ```ts
21
- * import { getActivatedRoute } from '\@vendure/ui-devkit';
22
- *
23
- * const route = await getActivatedRoute();
24
- * const slug = route.params.slug;
25
- * ```
26
- * @docsCategory ui-devkit
27
- * @docsPage UiDevkitClient
28
- */
29
- export declare function getActivatedRoute(): Promise<ActiveRouteData>;
30
- /**
31
- * @description
32
- * Perform a GraphQL query and returns either an Observable or a Promise of the result.
33
- *
34
- * @example
35
- * ```ts
36
- * import { graphQlQuery } from '\@vendure/ui-devkit';
37
- *
38
- * const productList = await graphQlQuery(`
39
- * query GetProducts($skip: Int, $take: Int) {
40
- * products(options: { skip: $skip, take: $take }) {
41
- * items { id, name, enabled },
42
- * totalItems
43
- * }
44
- * }`, {
45
- * skip: 0,
46
- * take: 10,
47
- * }).then(data => data.products);
48
- * ```
49
- *
50
- * @docsCategory ui-devkit
51
- * @docsPage UiDevkitClient
52
- */
53
- export declare function graphQlQuery<T, V extends {
54
- [key: string]: any;
55
- }>(document: string, variables?: {
56
- [key: string]: any;
57
- }, fetchPolicy?: WatchQueryFetchPolicy): {
58
- then: Promise<T>['then'];
59
- stream: Observable<T>;
60
- };
61
- /**
62
- * @description
63
- * Perform a GraphQL mutation and returns either an Observable or a Promise of the result.
64
- *
65
- * @example
66
- * ```ts
67
- * import { graphQlMutation } from '\@vendure/ui-devkit';
68
- *
69
- * const disableProduct = (id: string) => {
70
- * return graphQlMutation(`
71
- * mutation DisableProduct($id: ID!) {
72
- * updateProduct(input: { id: $id, enabled: false }) {
73
- * id
74
- * enabled
75
- * }
76
- * }`, { id })
77
- * .then(data => data.updateProduct)
78
- * }
79
- * ```
80
- *
81
- * @docsCategory ui-devkit
82
- * @docsPage UiDevkitClient
83
- */
84
- export declare function graphQlMutation<T, V extends {
85
- [key: string]: any;
86
- }>(document: string, variables?: {
87
- [key: string]: any;
88
- }): {
89
- then: Promise<T>['then'];
90
- stream: Observable<T>;
91
- };
92
- /**
93
- * @description
94
- * Display a toast notification.
95
- *
96
- * @example
97
- * ```ts
98
- * import { notify } from '\@vendure/ui-devkit';
99
- *
100
- * notify({
101
- * message: 'Updated Product',
102
- * type: 'success'
103
- * });
104
- * ```
105
- *
106
- * @docsCategory ui-devkit
107
- * @docsPage UiDevkitClient
108
- */
109
- export declare function notify(options: NotificationMessage['data']): void;
1
+ import { ActiveRouteData, NotificationMessage, WatchQueryFetchPolicy } from '@vendure/common/lib/extension-host-types';
2
+ import { Observable } from 'rxjs';
3
+ /**
4
+ * @description
5
+ * Set the [window.postMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
6
+ * `targetOrigin`. The Vendure ui-devkit uses the postMessage API to
7
+ * enable cross-frame and cross-origin communication between the ui extension code and the Admin UI
8
+ * app. The `targetOrigin` is a security feature intended to provide control over where messages are sent.
9
+ *
10
+ * @docsCategory ui-devkit
11
+ * @docsPage UiDevkitClient
12
+ */
13
+ export declare function setTargetOrigin(value: string): void;
14
+ /**
15
+ * @description
16
+ * Retrieves information about the current route of the host application, since it is not possible
17
+ * to otherwise get this information from within the child iframe.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * import { getActivatedRoute } from '\@vendure/ui-devkit';
22
+ *
23
+ * const route = await getActivatedRoute();
24
+ * const slug = route.params.slug;
25
+ * ```
26
+ * @docsCategory ui-devkit
27
+ * @docsPage UiDevkitClient
28
+ */
29
+ export declare function getActivatedRoute(): Promise<ActiveRouteData>;
30
+ /**
31
+ * @description
32
+ * Perform a GraphQL query and returns either an Observable or a Promise of the result.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * import { graphQlQuery } from '\@vendure/ui-devkit';
37
+ *
38
+ * const productList = await graphQlQuery(`
39
+ * query GetProducts($skip: Int, $take: Int) {
40
+ * products(options: { skip: $skip, take: $take }) {
41
+ * items { id, name, enabled },
42
+ * totalItems
43
+ * }
44
+ * }`, {
45
+ * skip: 0,
46
+ * take: 10,
47
+ * }).then(data => data.products);
48
+ * ```
49
+ *
50
+ * @docsCategory ui-devkit
51
+ * @docsPage UiDevkitClient
52
+ */
53
+ export declare function graphQlQuery<T, V extends {
54
+ [key: string]: any;
55
+ }>(document: string, variables?: {
56
+ [key: string]: any;
57
+ }, fetchPolicy?: WatchQueryFetchPolicy): {
58
+ then: Promise<T>['then'];
59
+ stream: Observable<T>;
60
+ };
61
+ /**
62
+ * @description
63
+ * Perform a GraphQL mutation and returns either an Observable or a Promise of the result.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * import { graphQlMutation } from '\@vendure/ui-devkit';
68
+ *
69
+ * const disableProduct = (id: string) => {
70
+ * return graphQlMutation(`
71
+ * mutation DisableProduct($id: ID!) {
72
+ * updateProduct(input: { id: $id, enabled: false }) {
73
+ * id
74
+ * enabled
75
+ * }
76
+ * }`, { id })
77
+ * .then(data => data.updateProduct)
78
+ * }
79
+ * ```
80
+ *
81
+ * @docsCategory ui-devkit
82
+ * @docsPage UiDevkitClient
83
+ */
84
+ export declare function graphQlMutation<T, V extends {
85
+ [key: string]: any;
86
+ }>(document: string, variables?: {
87
+ [key: string]: any;
88
+ }): {
89
+ then: Promise<T>['then'];
90
+ stream: Observable<T>;
91
+ };
92
+ /**
93
+ * @description
94
+ * Display a toast notification.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * import { notify } from '\@vendure/ui-devkit';
99
+ *
100
+ * notify({
101
+ * message: 'Updated Product',
102
+ * type: 'success'
103
+ * });
104
+ * ```
105
+ *
106
+ * @docsCategory ui-devkit
107
+ * @docsPage UiDevkitClient
108
+ */
109
+ export declare function notify(options: NotificationMessage['data']): void;
package/client/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './devkit-client-api';
1
+ export * from './devkit-client-api';
@@ -1,9 +1,9 @@
1
- import { AdminUiAppConfig, AdminUiAppDevModeConfig } from '@vendure/common/lib/shared-types';
2
- import { UiExtensionCompilerOptions } from './types';
3
- /**
4
- * @description
5
- * Compiles the Admin UI app with the specified extensions.
6
- *
7
- * @docsCategory UiDevkit
8
- */
9
- export declare function compileUiExtensions(options: UiExtensionCompilerOptions): AdminUiAppConfig | AdminUiAppDevModeConfig;
1
+ import { AdminUiAppConfig, AdminUiAppDevModeConfig } from '@vendure/common/lib/shared-types';
2
+ import { UiExtensionCompilerOptions } from './types';
3
+ /**
4
+ * @description
5
+ * Compiles the Admin UI app with the specified extensions.
6
+ *
7
+ * @docsCategory UiDevkit
8
+ */
9
+ export declare function compileUiExtensions(options: UiExtensionCompilerOptions): AdminUiAppConfig | AdminUiAppDevModeConfig;