UNPKG

1.55 kBTypeScriptView Raw
1import type { GetUIConfigParams } from '../../common-types';
2import type { UIConfigProps } from '../../entities/ui-config';
3import type { OptionalDefaults } from '../wrappers/wrap';
4export type UIConfigPlainClientAPI = {
5 /**
6 * Fetch the UI Config for a given Space and Environment
7 * @param params entity IDs to identify the UI Config
8 * @returns the UI Config
9 * @throws if the request fails, or the UI Config is not found
10 * @example
11 * ```javascript
12 * const uiConfig = await client.uiConfig.get({
13 * spaceId: "<space_id>",
14 * environmentId: "<environment_id>",
15 * });
16 * ```
17 */
18 get(params: OptionalDefaults<GetUIConfigParams>): Promise<UIConfigProps>;
19 /**
20 * Update the UI Config for a given Space and Environment
21 * @param params entity IDs to identify the UI Config
22 * @param rawData the UI Config update
23 * @returns the updated UI Config
24 * @throws if the request fails, the UI Config is not found, or the update payload is malformed
25 * @example
26 * ```javascript
27 * await client.uiConfig.update({
28 * spaceId: "<space_id>",
29 * environmentId: "<environment_id>",
30 * }, {
31 * ...currentUIConfig,
32 * entryListViews: [
33 * ...currentUIConfig.entryListViews,
34 * {
35 * id: 'newFolder',
36 * title: 'New Folder',
37 * views: []
38 * }
39 * ],
40 * });
41 * ```
42 */
43 update(params: OptionalDefaults<GetUIConfigParams>, rawData: UIConfigProps): Promise<UIConfigProps>;
44};