@pc-nexus/models 0.5.0-next.2 → 0.5.0-next.21

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.
@@ -4,12 +4,12 @@ var NexusAppEnvironment;
4
4
  NexusAppEnvironment["production"] = "production";
5
5
  })(NexusAppEnvironment || (NexusAppEnvironment = {}));
6
6
 
7
- const SUPPORTED_LOCALE_CODES = ["zh-cn", "en-us"];
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";
11
+ NavigationTarget["workitem"] = "workitem";
12
+ NavigationTarget["testcase"] = "testcase";
13
13
  NavigationTarget["page"] = "page";
14
14
  NavigationTarget["idea"] = "idea";
15
15
  NavigationTarget["ticket"] = "ticket";
@@ -29,6 +29,7 @@ var 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";
32
33
 
33
34
  var HistoryAction;
34
35
  (function (HistoryAction) {
@@ -64,5 +65,5 @@ var WorkItemTypeGroup;
64
65
  * Generated bundle index. Do not edit.
65
66
  */
66
67
 
67
- export { HistoryAction, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
68
+ export { HistoryAction, NEXUS_CONFIG_READY_EVENT, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
68
69
  //# 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/work-item.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\";\n\nexport interface RichtextText {\n text: string;\n [key: string]: unknown;\n}\n\nexport interface RichtextElement {\n type: string;\n children: Descendant[];\n [key: string]: unknown;\n}\n\nexport type Descendant = RichtextElement | RichtextText;\nexport type RichtextContent = Descendant[] | string;\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\nexport interface IframeResizerApi {\n sendMessage: (message: unknown, targetOrigin?: string) => 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","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 };\n onSuccess?: (payload: WorkItem) => void;\n}\n","/*\n * Public API Surface of models\n */\n\nexport * from \"./context\";\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 \"./richtext\";\nexport * from \"./user\";\nexport * from \"./view\";\nexport * from \"./viewport\";\nexport * from \"./work-item\";\nexport * from \"./idea\";\nexport * from \"./test-case\";\nexport * from \"./ticket\";\nexport * from \"./page\";\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,UAA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AAO;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/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,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,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7B,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pc-nexus/models",
3
- "version": "0.5.0-next.2",
3
+ "version": "0.5.0-next.21",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.0"
@@ -3,7 +3,7 @@ declare enum NexusAppEnvironment {
3
3
  production = "production"
4
4
  }
5
5
 
6
- declare const SUPPORTED_LOCALE_CODES: readonly ["zh-cn", "en-us"];
6
+ declare const SUPPORTED_LOCALE_CODES: readonly ["zh-CN", "en-US"];
7
7
  type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];
8
8
  interface Translator {
9
9
  translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | string;
@@ -49,6 +49,18 @@ interface NexusFullContext<T = ExtensionData> {
49
49
  };
50
50
  }
51
51
 
52
+ type ConditionPrimitive = string | number | boolean | null;
53
+ type ConditionValue = ConditionPrimitive | ConditionPrimitive[];
54
+ interface Conditions {
55
+ and?: Conditions;
56
+ or?: Conditions;
57
+ not?: Conditions;
58
+ hasPermission?: string;
59
+ isAdmin?: boolean;
60
+ isLoggedIn?: boolean;
61
+ [path: string]: ConditionValue | Conditions | undefined;
62
+ }
63
+
52
64
  interface Viewport {
53
65
  size?: ViewportSize;
54
66
  }
@@ -81,7 +93,11 @@ interface DialogConfirmOptions {
81
93
  onCancel?: () => void;
82
94
  }
83
95
 
84
- interface ExtensionProperties {
96
+ interface Subscription {
97
+ unsubscribe: () => void;
98
+ }
99
+
100
+ interface ExtensionProperties<T extends Conditions = Conditions> {
85
101
  key: string;
86
102
  resolver: {
87
103
  function: string;
@@ -91,6 +107,7 @@ interface ExtensionProperties {
91
107
  title: string;
92
108
  icon?: string;
93
109
  viewport?: Viewport;
110
+ display?: T;
94
111
  }
95
112
  interface EgressItem {
96
113
  addresses: string[];
@@ -112,34 +129,14 @@ interface NexusAppExtension<T extends ExtensionProperties = ExtensionProperties>
112
129
  resource_ports?: Record<string, number>;
113
130
  }
114
131
 
115
- interface EventCallbackParams {
116
- payload?: any;
117
- extension?: NexusAppExtension;
118
- }
119
- type EventCallbackType = (payload?: any, extension?: NexusAppExtension) => Promise<any>;
120
- interface EventOnParams {
121
- eventName: string;
122
- callback: EventCallbackType;
123
- }
124
- interface EventEmitParams {
125
- eventName: string;
126
- payload: CustomEventInit<{
127
- payload?: any;
128
- extension?: NexusAppExtension;
129
- }>;
130
- }
131
- interface Subscription {
132
- unsubscribe: () => void;
133
- }
134
-
135
132
  interface InvokeFunctionParams<T = unknown> {
136
133
  function: string;
137
134
  payload: T;
138
135
  }
139
136
 
140
137
  declare enum NavigationTarget {
141
- workItem = "workItem",
142
- testCase = "testCase",
138
+ workitem = "workitem",
139
+ testcase = "testcase",
143
140
  page = "page",
144
141
  idea = "idea",
145
142
  ticket = "ticket",
@@ -191,7 +188,6 @@ interface ProcessRef {
191
188
  setProgress(progress: number): void;
192
189
  complete(payload?: {
193
190
  fileUrl?: string;
194
- message?: string;
195
191
  }): void;
196
192
  error(message: string): void;
197
193
  cancel(): void;
@@ -204,19 +200,56 @@ interface RequestApiResponseData {
204
200
  }
205
201
  type NexusRequestInit = Omit<RequestInit, "signal">;
206
202
 
203
+ type RemoteInvokeOptions = {
204
+ path: string;
205
+ } & Pick<RequestInit, "headers" | "body" | "method">;
206
+ type RemoteRequestOptions = {
207
+ path: string;
208
+ } & Omit<RequestInit, "signal">;
209
+ interface RemoteSerializedBlob {
210
+ __isBlobData: true;
211
+ data: string;
212
+ type: string;
213
+ name?: string;
214
+ }
215
+ interface RemoteSerializedFormDataEntry {
216
+ name: string;
217
+ value: string | RemoteSerializedBlob;
218
+ }
219
+ type RemoteRequestBody = string | RemoteSerializedFormDataEntry[];
220
+ interface RemoteRequestSerializedInit extends Omit<RequestInit, "body" | "headers" | "signal"> {
221
+ method: string;
222
+ headers?: Record<string, string>;
223
+ body?: RemoteRequestBody;
224
+ }
225
+ interface RemoteRequestPayload {
226
+ remoteKey: string;
227
+ path: string;
228
+ requestInit: RemoteRequestSerializedInit;
229
+ isMultipartFormData: boolean;
230
+ }
231
+ interface RemoteRequestResponseData {
232
+ status: number;
233
+ statusText?: string;
234
+ headers?: Record<string, string>;
235
+ body?: string;
236
+ isBinaryContent?: boolean;
237
+ }
238
+
207
239
  declare const NEXUS_CONTENT_UPDATE_EVENT = "nexus:content:update";
208
240
  declare const NEXUS_CONTENT_CHANGE_EVENT = "nexus:content:change";
241
+ declare const NEXUS_CONFIG_READY_EVENT = "nexus:config:ready";
209
242
  interface RichtextText {
210
243
  text: string;
211
244
  [key: string]: unknown;
212
245
  }
213
246
  interface RichtextElement {
214
247
  type: string;
215
- children: Descendant[];
248
+ children: (Descendant | RichtextText)[];
216
249
  [key: string]: unknown;
217
250
  }
218
- type Descendant = RichtextElement | RichtextText;
219
- type RichtextContent = Descendant[] | string;
251
+ type Descendant = RichtextElement;
252
+ type RichtextContent = Descendant[];
220
253
  interface RichtextRendererRef {
221
254
  iframe: HTMLIFrameElement;
222
255
  update: (content: RichtextContent) => void;
@@ -237,14 +270,17 @@ interface RichtextBridgeMessage {
237
270
  source?: string;
238
271
  readonly?: boolean;
239
272
  }
240
- interface IframeResizerApi {
241
- sendMessage: (message: unknown, targetOrigin?: string) => void;
242
- }
243
273
 
244
- interface SelectMemberDialogOptions {
274
+ interface UserInfo {
275
+ id: string;
276
+ display_name?: string;
277
+ name?: string;
278
+ }
279
+ interface SelectUserDialogOptions {
245
280
  title?: string;
246
281
  selection?: string[];
247
- onConfirm: (payload?: string[]) => Promise<void>;
282
+ onConfirm: (ids?: string[], users?: UserInfo[]) => Promise<void>;
283
+ onClose?: () => void;
248
284
  }
249
285
  interface SelectMemberPopBaseOptions {
250
286
  origin: HTMLElement;
@@ -252,14 +288,19 @@ interface SelectMemberPopBaseOptions {
252
288
  interface MultipleSelectOptions extends SelectMemberPopBaseOptions {
253
289
  multiple: true;
254
290
  selection?: string[];
255
- onConfirm?: (ids?: string[]) => Promise<void>;
291
+ onConfirm?: (ids?: string[], users?: UserInfo[]) => Promise<void>;
292
+ onClose?: () => void;
256
293
  }
257
294
  interface SingleSelectOptions extends SelectMemberPopBaseOptions {
258
295
  multiple?: false;
259
296
  selection?: string;
260
- onConfirm?: (id?: string) => Promise<void>;
297
+ onConfirm?: (id?: string, user?: UserInfo) => Promise<void>;
298
+ onClose?: () => void;
299
+ }
300
+ type SelectUserPopoverOptions = MultipleSelectOptions | SingleSelectOptions;
301
+ interface SelectUserRef {
302
+ close: () => void;
261
303
  }
262
- type SelectMemberPopOptions = MultipleSelectOptions | SingleSelectOptions;
263
304
 
264
305
  declare enum HistoryAction {
265
306
  pop = "POP",
@@ -305,6 +346,7 @@ interface WorkItemOpenCreateOptions {
305
346
  defaultValues?: {
306
347
  title?: string;
307
348
  project_id?: string;
349
+ description?: string;
308
350
  };
309
351
  onSuccess?: (payload: WorkItem) => void;
310
352
  }
@@ -360,5 +402,29 @@ interface PageOpenCreateOptions {
360
402
  onSuccess?: (payload: Page) => void;
361
403
  }
362
404
 
363
- export { HistoryAction, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
364
- export type { Descendant, DialogConfirmOptions, DialogOptions, DialogRef, EditorIframeOptions, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, Idea, IdeaOpenCreateOptions, IframeResizerApi, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusRequestInit, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, Page, PageOpenCreateOptions, ProcessOptions, ProcessRef, RendererIframeOptions, RequestApiResponseData, RichtextBridgeMessage, RichtextContent, RichtextEditorRef, RichtextElement, RichtextRendererRef, RichtextText, SelectMemberDialogOptions, SelectMemberPopOptions, SingleSelectOptions, Subscription, TestCase, TestCaseOpenCreateOptions, Ticket, TicketOpenCreateOptions, TranslationResourceContent, Translator, UnlistenCallback, Viewport, WorkItem, WorkItemOpenCreateOptions };
405
+ interface UploadResult {
406
+ success: boolean;
407
+ key: string;
408
+ status?: number;
409
+ error?: string;
410
+ }
411
+ interface DownloadResult {
412
+ success: boolean;
413
+ key: string;
414
+ blob?: Blob;
415
+ name?: string;
416
+ status?: number;
417
+ error?: string;
418
+ }
419
+ interface GetMetadataResult {
420
+ key: string;
421
+ name: string;
422
+ mime_type: string;
423
+ checksum: string;
424
+ size: number;
425
+ created_at: string;
426
+ error?: string;
427
+ }
428
+
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 };