@pc-nexus/models 0.0.1-next.1 → 0.0.1-next.2
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,7 +1,7 @@
|
|
|
1
1
|
var NexusAppEnvironment;
|
|
2
2
|
(function (NexusAppEnvironment) {
|
|
3
|
-
NexusAppEnvironment["
|
|
4
|
-
NexusAppEnvironment["
|
|
3
|
+
NexusAppEnvironment["development"] = "development";
|
|
4
|
+
NexusAppEnvironment["production"] = "production";
|
|
5
5
|
})(NexusAppEnvironment || (NexusAppEnvironment = {}));
|
|
6
6
|
|
|
7
7
|
const SUPPORTED_LOCALE_CODES = ["zh-cn", "en-us"];
|
|
@@ -20,6 +20,21 @@ var ViewportSize;
|
|
|
20
20
|
ViewportSize["max"] = "max";
|
|
21
21
|
})(ViewportSize || (ViewportSize = {}));
|
|
22
22
|
|
|
23
|
+
var NotifyType;
|
|
24
|
+
(function (NotifyType) {
|
|
25
|
+
NotifyType["success"] = "success";
|
|
26
|
+
NotifyType["error"] = "error";
|
|
27
|
+
NotifyType["warning"] = "warning";
|
|
28
|
+
NotifyType["info"] = "info";
|
|
29
|
+
})(NotifyType || (NotifyType = {}));
|
|
30
|
+
|
|
31
|
+
var HistoryAction;
|
|
32
|
+
(function (HistoryAction) {
|
|
33
|
+
HistoryAction["pop"] = "POP";
|
|
34
|
+
HistoryAction["push"] = "PUSH";
|
|
35
|
+
HistoryAction["replace"] = "REPLACE";
|
|
36
|
+
})(HistoryAction || (HistoryAction = {}));
|
|
37
|
+
|
|
23
38
|
/*
|
|
24
39
|
* Public API Surface of models
|
|
25
40
|
*/
|
|
@@ -28,5 +43,5 @@ var ViewportSize;
|
|
|
28
43
|
* Generated bundle index. Do not edit.
|
|
29
44
|
*/
|
|
30
45
|
|
|
31
|
-
export { NavigationTarget, NexusAppEnvironment, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
46
|
+
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
32
47
|
//# sourceMappingURL=pc-nexus-models.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pc-nexus-models.mjs","sources":["../../../../web/models/src/environment.ts","../../../../web/models/src/locale.ts","../../../../web/models/src/navigation.ts","../../../../web/models/src/viewport.ts","../../../../web/models/src/public-api.ts","../../../../web/models/src/pc-nexus-models.ts"],"sourcesContent":["export enum NexusAppEnvironment {\n
|
|
1
|
+
{"version":3,"file":"pc-nexus-models.mjs","sources":["../../../../web/models/src/environment.ts","../../../../web/models/src/locale.ts","../../../../web/models/src/navigation.ts","../../../../web/models/src/viewport.ts","../../../../web/models/src/notify.ts","../../../../web/models/src/view.ts","../../../../web/models/src/public-api.ts","../../../../web/models/src/pc-nexus-models.ts"],"sourcesContent":["export enum NexusAppEnvironment {\n development = \"development\",\n production = \"production\",\n}\n","export const SUPPORTED_LOCALE_CODES = [\"zh-cn\", \"en-us\"] as const;\n\nexport type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];\n\nexport interface Translator {\n translate: (key: string, params?: Record<string, any>) => string;\n}\nexport interface GetTranslationsResult {\n locale: NexusSupportedLocaleCode;\n translations: TranslationResourceContent | null;\n}\n\nexport interface TranslationResourceContent {\n [key: string]: string | TranslationResourceContent;\n}\n","export enum NavigationTarget {\n workItem = \"workItem\",\n}\n\ninterface NavigationWorkItem {\n target: NavigationTarget.workItem;\n workItemId: string;\n}\n\nexport type NavigationLocation = NavigationWorkItem;\n","export interface Viewport {\n size?: ViewportSize;\n}\n\nexport enum ViewportSize {\n small = \"small\",\n medium = \"medium\",\n large = \"large\",\n xlarge = \"xlarge\",\n max = \"max\",\n}\n","export enum NotifyType {\n success = \"success\",\n error = \"error\",\n warning = \"warning\",\n info = \"info\",\n}\n\nexport interface NotifyOptions {\n type?: NotifyType;\n title?: string;\n description?: string;\n detail?: string | NotifyDetail;\n actions?: NotifyAction[];\n isAutoClose?: boolean;\n}\n\nexport interface NotifyRef {\n close: () => void;\n}\n\nexport interface NotifyDetail {\n link?: string;\n content?: string;\n}\n\nexport interface NotifyAction {\n text: string;\n icon?: string;\n onClick: (event?: Event) => void;\n}\n","export enum HistoryAction {\n pop = \"POP\",\n push = \"PUSH\",\n replace = \"REPLACE\",\n}\n\nexport interface LocationDescriptor {\n pathname: string;\n search?: string;\n hash?: string;\n state?: unknown;\n}\n\nexport type UnlistenCallback = () => void;\n\nexport interface NexusHistory {\n action: HistoryAction;\n location: LocationDescriptor;\n push(path: string, state?: unknown): void;\n push(location: LocationDescriptor): void;\n replace(path: string, state?: unknown): void;\n replace(location: LocationDescriptor): void;\n go(n: number): void;\n goBack(): void;\n goForward(): void;\n listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;\n}\n","/*\n * Public API Surface of models\n */\n\nexport * from \"./context\";\nexport * from \"./dialog\";\nexport * from \"./environment\";\nexport * from \"./extension\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./viewport\";\nexport * from \"./events\";\nexport * from \"./work-item\";\nexport * from \"./user\";\nexport * from \"./request-api\";\nexport * from \"./notify\";\nexport * from \"./view\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC3B,IAAA,mBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,mBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC7B,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;;MCAlB,sBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO;;ICA3C;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACzB,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ICIhB;AAAZ,CAAA,UAAY,YAAY,EAAA;AACpB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,YAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACf,CAAC,EANW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;ICJZ;AAAZ,CAAA,UAAY,UAAU,EAAA;AAClB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EALW,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;;ICAV;AAAZ,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACvB,CAAC,EAJW,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;;ACAzB;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare enum NexusAppEnvironment {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
development = "development",
|
|
3
|
+
production = "production"
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
declare const SUPPORTED_LOCALE_CODES: readonly ["zh-cn", "en-us"];
|
|
@@ -96,10 +96,6 @@ interface NavigationWorkItem {
|
|
|
96
96
|
workItemId: string;
|
|
97
97
|
}
|
|
98
98
|
type NavigationLocation = NavigationWorkItem;
|
|
99
|
-
interface NavigatePayload {
|
|
100
|
-
url?: string;
|
|
101
|
-
location?: NavigationLocation;
|
|
102
|
-
}
|
|
103
99
|
|
|
104
100
|
interface EventCallbackParams {
|
|
105
101
|
payload?: any;
|
|
@@ -138,15 +134,78 @@ interface SelectMemberDialogOptions {
|
|
|
138
134
|
selection?: string[];
|
|
139
135
|
onConfirm?: (payload?: string[]) => Promise<void>;
|
|
140
136
|
}
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
interface SelectMemberPopBaseOptions {
|
|
138
|
+
origin: HTMLElement;
|
|
139
|
+
}
|
|
140
|
+
interface MultipleSelectOptions extends SelectMemberPopBaseOptions {
|
|
141
|
+
multiple: true;
|
|
143
142
|
selection?: string[];
|
|
144
|
-
onConfirm?: (
|
|
145
|
-
}
|
|
143
|
+
onConfirm?: (ids?: string[]) => Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
interface SingleSelectOptions extends SelectMemberPopBaseOptions {
|
|
146
146
|
multiple?: false;
|
|
147
147
|
selection?: string;
|
|
148
|
-
onConfirm?: (
|
|
149
|
-
}
|
|
148
|
+
onConfirm?: (id?: string) => Promise<void>;
|
|
149
|
+
}
|
|
150
|
+
type SelectMemberPopOptions = MultipleSelectOptions | SingleSelectOptions;
|
|
151
|
+
|
|
152
|
+
interface RequestApiResponseData {
|
|
153
|
+
status: number;
|
|
154
|
+
headers?: Record<string, string>;
|
|
155
|
+
body?: Record<string, any>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare enum NotifyType {
|
|
159
|
+
success = "success",
|
|
160
|
+
error = "error",
|
|
161
|
+
warning = "warning",
|
|
162
|
+
info = "info"
|
|
163
|
+
}
|
|
164
|
+
interface NotifyOptions {
|
|
165
|
+
type?: NotifyType;
|
|
166
|
+
title?: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
detail?: string | NotifyDetail;
|
|
169
|
+
actions?: NotifyAction[];
|
|
170
|
+
isAutoClose?: boolean;
|
|
171
|
+
}
|
|
172
|
+
interface NotifyRef {
|
|
173
|
+
close: () => void;
|
|
174
|
+
}
|
|
175
|
+
interface NotifyDetail {
|
|
176
|
+
link?: string;
|
|
177
|
+
content?: string;
|
|
178
|
+
}
|
|
179
|
+
interface NotifyAction {
|
|
180
|
+
text: string;
|
|
181
|
+
icon?: string;
|
|
182
|
+
onClick: (event?: Event) => void;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare enum HistoryAction {
|
|
186
|
+
pop = "POP",
|
|
187
|
+
push = "PUSH",
|
|
188
|
+
replace = "REPLACE"
|
|
189
|
+
}
|
|
190
|
+
interface LocationDescriptor {
|
|
191
|
+
pathname: string;
|
|
192
|
+
search?: string;
|
|
193
|
+
hash?: string;
|
|
194
|
+
state?: unknown;
|
|
195
|
+
}
|
|
196
|
+
type UnlistenCallback = () => void;
|
|
197
|
+
interface NexusHistory {
|
|
198
|
+
action: HistoryAction;
|
|
199
|
+
location: LocationDescriptor;
|
|
200
|
+
push(path: string, state?: unknown): void;
|
|
201
|
+
push(location: LocationDescriptor): void;
|
|
202
|
+
replace(path: string, state?: unknown): void;
|
|
203
|
+
replace(location: LocationDescriptor): void;
|
|
204
|
+
go(n: number): void;
|
|
205
|
+
goBack(): void;
|
|
206
|
+
goForward(): void;
|
|
207
|
+
listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;
|
|
208
|
+
}
|
|
150
209
|
|
|
151
|
-
export { NavigationTarget, NexusAppEnvironment, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
152
|
-
export type { DialogOptions, DialogRef, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, InvokeFunctionParams,
|
|
210
|
+
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
211
|
+
export type { DialogOptions, DialogRef, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, RequestApiResponseData, SelectMemberDialogOptions, SelectMemberPopOptions, SingleSelectOptions, Subscription, TranslationResourceContent, Translator, UnlistenCallback, Viewport, WorkItemOpenCreateOptions };
|