UNPKG

1.38 kBTypeScriptView Raw
1import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
2export type UIConfigProps = {
3 /**
4 * System metadata
5 */
6 sys: UIConfigSysProps;
7 assetListViews: ViewFolder[];
8 entryListViews: ViewFolder[];
9 homeViews: HomeView[];
10};
11export interface UIConfigSysProps extends BasicMetaSysProps {
12 space: SysLink;
13 environment: SysLink;
14}
15interface HomeView {
16 widgetId: string;
17 widgetNamespace: string;
18}
19interface ViewFolder {
20 id: string;
21 title: string;
22 views: View[];
23}
24interface View {
25 id: string;
26 title: string;
27 order?: {
28 fieldId: string;
29 direction: 'ascending' | 'descending';
30 };
31 displayedFieldIds?: string[];
32 contentTypeId?: string | null;
33 contentTypeIds?: string[];
34 searchText?: string;
35 searchFilters?: [string, string, string][];
36 roles?: string[];
37}
38export interface UIConfig extends UIConfigProps, DefaultElements<UIConfigProps> {
39}
40/**
41 * @private
42 * @param makeRequest - function to make requests via an adapter
43 * @param data - Raw data
44 * @return Wrapped UIConfig
45 */
46export declare function wrapUIConfig(makeRequest: MakeRequest, data: UIConfigProps): {
47 update: () => Promise<any & UIConfigProps & {
48 toPlainObject(): UIConfigProps;
49 }>;
50} & UIConfigProps & {
51 toPlainObject(): UIConfigProps;
52};
53export {};