@enonic-types/core 7.16.2 → 8.0.0-A3
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/README.md +5 -5
- package/index.d.ts +158 -97
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,16 +23,16 @@ import type {Content} from '@enonic-types/core';
|
|
|
23
23
|
|
|
24
24
|
### Content
|
|
25
25
|
|
|
26
|
-
`Content` contains the `x` property, that has a very special `
|
|
26
|
+
`Content` contains the `x` property, that has a very special `XpMixin` type.
|
|
27
27
|
|
|
28
|
-
`
|
|
28
|
+
`XpMixin` is an interface, that is added to the global scope, so it can be
|
|
29
29
|
modified using the [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces).
|
|
30
|
-
This allows you to set the shape of the
|
|
31
|
-
declaring the `
|
|
30
|
+
This allows you to set the shape of the Mixin in your project, simply by
|
|
31
|
+
declaring the `XpMixin` like this:
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
34
|
declare global {
|
|
35
|
-
interface
|
|
35
|
+
interface XpMixin {
|
|
36
36
|
'com-mysite-app': {
|
|
37
37
|
metadata: {
|
|
38
38
|
metaTagTitle: string;
|
package/index.d.ts
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
export type ComponentDescriptor = `${string}:${string}`;
|
|
2
2
|
|
|
3
3
|
export interface NestedRecord {
|
|
4
|
-
|
|
4
|
+
[name: PropertyKey]: NestedRecord | unknown
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
declare global {
|
|
8
8
|
interface XpBeans {}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
type XpLayoutMap = Record<ComponentDescriptor, NestedRecord>;
|
|
11
|
+
|
|
12
12
|
interface XpLibraries {}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[partDescriptor: ComponentDescriptor]: NestedRecord;
|
|
18
|
-
}
|
|
19
|
-
interface XpXData {
|
|
20
|
-
[key: string]: Record<string, Record<string, unknown>>;
|
|
21
|
-
}
|
|
13
|
+
|
|
14
|
+
type XpPageMap = Record<ComponentDescriptor, NestedRecord>;
|
|
15
|
+
type XpPartMap = Record<ComponentDescriptor, NestedRecord>;
|
|
16
|
+
type XpMixin = Record<string, Record<string, Record<string, unknown>>>;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
export interface App {
|
|
@@ -58,7 +53,7 @@ export interface DoubleUnderscore {
|
|
|
58
53
|
* Converts JSON to a Java Map structure that can be used as parameters to a Java method on a bean created with newBean.
|
|
59
54
|
* @param value Value to convert
|
|
60
55
|
*/
|
|
61
|
-
toScriptValue: <T =
|
|
56
|
+
toScriptValue: <T = unknown>(value: T) => T extends null | undefined ? null : ScriptValue;
|
|
62
57
|
/**
|
|
63
58
|
* Add a disposer that is called when the app is stopped.
|
|
64
59
|
* @param callback Function to call
|
|
@@ -69,8 +64,7 @@ export interface DoubleUnderscore {
|
|
|
69
64
|
* If the JavaScript variable is defined, it is returned as is.
|
|
70
65
|
* @param value Value to convert
|
|
71
66
|
*/
|
|
72
|
-
nullOrValue: <T =
|
|
73
|
-
|
|
67
|
+
nullOrValue: <T = unknown>(value: T) => T extends null | undefined ? null : T;
|
|
74
68
|
/**
|
|
75
69
|
* Doc registerMock.
|
|
76
70
|
*
|
|
@@ -212,7 +206,7 @@ export type RequestBranch = 'draft' | 'master';
|
|
|
212
206
|
export type RequestGetHeaderFunction = (headerName: string) => string | null;
|
|
213
207
|
export type RequestMethod = 'GET' | 'POST' | ' HEAD' | 'OPTIONS' | ' PUT' | 'DELETE' | 'PATCH' | 'TRACE' | 'CONNECT';
|
|
214
208
|
export type RequestMode = 'edit' | 'inline' | 'live' | 'preview' | 'admin';
|
|
215
|
-
export type RequestParams = Record<string, string | string[]>;
|
|
209
|
+
export type RequestParams = Record<string, string | string[] | undefined>;
|
|
216
210
|
export type RequestScheme = 'http' | 'https';
|
|
217
211
|
|
|
218
212
|
export type RequestCookies = Record<string, string | undefined>;
|
|
@@ -221,15 +215,40 @@ export type ResponseCookies = Record<string, string | ComplexCookie | undefined>
|
|
|
221
215
|
export type RequestHeaders = Record<string, string | undefined>;
|
|
222
216
|
export type ResponseHeaders = Record<string, string | number | (string | number)[] | undefined>;
|
|
223
217
|
|
|
224
|
-
export interface DefaultRequestCookies
|
|
218
|
+
export interface DefaultRequestCookies
|
|
219
|
+
extends RequestCookies {
|
|
225
220
|
JSESSIONID?: string;
|
|
226
221
|
}
|
|
227
222
|
|
|
228
|
-
export type SecFetchDest =
|
|
229
|
-
|
|
223
|
+
export type SecFetchDest =
|
|
224
|
+
'audio'
|
|
225
|
+
| 'audioworklet'
|
|
226
|
+
| 'document'
|
|
227
|
+
| 'embed'
|
|
228
|
+
| 'empty'
|
|
229
|
+
| 'fencedframe'
|
|
230
|
+
| 'font'
|
|
231
|
+
| 'frame'
|
|
232
|
+
| 'iframe'
|
|
233
|
+
| 'image'
|
|
234
|
+
| 'manifest'
|
|
235
|
+
| 'object'
|
|
236
|
+
| 'paintworklet'
|
|
237
|
+
| 'report'
|
|
238
|
+
| 'script'
|
|
239
|
+
| 'serviceworker'
|
|
240
|
+
| 'sharedworker'
|
|
241
|
+
| 'style'
|
|
242
|
+
| 'track'
|
|
243
|
+
| 'video'
|
|
244
|
+
| 'webidentity'
|
|
245
|
+
| 'worker'
|
|
246
|
+
| 'xslt';
|
|
247
|
+
export type SecFetchMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin' | 'websocket';
|
|
230
248
|
export type SecFetchSite = 'cross-site' | 'same-origin' | 'same-site' | 'none';
|
|
231
249
|
|
|
232
|
-
export interface DefaultRequestHeaders
|
|
250
|
+
export interface DefaultRequestHeaders
|
|
251
|
+
extends RequestHeaders {
|
|
233
252
|
Accept?: string;
|
|
234
253
|
'Accept-Charset'?: string;
|
|
235
254
|
'Accept-Encoding'?: string;
|
|
@@ -276,13 +295,16 @@ export interface RequestConstructorParams {
|
|
|
276
295
|
url: string;
|
|
277
296
|
validTicket?: boolean;
|
|
278
297
|
webSocket: boolean;
|
|
298
|
+
locales: string[];
|
|
279
299
|
}
|
|
280
300
|
|
|
281
|
-
export interface RequestInterface
|
|
301
|
+
export interface RequestInterface
|
|
302
|
+
extends RequestConstructorParams {
|
|
282
303
|
getHeader: RequestGetHeaderFunction;
|
|
283
304
|
}
|
|
284
305
|
|
|
285
|
-
export interface DefaultRequest
|
|
306
|
+
export interface DefaultRequest
|
|
307
|
+
extends RequestInterface {
|
|
286
308
|
cookies: DefaultRequestCookies;
|
|
287
309
|
headers: DefaultRequestHeaders;
|
|
288
310
|
}
|
|
@@ -298,7 +320,8 @@ export type SerializableRequest<T extends RequestInterface = DefaultRequest> = O
|
|
|
298
320
|
body?: unknown[] | Record<string, unknown> | boolean | number | string | null;
|
|
299
321
|
};
|
|
300
322
|
|
|
301
|
-
export interface DefaultResponseHeaders
|
|
323
|
+
export interface DefaultResponseHeaders
|
|
324
|
+
extends ResponseHeaders {
|
|
302
325
|
'Cache-Control'?: string;
|
|
303
326
|
'Content-Encoding'?: string;
|
|
304
327
|
'Content-Type'?: string;
|
|
@@ -313,13 +336,13 @@ export interface DefaultResponseHeaders extends ResponseHeaders {
|
|
|
313
336
|
// So perhaps it's better to enforce that, so it's consistent both ways.
|
|
314
337
|
// It also causes problems in ResponseProcessors, since they work with both from and to Java.
|
|
315
338
|
export interface PageContributions {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
339
|
+
headBegin?: string[];
|
|
340
|
+
headEnd?: string[];
|
|
341
|
+
bodyBegin?: string[];
|
|
342
|
+
bodyEnd?: string[];
|
|
320
343
|
}
|
|
321
344
|
|
|
322
|
-
export type ResponseBody = unknown[] |
|
|
345
|
+
export type ResponseBody = unknown[] | object | boolean | number | string | null | ByteSource;
|
|
323
346
|
|
|
324
347
|
export interface MappedResponse {
|
|
325
348
|
applyFilters: boolean;
|
|
@@ -332,11 +355,13 @@ export interface MappedResponse {
|
|
|
332
355
|
status: number;
|
|
333
356
|
}
|
|
334
357
|
|
|
335
|
-
export interface ResponseInterface
|
|
358
|
+
export interface ResponseInterface
|
|
359
|
+
extends Partial<MappedResponse> {
|
|
336
360
|
redirect?: string;
|
|
337
361
|
}
|
|
338
362
|
|
|
339
|
-
export interface DefaultResponse
|
|
363
|
+
export interface DefaultResponse
|
|
364
|
+
extends ResponseInterface {
|
|
340
365
|
contentType?: LiteralUnion<'text/html' | 'application/json'>;
|
|
341
366
|
headers?: DefaultResponseHeaders;
|
|
342
367
|
}
|
|
@@ -363,7 +388,7 @@ export interface WebSocketSession {
|
|
|
363
388
|
id: string;
|
|
364
389
|
params: Record<string, string | string[]>;
|
|
365
390
|
path: string;
|
|
366
|
-
user: Omit<User,'type'>;
|
|
391
|
+
user: Omit<User, 'type'>;
|
|
367
392
|
}
|
|
368
393
|
|
|
369
394
|
export type WebSocketEventType = 'open' | 'message' | 'error' | 'close';
|
|
@@ -452,7 +477,8 @@ export interface ErrorController {
|
|
|
452
477
|
handleError?: ErrorRequestHandler;
|
|
453
478
|
}
|
|
454
479
|
|
|
455
|
-
export interface IdProviderController
|
|
480
|
+
export interface IdProviderController
|
|
481
|
+
extends Controller {
|
|
456
482
|
autoLogin?: AutoLoginRequestHandler;
|
|
457
483
|
handle401?: RequestHandler;
|
|
458
484
|
login?: RequestHandler;
|
|
@@ -460,9 +486,9 @@ export interface IdProviderController extends Controller {
|
|
|
460
486
|
}
|
|
461
487
|
|
|
462
488
|
export interface HttpFilterController<
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
489
|
+
RequestFromJava extends RequestInterface = DefaultRequest,
|
|
490
|
+
ResponseFromNext extends ResponseInterface = Response,
|
|
491
|
+
ResponseToJava extends ResponseInterface = ResponseFromNext
|
|
466
492
|
> {
|
|
467
493
|
filter: (
|
|
468
494
|
request: RequestFromJava,
|
|
@@ -487,6 +513,8 @@ export type RoleKey = `role:${string}`;
|
|
|
487
513
|
|
|
488
514
|
export type PrincipalKey = UserKey | GroupKey | RoleKey;
|
|
489
515
|
|
|
516
|
+
export type PrincipalType = 'user' | 'group' | 'role';
|
|
517
|
+
|
|
490
518
|
export interface User {
|
|
491
519
|
type: 'user';
|
|
492
520
|
key: UserKey;
|
|
@@ -524,6 +552,29 @@ export interface Attachment {
|
|
|
524
552
|
mimeType: string;
|
|
525
553
|
}
|
|
526
554
|
|
|
555
|
+
export interface DataValidationError
|
|
556
|
+
extends ValidationError {
|
|
557
|
+
propertyPath: string;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export interface AttachmentValidationError
|
|
561
|
+
extends ValidationError {
|
|
562
|
+
attachment: string;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export interface ValidationError {
|
|
566
|
+
message: string;
|
|
567
|
+
i18n: string;
|
|
568
|
+
errorCode: ValidationErrorCode;
|
|
569
|
+
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
|
570
|
+
args: any[];
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export interface ValidationErrorCode {
|
|
574
|
+
applicationKey: string;
|
|
575
|
+
code: string;
|
|
576
|
+
}
|
|
577
|
+
|
|
527
578
|
export interface PublishInfo {
|
|
528
579
|
from?: string;
|
|
529
580
|
to?: string;
|
|
@@ -537,13 +588,12 @@ export interface FragmentComponent {
|
|
|
537
588
|
}
|
|
538
589
|
|
|
539
590
|
export interface LayoutComponent<
|
|
540
|
-
Descriptor extends
|
|
591
|
+
Descriptor extends LayoutDescriptor = LayoutDescriptor,
|
|
541
592
|
Config extends NestedRecord = Descriptor extends LayoutDescriptor
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
Regions extends
|
|
545
|
-
Record<string, Region<(FragmentComponent |
|
|
546
|
-
Record<string, Region<(FragmentComponent | Part | TextComponent)[]>>
|
|
593
|
+
? XpLayoutMap[Descriptor]
|
|
594
|
+
: NestedRecord,
|
|
595
|
+
Regions extends Record<string, Region<(FragmentComponent | PartComponent | TextComponent)[]>> =
|
|
596
|
+
Record<string, Region<(FragmentComponent | Part | TextComponent)[]>>
|
|
547
597
|
> {
|
|
548
598
|
type: 'layout'
|
|
549
599
|
descriptor: Descriptor
|
|
@@ -551,13 +601,15 @@ export interface LayoutComponent<
|
|
|
551
601
|
path?: string // Missing in fragmentPreview https://github.com/enonic/xp/issues/10116
|
|
552
602
|
regions: Regions;
|
|
553
603
|
}
|
|
604
|
+
|
|
554
605
|
type LayoutDescriptor = keyof XpLayoutMap;
|
|
606
|
+
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
|
555
607
|
type Layout = LayoutDescriptor extends any // this lets us iterate over every member of the union
|
|
556
|
-
|
|
557
|
-
|
|
608
|
+
? LayoutComponent<LayoutDescriptor, XpLayoutMap[LayoutDescriptor]>
|
|
609
|
+
: never;
|
|
558
610
|
|
|
559
611
|
export interface PartComponent<
|
|
560
|
-
Descriptor extends
|
|
612
|
+
Descriptor extends PartDescriptor = PartDescriptor,
|
|
561
613
|
Config extends NestedRecord =
|
|
562
614
|
Descriptor extends PartDescriptor
|
|
563
615
|
? XpPartMap[Descriptor]
|
|
@@ -568,22 +620,23 @@ export interface PartComponent<
|
|
|
568
620
|
config: Config
|
|
569
621
|
path?: string // Missing in fragmentPreview https://github.com/enonic/xp/issues/10116
|
|
570
622
|
}
|
|
623
|
+
|
|
571
624
|
type PartDescriptor = keyof XpPartMap;
|
|
625
|
+
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
|
572
626
|
type Part = PartDescriptor extends any // this lets us iterate over every member of the union
|
|
573
|
-
|
|
574
|
-
|
|
627
|
+
? PartComponent<PartDescriptor, XpPartMap[PartDescriptor]>
|
|
628
|
+
: never;
|
|
575
629
|
|
|
576
630
|
// NOTE: This reflect lib-portal.getContent where page templates are resolved.
|
|
577
631
|
// WARNING: This does NOT reflect lib-content.getContent where page templates are NOT resolved!
|
|
578
632
|
export interface PageComponent<
|
|
579
|
-
Descriptor extends
|
|
633
|
+
Descriptor extends PageDescriptor = PageDescriptor,
|
|
580
634
|
Config extends NestedRecord =
|
|
581
635
|
Descriptor extends PageDescriptor
|
|
582
636
|
? XpPageMap[Descriptor]
|
|
583
637
|
: NestedRecord,
|
|
584
|
-
Regions extends
|
|
585
|
-
Record<string, Region<(FragmentComponent |
|
|
586
|
-
Record<string, Region<(FragmentComponent | Layout | Part | TextComponent)[]>>
|
|
638
|
+
Regions extends Record<string, Region<(FragmentComponent | LayoutComponent | PartComponent | TextComponent)[]>> =
|
|
639
|
+
Record<string, Region<(FragmentComponent | Layout | Part | TextComponent)[]>>
|
|
587
640
|
> {
|
|
588
641
|
config: Config
|
|
589
642
|
descriptor: Descriptor
|
|
@@ -594,9 +647,10 @@ export interface PageComponent<
|
|
|
594
647
|
}
|
|
595
648
|
|
|
596
649
|
type PageDescriptor = keyof XpPageMap;
|
|
650
|
+
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
|
597
651
|
type Page = PageDescriptor extends any // this lets us iterate over every member of the union
|
|
598
|
-
|
|
599
|
-
|
|
652
|
+
? PageComponent<PageDescriptor, XpPageMap[PageDescriptor]>
|
|
653
|
+
: never;
|
|
600
654
|
|
|
601
655
|
export interface TextComponent {
|
|
602
656
|
type: 'text'
|
|
@@ -605,15 +659,15 @@ export interface TextComponent {
|
|
|
605
659
|
}
|
|
606
660
|
|
|
607
661
|
export type Component<
|
|
608
|
-
Descriptor extends ComponentDescriptor =
|
|
662
|
+
Descriptor extends ComponentDescriptor = ComponentDescriptor,
|
|
609
663
|
Config extends NestedRecord = NestedRecord,
|
|
610
664
|
Regions extends (
|
|
611
665
|
Descriptor extends LayoutDescriptor
|
|
612
666
|
? Record<string, Region<(FragmentComponent | PartComponent | TextComponent)[]>>
|
|
613
667
|
: Record<string, Region>
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
668
|
+
) = Descriptor extends LayoutDescriptor
|
|
669
|
+
? Record<string, Region<(FragmentComponent | PartComponent | TextComponent)[]>>
|
|
670
|
+
: Record<string, Region>,
|
|
617
671
|
> =
|
|
618
672
|
| FragmentComponent
|
|
619
673
|
| LayoutComponent<Descriptor, Config, Regions>
|
|
@@ -622,43 +676,32 @@ export type Component<
|
|
|
622
676
|
| TextComponent;
|
|
623
677
|
|
|
624
678
|
export interface PageRegion<
|
|
625
|
-
Components extends
|
|
626
|
-
(FragmentComponent |
|
|
627
|
-
(FragmentComponent | Layout | Part | TextComponent)[]
|
|
679
|
+
Components extends (FragmentComponent | LayoutComponent | PartComponent | TextComponent)[] =
|
|
680
|
+
(FragmentComponent | Layout | Part | TextComponent)[]
|
|
628
681
|
> {
|
|
629
682
|
name: string;
|
|
630
683
|
components: Components;
|
|
631
684
|
}
|
|
632
685
|
|
|
633
686
|
export interface LayoutRegion<
|
|
634
|
-
Components extends
|
|
635
|
-
(FragmentComponent |
|
|
636
|
-
(FragmentComponent | Part | TextComponent)[]
|
|
687
|
+
Components extends (FragmentComponent | PartComponent | TextComponent)[] =
|
|
688
|
+
(FragmentComponent | Part | TextComponent)[]
|
|
637
689
|
> {
|
|
638
690
|
name: string;
|
|
639
691
|
components: Components;
|
|
640
692
|
}
|
|
641
693
|
|
|
642
694
|
export type Region<
|
|
643
|
-
Components extends
|
|
644
|
-
(FragmentComponent |
|
|
645
|
-
(FragmentComponent | Layout | Part | TextComponent)[]
|
|
695
|
+
Components extends (FragmentComponent | LayoutComponent | PartComponent | TextComponent)[] =
|
|
696
|
+
(FragmentComponent | Layout | Part | TextComponent)[]
|
|
646
697
|
// @ts-expect-error TODO LayoutRegion can't eat LayoutComponent nor Layout!!!
|
|
647
698
|
> = PageRegion<Components> | LayoutRegion<Components>;
|
|
648
699
|
|
|
649
700
|
export interface Content<
|
|
650
701
|
Data = Record<string, unknown>,
|
|
651
702
|
Type extends string = string,
|
|
652
|
-
_Component extends
|
|
653
|
-
|
|
654
|
-
? LayoutComponent | PartComponent
|
|
655
|
-
: PageComponent
|
|
656
|
-
) = (
|
|
657
|
-
Type extends 'portal:fragment'
|
|
658
|
-
? Layout | Part
|
|
659
|
-
: Page
|
|
660
|
-
),
|
|
661
|
-
> {
|
|
703
|
+
_Component extends ContentComponentConstraint<Type> = ContentComponent<Type>
|
|
704
|
+
> {
|
|
662
705
|
_id: string;
|
|
663
706
|
_name: string;
|
|
664
707
|
_path: string;
|
|
@@ -668,7 +711,7 @@ export interface Content<
|
|
|
668
711
|
createdTime: string;
|
|
669
712
|
modifiedTime?: string;
|
|
670
713
|
owner: string;
|
|
671
|
-
data: Type extends 'portal:fragment' ? Record<string,never> : Data;
|
|
714
|
+
data: Type extends 'portal:fragment' ? Record<string, never> : Data;
|
|
672
715
|
type: Type;
|
|
673
716
|
displayName: string;
|
|
674
717
|
hasChildren: boolean;
|
|
@@ -678,7 +721,7 @@ export interface Content<
|
|
|
678
721
|
childOrder?: string;
|
|
679
722
|
_sort?: object[];
|
|
680
723
|
page?: Type extends 'portal:fragment' ? never : _Component;
|
|
681
|
-
x:
|
|
724
|
+
x: XpMixin;
|
|
682
725
|
attachments: Record<string, Attachment>;
|
|
683
726
|
publish?: PublishInfo;
|
|
684
727
|
workflow?: Workflow;
|
|
@@ -687,19 +730,30 @@ export interface Content<
|
|
|
687
730
|
fragment?: Type extends 'portal:fragment' ? _Component : never;
|
|
688
731
|
}
|
|
689
732
|
|
|
690
|
-
export type
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
733
|
+
export type WorkflowState = 'IN_PROGRESS' | 'PENDING_APPROVAL' | 'REJECTED' | 'READY';
|
|
734
|
+
|
|
735
|
+
export interface Workflow {
|
|
736
|
+
state: WorkflowState;
|
|
737
|
+
}
|
|
694
738
|
|
|
695
739
|
export type ContentInheritValue = 'CONTENT' | 'PARENT' | 'NAME' | 'SORT';
|
|
696
740
|
|
|
741
|
+
export type ContentComponentConstraint<Type extends string> =
|
|
742
|
+
Type extends 'portal:fragment'
|
|
743
|
+
? LayoutComponent | PartComponent
|
|
744
|
+
: PageComponent;
|
|
745
|
+
|
|
746
|
+
export type ContentComponent<Type extends string> =
|
|
747
|
+
Type extends 'portal:fragment'
|
|
748
|
+
? Layout | Part
|
|
749
|
+
: Page;
|
|
750
|
+
|
|
697
751
|
// Compliant with npm module ts-brand
|
|
698
752
|
type Brand<
|
|
699
753
|
Base,
|
|
700
754
|
Branding
|
|
701
755
|
> = Base & {
|
|
702
|
-
|
|
756
|
+
'__type__': Branding
|
|
703
757
|
};
|
|
704
758
|
|
|
705
759
|
export type ByteSource = Brand<object, 'ByteSource'>;
|
|
@@ -719,10 +773,15 @@ export interface Resource {
|
|
|
719
773
|
|
|
720
774
|
export interface ResourceKey {
|
|
721
775
|
getApplicationKey(): string;
|
|
776
|
+
|
|
722
777
|
getPath(): string;
|
|
778
|
+
|
|
723
779
|
getUri(): string;
|
|
780
|
+
|
|
724
781
|
isRoot(): boolean;
|
|
782
|
+
|
|
725
783
|
getName(): string;
|
|
784
|
+
|
|
726
785
|
getExtension(): string;
|
|
727
786
|
}
|
|
728
787
|
|
|
@@ -860,6 +919,7 @@ export type DistanceUnit =
|
|
|
860
919
|
export interface FieldSortDsl {
|
|
861
920
|
field: string;
|
|
862
921
|
direction?: SortDirection;
|
|
922
|
+
language?: string;
|
|
863
923
|
}
|
|
864
924
|
|
|
865
925
|
export interface GeoDistanceSortDsl
|
|
@@ -1067,9 +1127,7 @@ export interface Highlight {
|
|
|
1067
1127
|
properties?: Record<string, Highlight>;
|
|
1068
1128
|
}
|
|
1069
1129
|
|
|
1070
|
-
export
|
|
1071
|
-
[highlightedFieldName: string]: string[];
|
|
1072
|
-
}
|
|
1130
|
+
export type HighlightResult = Record<string, string[]>;
|
|
1073
1131
|
|
|
1074
1132
|
export interface ExistsFilter {
|
|
1075
1133
|
exists: {
|
|
@@ -1112,6 +1170,7 @@ export type Filter = ExistsFilter | NotExistsFilter | HasValueFilter | IdsFilter
|
|
|
1112
1170
|
export type InputType =
|
|
1113
1171
|
| 'Time'
|
|
1114
1172
|
| 'DateTime'
|
|
1173
|
+
| 'Instant'
|
|
1115
1174
|
| 'CheckBox'
|
|
1116
1175
|
| 'ComboBox'
|
|
1117
1176
|
| 'Long'
|
|
@@ -1136,7 +1195,6 @@ export interface FormItemSet {
|
|
|
1136
1195
|
formItemType: 'ItemSet';
|
|
1137
1196
|
name: string;
|
|
1138
1197
|
label: string;
|
|
1139
|
-
customText: string;
|
|
1140
1198
|
helpText: string;
|
|
1141
1199
|
maximize: boolean;
|
|
1142
1200
|
inputType: InputType;
|
|
@@ -1174,7 +1232,6 @@ export interface FormItemInput {
|
|
|
1174
1232
|
formItemType: 'Input';
|
|
1175
1233
|
name: string;
|
|
1176
1234
|
label: string;
|
|
1177
|
-
customText: string;
|
|
1178
1235
|
helpText: string;
|
|
1179
1236
|
validationRegexp: string;
|
|
1180
1237
|
maximize: boolean;
|
|
@@ -1187,12 +1244,10 @@ export interface FormItemInput {
|
|
|
1187
1244
|
value: string;
|
|
1188
1245
|
type: ValueType;
|
|
1189
1246
|
}
|
|
1190
|
-
config: {
|
|
1191
|
-
[
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
}[]
|
|
1195
|
-
}
|
|
1247
|
+
config: Record<string, {
|
|
1248
|
+
[attributeKey: string]: string;
|
|
1249
|
+
value: string;
|
|
1250
|
+
}[]>
|
|
1196
1251
|
}
|
|
1197
1252
|
|
|
1198
1253
|
export interface FormItemOptionSet {
|
|
@@ -1218,9 +1273,15 @@ export interface FormItemOptionSet {
|
|
|
1218
1273
|
}[];
|
|
1219
1274
|
}
|
|
1220
1275
|
|
|
1221
|
-
export interface
|
|
1222
|
-
formItemType: '
|
|
1276
|
+
export interface FormItemFormFragment {
|
|
1277
|
+
formItemType: 'FormFragment';
|
|
1223
1278
|
name: string;
|
|
1224
1279
|
}
|
|
1225
1280
|
|
|
1226
|
-
export type FormItem = FormItemSet | FormItemLayout | FormItemOptionSet | FormItemInput |
|
|
1281
|
+
export type FormItem = FormItemSet | FormItemLayout | FormItemOptionSet | FormItemInput | FormItemFormFragment;
|
|
1282
|
+
|
|
1283
|
+
export type ConfigValue = string | number | boolean | ConfigObject | ConfigValue[];
|
|
1284
|
+
|
|
1285
|
+
export interface ConfigObject {
|
|
1286
|
+
[key: string]: ConfigValue
|
|
1287
|
+
}
|