-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp-loader.ts
111 lines (104 loc) · 2.44 KB
/
app-loader.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import { IconType, RootComponentProps } from './index';
import { UIEventData } from './ui-events';
import { Extensions } from './apps';
import { PluginConf } from './plugins';
import { IntegrationReleaseInfoFragmentFragment } from '../sdk/graphql-operation-types';
export type ActivityFn = (
location: Location,
pathToActiveWhen: (path: string, exact?: boolean) => (location: Location) => boolean,
layoutConfig?: Extensions,
) => boolean;
export type LayoutConfig = {
/**
* load modals inside this node
*/
modalSlotId?: string;
/**
* main app and plugin area
*/
applicationSlotId?: string;
/**
* load root widgets inside this node
* do not use this for app defined widgets
*/
rootWidgetSlotId?: string;
/**
* load app defined widgets into this node
*/
widgetSlotId?: string;
/**
* topbar loading node
*/
topbarSlotId?: string;
/**
* cookie widget slot
*/
cookieWidgetSlotId?: string;
/**
* sidebar area slot
*/
sidebarSlotId?: string;
/**
* snackbar notification slot
*/
snackbarNotifSlotId?: string;
};
export interface IntegrationRegistrationOptions {
worldConfig: {
title: string;
};
uiEvents: RootComponentProps['uiEvents'];
layoutConfig: LayoutConfig;
extensionData?: UIEventData['data'];
plugins?: PluginConf;
logger: unknown;
}
export enum LogLevels {
FATAL = 'fatal',
ERROR = 'error',
WARN = 'warn',
INFO = 'info',
DEBUG = 'debug',
TRACE = 'trace',
}
export enum INTEGRATION_TYPES {
APPLICATION,
PLUGIN,
WIDGET,
}
/**
* World configuration object
*/
export type WorldConfig = {
/**
* Apps that are installed by default on this world.
* homePageApp is loaded by default, no need to be specified here
*/
defaultApps: string[];
/**
* Widgets that are installed by default on this world.
* layout widget is loaded by default, no need to be specified here
*/
defaultWidgets: string[];
/**
* The layout widget of this world. This widget always mounts in the root element.
*/
layout: string;
/**
* The app to load when you navigate to the home page.
*/
homepageApp: string;
/**
* Define this world's title
*/
title: string;
analytics?: {
siteId: string;
trackerUrl: string;
};
registryOverrides?: IntegrationReleaseInfoFragmentFragment[];
socialLinks?: { icon: IconType; link: string }[];
};
export interface QueryStringType {
[key: string]: string | string[] | unknown | undefined;
}