@pc-nexus/models 0.5.0-next.22 → 0.5.0-next.24

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,30 +1,30 @@
1
1
  var NexusAppEnvironment;
2
2
  (function (NexusAppEnvironment) {
3
- NexusAppEnvironment["development"] = "development";
4
- NexusAppEnvironment["production"] = "production";
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["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";
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["success"] = "success";
25
- NotifyType["error"] = "error";
26
- NotifyType["warning"] = "warning";
27
- NotifyType["info"] = "info";
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";
@@ -33,29 +33,19 @@ const NEXUS_CONFIG_READY_EVENT = "nexus:config:ready";
33
33
 
34
34
  var HistoryAction;
35
35
  (function (HistoryAction) {
36
- HistoryAction["pop"] = "POP";
37
- HistoryAction["push"] = "PUSH";
38
- HistoryAction["replace"] = "REPLACE";
36
+ HistoryAction["Pop"] = "POP";
37
+ HistoryAction["Push"] = "PUSH";
38
+ HistoryAction["Replace"] = "REPLACE";
39
39
  })(HistoryAction || (HistoryAction = {}));
40
40
 
41
- var ViewportSize;
42
- (function (ViewportSize) {
43
- ViewportSize["small"] = "small";
44
- ViewportSize["medium"] = "medium";
45
- ViewportSize["large"] = "large";
46
- ViewportSize["xlarge"] = "xlarge";
47
- ViewportSize["max"] = "max";
48
- ViewportSize["fullscreen"] = "fullscreen";
49
- })(ViewportSize || (ViewportSize = {}));
50
-
51
- var WorkItemTypeGroup;
52
- (function (WorkItemTypeGroup) {
53
- WorkItemTypeGroup[WorkItemTypeGroup["requirement"] = 1] = "requirement";
54
- WorkItemTypeGroup[WorkItemTypeGroup["task"] = 2] = "task";
55
- WorkItemTypeGroup[WorkItemTypeGroup["bug"] = 3] = "bug";
56
- WorkItemTypeGroup[WorkItemTypeGroup["issue"] = 4] = "issue";
57
- WorkItemTypeGroup[WorkItemTypeGroup["plan"] = 5] = "plan";
58
- })(WorkItemTypeGroup || (WorkItemTypeGroup = {}));
41
+ var WorkitemTypeGroup;
42
+ (function (WorkitemTypeGroup) {
43
+ WorkitemTypeGroup[WorkitemTypeGroup["Requirement"] = 1] = "Requirement";
44
+ WorkitemTypeGroup[WorkitemTypeGroup["Task"] = 2] = "Task";
45
+ WorkitemTypeGroup[WorkitemTypeGroup["Bug"] = 3] = "Bug";
46
+ WorkitemTypeGroup[WorkitemTypeGroup["Issue"] = 4] = "Issue";
47
+ WorkitemTypeGroup[WorkitemTypeGroup["Plan"] = 5] = "Plan";
48
+ })(WorkitemTypeGroup || (WorkitemTypeGroup = {}));
59
49
 
60
50
  /*
61
51
  * Public API Surface of models
@@ -65,5 +55,5 @@ var WorkItemTypeGroup;
65
55
  * Generated bundle index. Do not edit.
66
56
  */
67
57
 
68
- export { HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
58
+ export { HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, WorkitemTypeGroup };
69
59
  //# 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/view.ts","../../../../web/models/src/viewport.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 NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];\n\nexport interface Translator {\n translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | 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 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 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: (Descendant | RichtextText)[];\n [key: string]: unknown;\n}\n\nexport type Descendant = RichtextElement;\nexport type RichtextContent = Descendant[];\n\nexport interface RichtextRendererRef {\n iframe: HTMLIFrameElement;\n update: (content: RichtextContent) => void;\n}\n\nexport interface RichtextEditorRef extends RichtextRendererRef {\n destroy: () => void;\n}\n\nexport interface RendererIframeOptions {\n content?: RichtextContent;\n}\n\nexport interface EditorIframeOptions extends RendererIframeOptions {\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 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","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 fullscreen = \"fullscreen\",\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 \"./context\";\nexport * from \"./condition\";\nexport * from \"./dialog\";\nexport * from \"./environment\";\nexport * from \"./events\";\nexport * from \"./extension\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./notify\";\nexport * from \"./processor\";\nexport * from \"./request-api\";\nexport * from \"./remote\";\nexport * from \"./richtext\";\nexport * from \"./user\";\nexport * from \"./view\";\nexport * from \"./viewport\";\nexport * from \"./workitem\";\nexport * from \"./idea\";\nexport * from \"./testcase\";\nexport * from \"./ticket\";\nexport * from \"./page\";\nexport * from \"./store\";\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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,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;AACX,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC7B,CAAC,EAPW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;ICJZ;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;;;;"}
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/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 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 back(): void;\n forward(): void;\n listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): 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 \"./context\";\nexport * from \"./condition\";\nexport * from \"./dialog\";\nexport * from \"./environment\";\nexport * from \"./events\";\nexport * from \"./extension\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./notify\";\nexport * from \"./processor\";\nexport * from \"./api\";\nexport * from \"./remote\";\nexport * from \"./richtext\";\nexport * from \"./user\";\nexport * from \"./view\";\nexport * from \"./viewport\";\nexport * from \"./workitem\";\nexport * from \"./idea\";\nexport * from \"./testcase\";\nexport * from \"./ticket\";\nexport * from \"./page\";\nexport * from \"./store\";\nexport * from \"./baseline\";\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,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AAA,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pc-nexus/models",
3
- "version": "0.5.0-next.22",
3
+ "version": "0.5.0-next.24",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.0"
@@ -1,23 +1,23 @@
1
1
  declare enum NexusAppEnvironment {
2
- development = "development",
3
- production = "production"
2
+ Development = "development",
3
+ Production = "production"
4
4
  }
5
5
 
6
6
  declare const SUPPORTED_LOCALE_CODES: readonly ["zh-CN", "en-US"];
7
- type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];
7
+ type SupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];
8
8
  interface Translator {
9
- translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | string;
9
+ translate: (key: string, params?: Record<string, any>) => TranslationsResourceContent | string;
10
10
  }
11
11
  interface GetTranslationsResult {
12
- locale: NexusSupportedLocaleCode;
13
- translations: TranslationResourceContent | null;
12
+ locale: SupportedLocaleCode;
13
+ translations: TranslationsResourceContent | null;
14
14
  }
15
- interface TranslationResourceContent {
16
- [key: string]: string | TranslationResourceContent;
15
+ interface TranslationsResourceContent {
16
+ [key: string]: string | TranslationsResourceContent;
17
17
  }
18
18
 
19
19
  type ExtensionData = Record<string, any>;
20
- interface NexusFullContext<T = ExtensionData> {
20
+ interface NexusAppContext<T = ExtensionData> {
21
21
  app: {
22
22
  id: string;
23
23
  version: string;
@@ -29,7 +29,7 @@ interface NexusFullContext<T = ExtensionData> {
29
29
  team: {
30
30
  id: string;
31
31
  url: string;
32
- locale: NexusSupportedLocaleCode;
32
+ locale: SupportedLocaleCode;
33
33
  timezone: string;
34
34
  };
35
35
  installation: {
@@ -37,7 +37,7 @@ interface NexusFullContext<T = ExtensionData> {
37
37
  };
38
38
  user: {
39
39
  id: string;
40
- locale: NexusSupportedLocaleCode;
40
+ locale: SupportedLocaleCode;
41
41
  timezone: string;
42
42
  };
43
43
  extension: {
@@ -64,16 +64,9 @@ interface Conditions {
64
64
  interface Viewport {
65
65
  size?: ViewportSize;
66
66
  }
67
- declare enum ViewportSize {
68
- small = "small",
69
- medium = "medium",
70
- large = "large",
71
- xlarge = "xlarge",
72
- max = "max",
73
- fullscreen = "fullscreen"
74
- }
67
+ type ViewportSize = "small" | "medium" | "large" | "xlarge" | "max" | "fullscreen";
75
68
 
76
- interface DialogOptions {
69
+ interface DialogOpenOptions {
77
70
  resource: string;
78
71
  size?: ViewportSize;
79
72
  context?: Record<string, unknown>;
@@ -83,7 +76,7 @@ interface DialogOptions {
83
76
  icon?: string;
84
77
  }
85
78
  interface DialogRef<T = unknown> {
86
- close: (payload?: T) => void;
79
+ readonly close: (payload?: T) => void;
87
80
  }
88
81
  interface DialogConfirmOptions {
89
82
  content: string;
@@ -135,15 +128,15 @@ interface InvokeFunctionParams<T = unknown> {
135
128
  }
136
129
 
137
130
  declare enum NavigationTarget {
138
- workitem = "workitem",
139
- testcase = "testcase",
140
- page = "page",
141
- idea = "idea",
142
- ticket = "ticket",
143
- project = "project",
144
- library = "library",
145
- space = "space",
146
- product = "product"
131
+ Workitem = "workitem",
132
+ Testcase = "testcase",
133
+ Page = "page",
134
+ Idea = "idea",
135
+ Ticket = "ticket",
136
+ Project = "project",
137
+ Library = "library",
138
+ Space = "space",
139
+ Product = "product"
147
140
  }
148
141
  interface NavigationTargetParams {
149
142
  target: NavigationTarget;
@@ -152,10 +145,10 @@ interface NavigationTargetParams {
152
145
  type NavigationLocation = NavigationTargetParams;
153
146
 
154
147
  declare enum NotifyType {
155
- success = "success",
156
- error = "error",
157
- warning = "warning",
158
- info = "info"
148
+ Success = "success",
149
+ Error = "error",
150
+ Warning = "warning",
151
+ Info = "info"
159
152
  }
160
153
  interface NotifyOptions {
161
154
  type: NotifyType;
@@ -166,7 +159,7 @@ interface NotifyOptions {
166
159
  isAutoClose?: boolean;
167
160
  }
168
161
  interface NotifyRef {
169
- close: () => void;
162
+ readonly close: () => void;
170
163
  }
171
164
  interface NotifyDetail {
172
165
  link?: string;
@@ -184,21 +177,21 @@ interface CustomProcessItem {
184
177
  icon?: string;
185
178
  }
186
179
  interface ProcessRef {
187
- id: string;
188
- setProgress(progress: number): void;
189
- complete(payload?: {
180
+ readonly id: string;
181
+ readonly setProgress: (progress: number) => void;
182
+ readonly complete: (payload?: {
190
183
  fileUrl?: string;
191
- }): void;
192
- error(message: string): void;
193
- cancel(): void;
184
+ }) => void;
185
+ readonly error: (message: string) => void;
186
+ readonly cancel: () => void;
194
187
  }
195
188
 
196
- interface RequestApiResponseData {
189
+ interface InvokeResponseData {
197
190
  status: number;
198
191
  headers?: Record<string, string>;
199
192
  body?: Record<string, any>;
200
193
  }
201
- type NexusRequestInit = Omit<RequestInit, "signal">;
194
+ type ApiInvokeOptions = Omit<RequestInit, "signal">;
202
195
 
203
196
  type RemoteInvokeOptions = {
204
197
  path: string;
@@ -245,22 +238,22 @@ interface RichtextText {
245
238
  }
246
239
  interface RichtextElement {
247
240
  type: string;
248
- children: (Descendant | RichtextText)[];
241
+ children: (RichtextDescendant | RichtextText)[];
249
242
  [key: string]: unknown;
250
243
  }
251
- type Descendant = RichtextElement;
252
- type RichtextContent = Descendant[];
244
+ type RichtextDescendant = RichtextElement;
245
+ type RichtextContent = RichtextDescendant[];
253
246
  interface RichtextRendererRef {
254
- iframe: HTMLIFrameElement;
255
- update: (content: RichtextContent) => void;
247
+ readonly iframe: HTMLIFrameElement;
248
+ readonly update: (content: RichtextContent) => void;
256
249
  }
257
250
  interface RichtextEditorRef extends RichtextRendererRef {
258
- destroy: () => void;
251
+ readonly destroy: () => void;
259
252
  }
260
- interface RendererIframeOptions {
253
+ interface RichtextRendererOptions {
261
254
  content?: RichtextContent;
262
255
  }
263
- interface EditorIframeOptions extends RendererIframeOptions {
256
+ interface RichtextEditorOptions extends RichtextRendererOptions {
264
257
  onContentChange?: (content: RichtextContent) => void;
265
258
  }
266
259
  interface RichtextBridgeMessage {
@@ -276,36 +269,39 @@ interface UserInfo {
276
269
  display_name?: string;
277
270
  name?: string;
278
271
  }
279
- interface SelectUserDialogOptions {
272
+ interface UserOpenDialogOptions {
280
273
  title?: string;
281
274
  selection?: string[];
282
275
  onConfirm: (ids?: string[], users?: UserInfo[]) => Promise<void>;
283
276
  onClose?: () => void;
284
277
  }
285
- interface SelectMemberPopBaseOptions {
278
+ interface SelectUserPopBaseOptions {
286
279
  origin: HTMLElement;
287
280
  }
288
- interface MultipleSelectOptions extends SelectMemberPopBaseOptions {
281
+ interface MultipleUserOpenPopoverOptions extends SelectUserPopBaseOptions {
289
282
  multiple: true;
290
283
  selection?: string[];
291
- onConfirm?: (ids?: string[], users?: UserInfo[]) => Promise<void>;
284
+ onConfirm: (ids?: string[], users?: UserInfo[]) => Promise<void>;
292
285
  onClose?: () => void;
293
286
  }
294
- interface SingleSelectOptions extends SelectMemberPopBaseOptions {
287
+ interface SingleUserOpenPopoverOptions extends SelectUserPopBaseOptions {
295
288
  multiple?: false;
296
289
  selection?: string;
297
- onConfirm?: (id?: string, user?: UserInfo) => Promise<void>;
290
+ onConfirm: (id?: string, user?: UserInfo) => Promise<void>;
298
291
  onClose?: () => void;
299
292
  }
300
- type SelectUserPopoverOptions = MultipleSelectOptions | SingleSelectOptions;
301
- interface SelectUserRef {
302
- close: () => void;
293
+ type UserOpenPopoverOptions = MultipleUserOpenPopoverOptions | SingleUserOpenPopoverOptions;
294
+ interface UserOpenPopoverRef {
295
+ readonly close: () => void;
296
+ }
297
+ interface UserOpenDialogRef {
298
+ readonly close: () => void;
303
299
  }
304
300
 
305
301
  declare enum HistoryAction {
306
- pop = "POP",
307
- push = "PUSH",
308
- replace = "REPLACE"
302
+ Pop = "POP",
303
+ Push = "PUSH",
304
+ Replace = "REPLACE"
309
305
  }
310
306
  interface LocationDescriptor {
311
307
  pathname: string;
@@ -322,33 +318,33 @@ interface NexusHistory {
322
318
  replace(path: string, state?: unknown): void;
323
319
  replace(location: LocationDescriptor): void;
324
320
  go(n: number): void;
325
- goBack(): void;
326
- goForward(): void;
321
+ back(): void;
322
+ forward(): void;
327
323
  listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;
328
324
  }
329
325
 
330
- declare enum WorkItemTypeGroup {
331
- requirement = 1,
332
- task = 2,
333
- bug = 3,
334
- issue = 4,
335
- plan = 5
336
- }
337
- interface WorkItem {
326
+ declare enum WorkitemTypeGroup {
327
+ Requirement = 1,
328
+ Task = 2,
329
+ Bug = 3,
330
+ Issue = 4,
331
+ Plan = 5
332
+ }
333
+ interface Workitem {
338
334
  id: string;
339
335
  short_id: string;
340
336
  identifier: string;
341
337
  title: string;
342
- type_group?: WorkItemTypeGroup;
338
+ type_group?: WorkitemTypeGroup;
343
339
  type_id?: string;
344
340
  }
345
- interface WorkItemOpenCreateOptions {
341
+ interface WorkitemOpenCreateOptions {
346
342
  defaultValues?: {
347
343
  title?: string;
348
344
  project_id?: string;
349
345
  description?: string;
350
346
  };
351
- onSuccess?: (payload: WorkItem) => void;
347
+ onSuccess?: (payload: Workitem) => void;
352
348
  }
353
349
 
354
350
  interface Idea {
@@ -365,18 +361,18 @@ interface IdeaOpenCreateOptions {
365
361
  onSuccess?: (payload: Idea) => void;
366
362
  }
367
363
 
368
- interface TestCase {
364
+ interface Testcase {
369
365
  id: string;
370
366
  short_id: string;
371
367
  identifier: string;
372
368
  title: string;
373
369
  }
374
- interface TestCaseOpenCreateOptions {
370
+ interface TestcaseOpenCreateOptions {
375
371
  defaultValues?: {
376
372
  title?: string;
377
373
  library_id?: string;
378
374
  };
379
- onSuccess?: (payload: TestCase) => void;
375
+ onSuccess?: (payload: Testcase) => void;
380
376
  }
381
377
 
382
378
  interface Ticket {
@@ -426,5 +422,11 @@ interface GetMetadataResult {
426
422
  error?: string;
427
423
  }
428
424
 
429
- export { HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
430
- export type { ConditionPrimitive, ConditionValue, Conditions, Descendant, DialogConfirmOptions, DialogOptions, DialogRef, DownloadResult, EditorIframeOptions, EgressItem, ExtensionData, ExtensionProperties, GetMetadataResult, GetTranslationsResult, Idea, IdeaOpenCreateOptions, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusRequestInit, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, Page, PageOpenCreateOptions, ProcessOptions, ProcessRef, RemoteInvokeOptions, RemoteRequestBody, RemoteRequestOptions, RemoteRequestPayload, RemoteRequestResponseData, RemoteRequestSerializedInit, RemoteSerializedBlob, RemoteSerializedFormDataEntry, RendererIframeOptions, RequestApiResponseData, RichtextBridgeMessage, RichtextContent, RichtextEditorRef, RichtextElement, RichtextRendererRef, RichtextText, SelectUserDialogOptions, SelectUserPopoverOptions, SelectUserRef, SingleSelectOptions, Subscription, TestCase, TestCaseOpenCreateOptions, Ticket, TicketOpenCreateOptions, TranslationResourceContent, Translator, UnlistenCallback, UploadResult, UserInfo, Viewport, WorkItem, WorkItemOpenCreateOptions };
425
+ interface Baseline {
426
+ id: string;
427
+ short_id: string;
428
+ name: string;
429
+ }
430
+
431
+ export { HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, WorkitemTypeGroup };
432
+ export type { ApiInvokeOptions, Baseline, ConditionPrimitive, ConditionValue, Conditions, DialogConfirmOptions, DialogOpenOptions, DialogRef, DownloadResult, EgressItem, ExtensionData, ExtensionProperties, GetMetadataResult, GetTranslationsResult, Idea, IdeaOpenCreateOptions, InvokeFunctionParams, InvokeResponseData, LocationDescriptor, 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, Workitem, WorkitemOpenCreateOptions };