@pc-nexus/models 0.5.0-next.8 → 0.5.0
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.
- package/fesm2022/pc-nexus-models.mjs +31 -37
- package/fesm2022/pc-nexus-models.mjs.map +1 -1
- package/package.json +1 -1
- package/types/pc-nexus-models.d.ts +264 -166
|
@@ -1,60 +1,54 @@
|
|
|
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"];
|
|
8
8
|
|
|
9
9
|
var NavigationTarget;
|
|
10
10
|
(function (NavigationTarget) {
|
|
11
|
-
NavigationTarget["
|
|
12
|
-
NavigationTarget["
|
|
13
|
-
NavigationTarget["
|
|
14
|
-
NavigationTarget["
|
|
15
|
-
NavigationTarget["
|
|
16
|
-
NavigationTarget["
|
|
17
|
-
NavigationTarget["
|
|
18
|
-
NavigationTarget["
|
|
19
|
-
NavigationTarget["
|
|
11
|
+
NavigationTarget["Workitem"] = "workitem";
|
|
12
|
+
NavigationTarget["Testcase"] = "testcase";
|
|
13
|
+
NavigationTarget["Page"] = "page";
|
|
14
|
+
NavigationTarget["Idea"] = "idea";
|
|
15
|
+
NavigationTarget["Ticket"] = "ticket";
|
|
16
|
+
NavigationTarget["Project"] = "project";
|
|
17
|
+
NavigationTarget["Library"] = "library";
|
|
18
|
+
NavigationTarget["Space"] = "space";
|
|
19
|
+
NavigationTarget["Product"] = "product";
|
|
20
20
|
})(NavigationTarget || (NavigationTarget = {}));
|
|
21
21
|
|
|
22
22
|
var NotifyType;
|
|
23
23
|
(function (NotifyType) {
|
|
24
|
-
NotifyType["
|
|
25
|
-
NotifyType["
|
|
26
|
-
NotifyType["
|
|
27
|
-
NotifyType["
|
|
24
|
+
NotifyType["Success"] = "success";
|
|
25
|
+
NotifyType["Error"] = "error";
|
|
26
|
+
NotifyType["Warning"] = "warning";
|
|
27
|
+
NotifyType["Info"] = "info";
|
|
28
28
|
})(NotifyType || (NotifyType = {}));
|
|
29
29
|
|
|
30
30
|
const NEXUS_CONTENT_UPDATE_EVENT = "nexus:content:update";
|
|
31
31
|
const NEXUS_CONTENT_CHANGE_EVENT = "nexus:content:change";
|
|
32
|
+
const NEXUS_CONFIG_READY_EVENT = "nexus:config:ready";
|
|
33
|
+
|
|
34
|
+
/** Host → Child:派发虚拟 DOM 节点事件 */
|
|
35
|
+
const HOST_DISPATCH_NATIVE_UI_EVENT = "hostDispatchToNativeUiEvent";
|
|
32
36
|
|
|
33
37
|
var HistoryAction;
|
|
34
38
|
(function (HistoryAction) {
|
|
35
|
-
HistoryAction["
|
|
36
|
-
HistoryAction["
|
|
37
|
-
HistoryAction["
|
|
39
|
+
HistoryAction["Pop"] = "POP";
|
|
40
|
+
HistoryAction["Push"] = "PUSH";
|
|
41
|
+
HistoryAction["Replace"] = "REPLACE";
|
|
38
42
|
})(HistoryAction || (HistoryAction = {}));
|
|
39
43
|
|
|
40
|
-
var
|
|
41
|
-
(function (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})(ViewportSize || (ViewportSize = {}));
|
|
49
|
-
|
|
50
|
-
var WorkItemTypeGroup;
|
|
51
|
-
(function (WorkItemTypeGroup) {
|
|
52
|
-
WorkItemTypeGroup[WorkItemTypeGroup["requirement"] = 1] = "requirement";
|
|
53
|
-
WorkItemTypeGroup[WorkItemTypeGroup["task"] = 2] = "task";
|
|
54
|
-
WorkItemTypeGroup[WorkItemTypeGroup["bug"] = 3] = "bug";
|
|
55
|
-
WorkItemTypeGroup[WorkItemTypeGroup["issue"] = 4] = "issue";
|
|
56
|
-
WorkItemTypeGroup[WorkItemTypeGroup["plan"] = 5] = "plan";
|
|
57
|
-
})(WorkItemTypeGroup || (WorkItemTypeGroup = {}));
|
|
44
|
+
var WorkitemTypeGroup;
|
|
45
|
+
(function (WorkitemTypeGroup) {
|
|
46
|
+
WorkitemTypeGroup[WorkitemTypeGroup["Requirement"] = 1] = "Requirement";
|
|
47
|
+
WorkitemTypeGroup[WorkitemTypeGroup["Task"] = 2] = "Task";
|
|
48
|
+
WorkitemTypeGroup[WorkitemTypeGroup["Bug"] = 3] = "Bug";
|
|
49
|
+
WorkitemTypeGroup[WorkitemTypeGroup["Issue"] = 4] = "Issue";
|
|
50
|
+
WorkitemTypeGroup[WorkitemTypeGroup["Plan"] = 5] = "Plan";
|
|
51
|
+
})(WorkitemTypeGroup || (WorkitemTypeGroup = {}));
|
|
58
52
|
|
|
59
53
|
/*
|
|
60
54
|
* Public API Surface of models
|
|
@@ -64,5 +58,5 @@ var WorkItemTypeGroup;
|
|
|
64
58
|
* Generated bundle index. Do not edit.
|
|
65
59
|
*/
|
|
66
60
|
|
|
67
|
-
export { HistoryAction, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES,
|
|
61
|
+
export { HOST_DISPATCH_NATIVE_UI_EVENT, HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, WorkitemTypeGroup };
|
|
68
62
|
//# 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/notify.ts","../../../../web/models/src/richtext.ts","../../../../web/models/src/
|
|
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/notify.ts","../../../../web/models/src/richtext.ts","../../../../web/models/src/v-dom.ts","../../../../web/models/src/view.ts","../../../../web/models/src/workitem.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 SupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];\n\nexport interface Translator {\n translate: (key: string, params?: Record<string, any>) => TranslationsResourceContent | string;\n}\nexport interface GetTranslationsResult {\n locale: SupportedLocaleCode;\n translations: TranslationsResourceContent | null;\n}\n\nexport interface TranslationsResourceContent {\n [key: string]: string | TranslationsResourceContent;\n}\n","export enum NavigationTarget {\n Workitem = \"workitem\",\n Testcase = \"testcase\",\n Page = \"page\",\n Idea = \"idea\",\n Ticket = \"ticket\",\n Project = \"project\",\n Library = \"library\",\n Space = \"space\",\n Product = \"product\",\n}\n\ninterface NavigationTargetParams {\n target: NavigationTarget;\n id: string;\n}\n\nexport type NavigationLocation = NavigationTargetParams;\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 readonly 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 const NEXUS_CONTENT_UPDATE_EVENT = \"nexus:content:update\";\nexport const NEXUS_CONTENT_CHANGE_EVENT = \"nexus:content:change\";\nexport const NEXUS_CONFIG_READY_EVENT = \"nexus:config:ready\";\n\nexport interface RichtextText {\n text: string;\n [key: string]: unknown;\n}\n\nexport interface RichtextElement {\n type: string;\n children: (RichtextDescendant | RichtextText)[];\n [key: string]: unknown;\n}\n\nexport type RichtextDescendant = RichtextElement;\nexport type RichtextContent = RichtextDescendant[];\n\nexport interface RichtextRendererRef {\n readonly iframe: HTMLIFrameElement;\n readonly update: (content: RichtextContent) => void;\n}\n\nexport interface RichtextEditorRef extends RichtextRendererRef {\n readonly destroy: () => void;\n}\n\nexport interface RichtextRendererOptions {\n content?: RichtextContent;\n}\n\nexport interface RichtextEditorOptions extends RichtextRendererOptions {\n onContentChange?: (content: RichtextContent) => void;\n}\n\nexport interface RichtextBridgeMessage {\n type: string;\n content?: any;\n timestamp?: number;\n source?: string;\n readonly?: boolean;\n}\n","export interface VirtualNodeSnapshot {\n kind: string;\n id: number;\n tagName?: string;\n namespace?: string | null;\n value?: string;\n attributes?: Record<string, string>;\n classes?: string[];\n styles?: Record<string, VirtualStyle>;\n properties?: Record<string, unknown>;\n listeners?: VirtualListener[];\n children?: VirtualNodeSnapshot[];\n}\n\nexport interface VirtualStyle {\n value: string;\n flags?: number;\n}\n\nexport interface VirtualListener {\n name: string;\n id: string;\n options?: unknown;\n}\n\nexport interface DispatchEventPayload {\n id: string;\n name: string;\n nodeId: number;\n /** 组件 output 等场景下的回调参数(如 Switch 的 checked 值) */\n detail?: unknown;\n}\n\n/** Host → Child:派发虚拟 DOM 节点事件 */\nexport const HOST_DISPATCH_NATIVE_UI_EVENT = \"hostDispatchToNativeUiEvent\";\n","export enum HistoryAction {\n Pop = \"POP\",\n Push = \"PUSH\",\n Replace = \"REPLACE\",\n}\n\nexport interface HistoryPath {\n pathname: string;\n search: string;\n hash: string;\n}\n\nexport type HistoryTo = string | Partial<HistoryPath>;\n\nexport type HistoryState = unknown;\n\nexport interface HistoryLocation extends HistoryPath {\n state: HistoryState;\n}\n\nexport interface HistoryUpdate {\n action: HistoryAction;\n location: HistoryLocation;\n}\n\nexport interface HistoryListener {\n (update: HistoryUpdate): void;\n}\n\nexport type UnlistenCallback = () => void;\n\nexport interface NexusHistory {\n action: HistoryAction;\n location: HistoryLocation;\n push(to: HistoryTo, state?: HistoryState): void;\n replace(to: HistoryTo, state?: HistoryState): void;\n go(delta: number): void;\n back(): void;\n forward(): void;\n listen(listener: HistoryListener): Promise<UnlistenCallback>;\n}\n","export enum WorkitemTypeGroup {\n Requirement = 1,\n Task = 2,\n Bug = 3,\n Issue = 4,\n Plan = 5,\n}\n\nexport interface Workitem {\n id: string;\n short_id: string;\n identifier: string;\n title: string;\n type_group?: WorkitemTypeGroup;\n type_id?: string;\n}\n\nexport interface WorkitemOpenCreateOptions {\n defaultValues?: {\n title?: string;\n project_id?: string;\n description?: string;\n };\n onSuccess?: (payload: Workitem) => void;\n}\n","/*\n * Public API Surface of models\n */\n\nexport * from \"./api\";\nexport * from \"./baseline\";\nexport * from \"./condition\";\nexport * from \"./context\";\nexport * from \"./dialog\";\nexport * from \"./environment\";\nexport * from \"./events\";\nexport * from \"./extension\";\nexport * from \"./idea\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./notify\";\nexport * from \"./page\";\nexport * from \"./processor\";\nexport * from \"./remote\";\nexport * from \"./richtext\";\nexport * from \"./store\";\nexport * from \"./testcase\";\nexport * from \"./ticket\";\nexport * from \"./user\";\nexport * from \"./v-dom\";\nexport * from \"./view\";\nexport * from \"./viewport\";\nexport * from \"./workitem\";\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;AACrB,IAAA,gBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACvB,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ICAhB;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;;ACAf,MAAM,0BAA0B,GAAG;AACnC,MAAM,0BAA0B,GAAG;AACnC,MAAM,wBAAwB,GAAG;;AC+BxC;AACO,MAAM,6BAA6B,GAAG;;IClCjC;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;;ICAb;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAe;AACf,IAAA,iBAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,iBAAA,CAAA,iBAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAO;AACP,IAAA,iBAAA,CAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS;AACT,IAAA,iBAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACZ,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,GAAA,EAAA,CAAA,CAAA;;ACA7B;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
|
+
interface InvokeResponseData {
|
|
2
|
+
status: number;
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
body?: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
type ApiInvokeOptions = Omit<RequestInit, "signal">;
|
|
7
|
+
|
|
8
|
+
interface Baseline {
|
|
9
|
+
id: string;
|
|
10
|
+
short_id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type ConditionPrimitive = string | number | boolean | null;
|
|
15
|
+
type ConditionValue = ConditionPrimitive | ConditionPrimitive[];
|
|
16
|
+
interface Conditions {
|
|
17
|
+
and?: Conditions;
|
|
18
|
+
or?: Conditions;
|
|
19
|
+
not?: Conditions;
|
|
20
|
+
hasPermission?: string;
|
|
21
|
+
isAdmin?: boolean;
|
|
22
|
+
isLoggedIn?: boolean;
|
|
23
|
+
[path: string]: ConditionValue | Conditions | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
1
26
|
declare enum NexusAppEnvironment {
|
|
2
|
-
|
|
3
|
-
|
|
27
|
+
Development = "development",
|
|
28
|
+
Production = "production"
|
|
4
29
|
}
|
|
5
30
|
|
|
6
31
|
declare const SUPPORTED_LOCALE_CODES: readonly ["zh-CN", "en-US"];
|
|
7
|
-
type
|
|
32
|
+
type SupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];
|
|
8
33
|
interface Translator {
|
|
9
|
-
translate: (key: string, params?: Record<string, any>) =>
|
|
34
|
+
translate: (key: string, params?: Record<string, any>) => TranslationsResourceContent | string;
|
|
10
35
|
}
|
|
11
36
|
interface GetTranslationsResult {
|
|
12
|
-
locale:
|
|
13
|
-
translations:
|
|
37
|
+
locale: SupportedLocaleCode;
|
|
38
|
+
translations: TranslationsResourceContent | null;
|
|
14
39
|
}
|
|
15
|
-
interface
|
|
16
|
-
[key: string]: string |
|
|
40
|
+
interface TranslationsResourceContent {
|
|
41
|
+
[key: string]: string | TranslationsResourceContent;
|
|
17
42
|
}
|
|
18
43
|
|
|
19
44
|
type ExtensionData = Record<string, any>;
|
|
20
|
-
interface
|
|
45
|
+
interface NexusAppContext<T = ExtensionData> {
|
|
21
46
|
app: {
|
|
22
47
|
id: string;
|
|
23
48
|
version: string;
|
|
@@ -29,7 +54,7 @@ interface NexusFullContext<T = ExtensionData> {
|
|
|
29
54
|
team: {
|
|
30
55
|
id: string;
|
|
31
56
|
url: string;
|
|
32
|
-
locale:
|
|
57
|
+
locale: SupportedLocaleCode;
|
|
33
58
|
timezone: string;
|
|
34
59
|
};
|
|
35
60
|
installation: {
|
|
@@ -37,7 +62,7 @@ interface NexusFullContext<T = ExtensionData> {
|
|
|
37
62
|
};
|
|
38
63
|
user: {
|
|
39
64
|
id: string;
|
|
40
|
-
locale:
|
|
65
|
+
locale: SupportedLocaleCode;
|
|
41
66
|
timezone: string;
|
|
42
67
|
};
|
|
43
68
|
extension: {
|
|
@@ -52,16 +77,9 @@ interface NexusFullContext<T = ExtensionData> {
|
|
|
52
77
|
interface Viewport {
|
|
53
78
|
size?: ViewportSize;
|
|
54
79
|
}
|
|
55
|
-
|
|
56
|
-
small = "small",
|
|
57
|
-
medium = "medium",
|
|
58
|
-
large = "large",
|
|
59
|
-
xlarge = "xlarge",
|
|
60
|
-
max = "max",
|
|
61
|
-
fullscreen = "fullscreen"
|
|
62
|
-
}
|
|
80
|
+
type ViewportSize = "small" | "medium" | "large" | "xlarge" | "max" | "fullscreen";
|
|
63
81
|
|
|
64
|
-
interface
|
|
82
|
+
interface DialogOpenOptions {
|
|
65
83
|
resource: string;
|
|
66
84
|
size?: ViewportSize;
|
|
67
85
|
context?: Record<string, unknown>;
|
|
@@ -71,7 +89,7 @@ interface DialogOptions {
|
|
|
71
89
|
icon?: string;
|
|
72
90
|
}
|
|
73
91
|
interface DialogRef<T = unknown> {
|
|
74
|
-
close: (payload?: T) => void;
|
|
92
|
+
readonly close: (payload?: T) => void;
|
|
75
93
|
}
|
|
76
94
|
interface DialogConfirmOptions {
|
|
77
95
|
content: string;
|
|
@@ -85,16 +103,18 @@ interface Subscription {
|
|
|
85
103
|
unsubscribe: () => void;
|
|
86
104
|
}
|
|
87
105
|
|
|
88
|
-
interface ExtensionProperties {
|
|
106
|
+
interface ExtensionProperties<T extends Conditions = Conditions> {
|
|
89
107
|
key: string;
|
|
90
108
|
resolver: {
|
|
91
109
|
function: string;
|
|
92
110
|
};
|
|
93
111
|
resource: string;
|
|
112
|
+
render?: string;
|
|
94
113
|
resource_upload_id: string;
|
|
95
114
|
title: string;
|
|
96
115
|
icon?: string;
|
|
97
116
|
viewport?: Viewport;
|
|
117
|
+
display?: T;
|
|
98
118
|
}
|
|
99
119
|
interface EgressItem {
|
|
100
120
|
addresses: string[];
|
|
@@ -116,21 +136,35 @@ interface NexusAppExtension<T extends ExtensionProperties = ExtensionProperties>
|
|
|
116
136
|
resource_ports?: Record<string, number>;
|
|
117
137
|
}
|
|
118
138
|
|
|
139
|
+
interface Idea {
|
|
140
|
+
id: string;
|
|
141
|
+
short_id: string;
|
|
142
|
+
identifier: string;
|
|
143
|
+
title: string;
|
|
144
|
+
}
|
|
145
|
+
interface IdeaOpenCreateOptions {
|
|
146
|
+
defaultValues?: {
|
|
147
|
+
title?: string;
|
|
148
|
+
product_id?: string;
|
|
149
|
+
};
|
|
150
|
+
onSuccess?: (payload: Idea) => void;
|
|
151
|
+
}
|
|
152
|
+
|
|
119
153
|
interface InvokeFunctionParams<T = unknown> {
|
|
120
154
|
function: string;
|
|
121
155
|
payload: T;
|
|
122
156
|
}
|
|
123
157
|
|
|
124
158
|
declare enum NavigationTarget {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
159
|
+
Workitem = "workitem",
|
|
160
|
+
Testcase = "testcase",
|
|
161
|
+
Page = "page",
|
|
162
|
+
Idea = "idea",
|
|
163
|
+
Ticket = "ticket",
|
|
164
|
+
Project = "project",
|
|
165
|
+
Library = "library",
|
|
166
|
+
Space = "space",
|
|
167
|
+
Product = "product"
|
|
134
168
|
}
|
|
135
169
|
interface NavigationTargetParams {
|
|
136
170
|
target: NavigationTarget;
|
|
@@ -139,10 +173,10 @@ interface NavigationTargetParams {
|
|
|
139
173
|
type NavigationLocation = NavigationTargetParams;
|
|
140
174
|
|
|
141
175
|
declare enum NotifyType {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
176
|
+
Success = "success",
|
|
177
|
+
Error = "error",
|
|
178
|
+
Warning = "warning",
|
|
179
|
+
Info = "info"
|
|
146
180
|
}
|
|
147
181
|
interface NotifyOptions {
|
|
148
182
|
type: NotifyType;
|
|
@@ -153,7 +187,7 @@ interface NotifyOptions {
|
|
|
153
187
|
isAutoClose?: boolean;
|
|
154
188
|
}
|
|
155
189
|
interface NotifyRef {
|
|
156
|
-
close: () => void;
|
|
190
|
+
readonly close: () => void;
|
|
157
191
|
}
|
|
158
192
|
interface NotifyDetail {
|
|
159
193
|
link?: string;
|
|
@@ -165,53 +199,91 @@ interface NotifyAction {
|
|
|
165
199
|
onClick: (event?: Event) => void;
|
|
166
200
|
}
|
|
167
201
|
|
|
202
|
+
interface Page {
|
|
203
|
+
id: string;
|
|
204
|
+
short_id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
}
|
|
207
|
+
interface PageOpenCreateOptions {
|
|
208
|
+
onSuccess?: (payload: Page) => void;
|
|
209
|
+
}
|
|
210
|
+
|
|
168
211
|
type ProcessOptions = File | CustomProcessItem;
|
|
169
212
|
interface CustomProcessItem {
|
|
170
213
|
name: string;
|
|
171
214
|
icon?: string;
|
|
172
215
|
}
|
|
173
216
|
interface ProcessRef {
|
|
174
|
-
id: string;
|
|
175
|
-
setProgress(progress: number)
|
|
176
|
-
complete(payload?: {
|
|
217
|
+
readonly id: string;
|
|
218
|
+
readonly setProgress: (progress: number) => void;
|
|
219
|
+
readonly complete: (payload?: {
|
|
177
220
|
fileUrl?: string;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
cancel(): void;
|
|
221
|
+
}) => void;
|
|
222
|
+
readonly error: (message: string) => void;
|
|
223
|
+
readonly cancel: () => void;
|
|
182
224
|
}
|
|
183
225
|
|
|
184
|
-
|
|
226
|
+
type RemoteInvokeOptions = {
|
|
227
|
+
path: string;
|
|
228
|
+
} & Pick<RequestInit, "headers" | "body" | "method">;
|
|
229
|
+
type RemoteRequestOptions = {
|
|
230
|
+
path: string;
|
|
231
|
+
} & Omit<RequestInit, "signal">;
|
|
232
|
+
interface RemoteSerializedBlob {
|
|
233
|
+
__isBlobData: true;
|
|
234
|
+
data: string;
|
|
235
|
+
type: string;
|
|
236
|
+
name?: string;
|
|
237
|
+
}
|
|
238
|
+
interface RemoteSerializedFormDataEntry {
|
|
239
|
+
name: string;
|
|
240
|
+
value: string | RemoteSerializedBlob;
|
|
241
|
+
}
|
|
242
|
+
type RemoteRequestBody = string | RemoteSerializedFormDataEntry[];
|
|
243
|
+
interface RemoteRequestSerializedInit extends Omit<RequestInit, "body" | "headers" | "signal"> {
|
|
244
|
+
method: string;
|
|
245
|
+
headers?: Record<string, string>;
|
|
246
|
+
body?: RemoteRequestBody;
|
|
247
|
+
}
|
|
248
|
+
interface RemoteRequestPayload {
|
|
249
|
+
remoteKey: string;
|
|
250
|
+
path: string;
|
|
251
|
+
requestInit: RemoteRequestSerializedInit;
|
|
252
|
+
isMultipartFormData: boolean;
|
|
253
|
+
}
|
|
254
|
+
interface RemoteRequestResponseData {
|
|
185
255
|
status: number;
|
|
256
|
+
statusText?: string;
|
|
186
257
|
headers?: Record<string, string>;
|
|
187
|
-
body?:
|
|
258
|
+
body?: string;
|
|
259
|
+
isBinaryContent?: boolean;
|
|
188
260
|
}
|
|
189
|
-
type NexusRequestInit = Omit<RequestInit, "signal">;
|
|
190
261
|
|
|
191
262
|
declare const NEXUS_CONTENT_UPDATE_EVENT = "nexus:content:update";
|
|
192
263
|
declare const NEXUS_CONTENT_CHANGE_EVENT = "nexus:content:change";
|
|
264
|
+
declare const NEXUS_CONFIG_READY_EVENT = "nexus:config:ready";
|
|
193
265
|
interface RichtextText {
|
|
194
266
|
text: string;
|
|
195
267
|
[key: string]: unknown;
|
|
196
268
|
}
|
|
197
269
|
interface RichtextElement {
|
|
198
270
|
type: string;
|
|
199
|
-
children:
|
|
271
|
+
children: (RichtextDescendant | RichtextText)[];
|
|
200
272
|
[key: string]: unknown;
|
|
201
273
|
}
|
|
202
|
-
type
|
|
203
|
-
type RichtextContent =
|
|
274
|
+
type RichtextDescendant = RichtextElement;
|
|
275
|
+
type RichtextContent = RichtextDescendant[];
|
|
204
276
|
interface RichtextRendererRef {
|
|
205
|
-
iframe: HTMLIFrameElement;
|
|
206
|
-
update: (content: RichtextContent) => void;
|
|
277
|
+
readonly iframe: HTMLIFrameElement;
|
|
278
|
+
readonly update: (content: RichtextContent) => void;
|
|
207
279
|
}
|
|
208
280
|
interface RichtextEditorRef extends RichtextRendererRef {
|
|
209
|
-
destroy: () => void;
|
|
281
|
+
readonly destroy: () => void;
|
|
210
282
|
}
|
|
211
|
-
interface
|
|
283
|
+
interface RichtextRendererOptions {
|
|
212
284
|
content?: RichtextContent;
|
|
213
285
|
}
|
|
214
|
-
interface
|
|
286
|
+
interface RichtextEditorOptions extends RichtextRendererOptions {
|
|
215
287
|
onContentChange?: (content: RichtextContent) => void;
|
|
216
288
|
}
|
|
217
289
|
interface RichtextBridgeMessage {
|
|
@@ -221,156 +293,182 @@ interface RichtextBridgeMessage {
|
|
|
221
293
|
source?: string;
|
|
222
294
|
readonly?: boolean;
|
|
223
295
|
}
|
|
224
|
-
interface IframeResizerApi {
|
|
225
|
-
sendMessage: (message: unknown, targetOrigin?: string) => void;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
interface SelectMemberDialogOptions {
|
|
229
|
-
title?: string;
|
|
230
|
-
selection?: string[];
|
|
231
|
-
onConfirm: (payload?: string[]) => Promise<void>;
|
|
232
|
-
}
|
|
233
|
-
interface SelectMemberPopBaseOptions {
|
|
234
|
-
origin: HTMLElement;
|
|
235
|
-
}
|
|
236
|
-
interface MultipleSelectOptions extends SelectMemberPopBaseOptions {
|
|
237
|
-
multiple: true;
|
|
238
|
-
selection?: string[];
|
|
239
|
-
onConfirm?: (ids?: string[]) => Promise<void>;
|
|
240
|
-
}
|
|
241
|
-
interface SingleSelectOptions extends SelectMemberPopBaseOptions {
|
|
242
|
-
multiple?: false;
|
|
243
|
-
selection?: string;
|
|
244
|
-
onConfirm?: (id?: string) => Promise<void>;
|
|
245
|
-
}
|
|
246
|
-
type SelectMemberPopOptions = MultipleSelectOptions | SingleSelectOptions;
|
|
247
296
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
297
|
+
interface UploadResult {
|
|
298
|
+
success: boolean;
|
|
299
|
+
key: string;
|
|
300
|
+
status?: number;
|
|
301
|
+
error?: string;
|
|
252
302
|
}
|
|
253
|
-
interface
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
303
|
+
interface DownloadResult {
|
|
304
|
+
success: boolean;
|
|
305
|
+
key: string;
|
|
306
|
+
blob?: Blob;
|
|
307
|
+
name?: string;
|
|
308
|
+
status?: number;
|
|
309
|
+
error?: string;
|
|
258
310
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
go(n: number): void;
|
|
268
|
-
goBack(): void;
|
|
269
|
-
goForward(): void;
|
|
270
|
-
listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;
|
|
311
|
+
interface GetMetadataResult {
|
|
312
|
+
key: string;
|
|
313
|
+
name: string;
|
|
314
|
+
mime_type: string;
|
|
315
|
+
checksum: string;
|
|
316
|
+
size: number;
|
|
317
|
+
created_at: string;
|
|
318
|
+
error?: string;
|
|
271
319
|
}
|
|
272
320
|
|
|
273
|
-
|
|
274
|
-
requirement = 1,
|
|
275
|
-
task = 2,
|
|
276
|
-
bug = 3,
|
|
277
|
-
issue = 4,
|
|
278
|
-
plan = 5
|
|
279
|
-
}
|
|
280
|
-
interface WorkItem {
|
|
321
|
+
interface Testcase {
|
|
281
322
|
id: string;
|
|
282
323
|
short_id: string;
|
|
283
324
|
identifier: string;
|
|
284
325
|
title: string;
|
|
285
|
-
type_group?: WorkItemTypeGroup;
|
|
286
|
-
type_id?: string;
|
|
287
326
|
}
|
|
288
|
-
interface
|
|
327
|
+
interface TestcaseOpenCreateOptions {
|
|
289
328
|
defaultValues?: {
|
|
290
329
|
title?: string;
|
|
291
|
-
|
|
330
|
+
library_id?: string;
|
|
292
331
|
};
|
|
293
|
-
onSuccess?: (payload:
|
|
332
|
+
onSuccess?: (payload: Testcase) => void;
|
|
294
333
|
}
|
|
295
334
|
|
|
296
|
-
interface
|
|
335
|
+
interface Ticket {
|
|
297
336
|
id: string;
|
|
298
337
|
short_id: string;
|
|
299
338
|
identifier: string;
|
|
300
339
|
title: string;
|
|
301
340
|
}
|
|
302
|
-
interface
|
|
341
|
+
interface TicketOpenCreateOptions {
|
|
303
342
|
defaultValues?: {
|
|
304
343
|
title?: string;
|
|
305
344
|
product_id?: string;
|
|
306
345
|
};
|
|
307
|
-
onSuccess?: (payload:
|
|
346
|
+
onSuccess?: (payload: Ticket) => void;
|
|
308
347
|
}
|
|
309
348
|
|
|
310
|
-
interface
|
|
349
|
+
interface UserInfo {
|
|
311
350
|
id: string;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
title: string;
|
|
351
|
+
display_name?: string;
|
|
352
|
+
name?: string;
|
|
315
353
|
}
|
|
316
|
-
interface
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
onSuccess?: (payload: TestCase) => void;
|
|
354
|
+
interface UserOpenDialogOptions {
|
|
355
|
+
title?: string;
|
|
356
|
+
selection?: string[];
|
|
357
|
+
onConfirm: (ids?: string[], users?: UserInfo[]) => Promise<void>;
|
|
358
|
+
onClose?: () => void;
|
|
322
359
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
id: string;
|
|
326
|
-
short_id: string;
|
|
327
|
-
identifier: string;
|
|
328
|
-
title: string;
|
|
360
|
+
interface SelectUserPopBaseOptions {
|
|
361
|
+
origin: HTMLElement;
|
|
329
362
|
}
|
|
330
|
-
interface
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
363
|
+
interface MultipleUserOpenPopoverOptions extends SelectUserPopBaseOptions {
|
|
364
|
+
multiple: true;
|
|
365
|
+
selection?: string[];
|
|
366
|
+
onConfirm: (ids?: string[], users?: UserInfo[]) => Promise<void>;
|
|
367
|
+
onClose?: () => void;
|
|
368
|
+
}
|
|
369
|
+
interface SingleUserOpenPopoverOptions extends SelectUserPopBaseOptions {
|
|
370
|
+
multiple?: false;
|
|
371
|
+
selection?: string;
|
|
372
|
+
onConfirm: (id?: string, user?: UserInfo) => Promise<void>;
|
|
373
|
+
onClose?: () => void;
|
|
374
|
+
}
|
|
375
|
+
type UserOpenPopoverOptions = MultipleUserOpenPopoverOptions | SingleUserOpenPopoverOptions;
|
|
376
|
+
interface UserOpenPopoverRef {
|
|
377
|
+
readonly close: () => void;
|
|
378
|
+
}
|
|
379
|
+
interface UserOpenDialogRef {
|
|
380
|
+
readonly close: () => void;
|
|
336
381
|
}
|
|
337
382
|
|
|
338
|
-
interface
|
|
339
|
-
|
|
340
|
-
|
|
383
|
+
interface VirtualNodeSnapshot {
|
|
384
|
+
kind: string;
|
|
385
|
+
id: number;
|
|
386
|
+
tagName?: string;
|
|
387
|
+
namespace?: string | null;
|
|
388
|
+
value?: string;
|
|
389
|
+
attributes?: Record<string, string>;
|
|
390
|
+
classes?: string[];
|
|
391
|
+
styles?: Record<string, VirtualStyle>;
|
|
392
|
+
properties?: Record<string, unknown>;
|
|
393
|
+
listeners?: VirtualListener[];
|
|
394
|
+
children?: VirtualNodeSnapshot[];
|
|
395
|
+
}
|
|
396
|
+
interface VirtualStyle {
|
|
397
|
+
value: string;
|
|
398
|
+
flags?: number;
|
|
399
|
+
}
|
|
400
|
+
interface VirtualListener {
|
|
341
401
|
name: string;
|
|
402
|
+
id: string;
|
|
403
|
+
options?: unknown;
|
|
342
404
|
}
|
|
343
|
-
interface
|
|
344
|
-
|
|
405
|
+
interface DispatchEventPayload {
|
|
406
|
+
id: string;
|
|
407
|
+
name: string;
|
|
408
|
+
nodeId: number;
|
|
409
|
+
/** 组件 output 等场景下的回调参数(如 Switch 的 checked 值) */
|
|
410
|
+
detail?: unknown;
|
|
345
411
|
}
|
|
412
|
+
/** Host → Child:派发虚拟 DOM 节点事件 */
|
|
413
|
+
declare const HOST_DISPATCH_NATIVE_UI_EVENT = "hostDispatchToNativeUiEvent";
|
|
346
414
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
error?: string;
|
|
352
|
-
blob: Blob;
|
|
415
|
+
declare enum HistoryAction {
|
|
416
|
+
Pop = "POP",
|
|
417
|
+
Push = "PUSH",
|
|
418
|
+
Replace = "REPLACE"
|
|
353
419
|
}
|
|
354
|
-
interface
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
status?: number;
|
|
359
|
-
error?: string;
|
|
420
|
+
interface HistoryPath {
|
|
421
|
+
pathname: string;
|
|
422
|
+
search: string;
|
|
423
|
+
hash: string;
|
|
360
424
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
createdAt?: string;
|
|
366
|
-
currentVersion?: string;
|
|
367
|
-
error?: string;
|
|
425
|
+
type HistoryTo = string | Partial<HistoryPath>;
|
|
426
|
+
type HistoryState = unknown;
|
|
427
|
+
interface HistoryLocation extends HistoryPath {
|
|
428
|
+
state: HistoryState;
|
|
368
429
|
}
|
|
369
|
-
interface
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
430
|
+
interface HistoryUpdate {
|
|
431
|
+
action: HistoryAction;
|
|
432
|
+
location: HistoryLocation;
|
|
433
|
+
}
|
|
434
|
+
interface HistoryListener {
|
|
435
|
+
(update: HistoryUpdate): void;
|
|
436
|
+
}
|
|
437
|
+
type UnlistenCallback = () => void;
|
|
438
|
+
interface NexusHistory {
|
|
439
|
+
action: HistoryAction;
|
|
440
|
+
location: HistoryLocation;
|
|
441
|
+
push(to: HistoryTo, state?: HistoryState): void;
|
|
442
|
+
replace(to: HistoryTo, state?: HistoryState): void;
|
|
443
|
+
go(delta: number): void;
|
|
444
|
+
back(): void;
|
|
445
|
+
forward(): void;
|
|
446
|
+
listen(listener: HistoryListener): Promise<UnlistenCallback>;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
declare enum WorkitemTypeGroup {
|
|
450
|
+
Requirement = 1,
|
|
451
|
+
Task = 2,
|
|
452
|
+
Bug = 3,
|
|
453
|
+
Issue = 4,
|
|
454
|
+
Plan = 5
|
|
455
|
+
}
|
|
456
|
+
interface Workitem {
|
|
457
|
+
id: string;
|
|
458
|
+
short_id: string;
|
|
459
|
+
identifier: string;
|
|
460
|
+
title: string;
|
|
461
|
+
type_group?: WorkitemTypeGroup;
|
|
462
|
+
type_id?: string;
|
|
463
|
+
}
|
|
464
|
+
interface WorkitemOpenCreateOptions {
|
|
465
|
+
defaultValues?: {
|
|
466
|
+
title?: string;
|
|
467
|
+
project_id?: string;
|
|
468
|
+
description?: string;
|
|
469
|
+
};
|
|
470
|
+
onSuccess?: (payload: Workitem) => void;
|
|
373
471
|
}
|
|
374
472
|
|
|
375
|
-
export { HistoryAction, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES,
|
|
376
|
-
export type {
|
|
473
|
+
export { HOST_DISPATCH_NATIVE_UI_EVENT, HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, WorkitemTypeGroup };
|
|
474
|
+
export type { ApiInvokeOptions, Baseline, ConditionPrimitive, ConditionValue, Conditions, DialogConfirmOptions, DialogOpenOptions, DialogRef, DispatchEventPayload, DownloadResult, EgressItem, ExtensionData, ExtensionProperties, GetMetadataResult, GetTranslationsResult, HistoryListener, HistoryLocation, HistoryPath, HistoryState, HistoryTo, HistoryUpdate, Idea, IdeaOpenCreateOptions, InvokeFunctionParams, InvokeResponseData, MultipleUserOpenPopoverOptions, NavigationLocation, NexusAppContext, NexusAppExtension, NexusHistory, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, Page, PageOpenCreateOptions, ProcessOptions, ProcessRef, RemoteInvokeOptions, RemoteRequestBody, RemoteRequestOptions, RemoteRequestPayload, RemoteRequestResponseData, RemoteRequestSerializedInit, RemoteSerializedBlob, RemoteSerializedFormDataEntry, RichtextBridgeMessage, RichtextContent, RichtextDescendant, RichtextEditorOptions, RichtextEditorRef, RichtextElement, RichtextRendererOptions, RichtextRendererRef, RichtextText, SingleUserOpenPopoverOptions, Subscription, SupportedLocaleCode, Testcase, TestcaseOpenCreateOptions, Ticket, TicketOpenCreateOptions, TranslationsResourceContent, Translator, UnlistenCallback, UploadResult, UserInfo, UserOpenDialogOptions, UserOpenDialogRef, UserOpenPopoverOptions, UserOpenPopoverRef, Viewport, ViewportSize, VirtualListener, VirtualNodeSnapshot, VirtualStyle, Workitem, WorkitemOpenCreateOptions };
|