/
common.ts
97 lines (80 loc) · 2.08 KB
/
common.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { EventEmitter, Type } from '@angular/core';
import { Routes } from '@angular/router';
import { Subject } from 'rxjs';
import { eLayoutType } from '../enums/common';
import { Environment } from './environment';
export namespace ABP {
export interface Root {
environment: Partial<Environment>;
registerLocaleFn: (locale: string) => Promise<any>;
skipGetAppConfiguration?: boolean;
sendNullsAsQueryParam?: boolean;
tenantKey?: string;
localizations?: Localization[];
othersGroup?: string;
}
export interface Child {
localizations?: Localization[];
}
export interface Localization {
culture: string;
resources: LocalizationResource[];
}
export interface LocalizationResource {
resourceName: string;
texts: Record<string, string>;
}
export interface HasPolicy {
requiredPolicy?: string;
}
export interface Test extends Partial<Root> {
baseHref?: string;
listQueryDebounceTime?: number;
routes?: Routes;
}
export type PagedResponse<T> = {
totalCount: number;
} & PagedItemsResponse<T>;
export interface PagedItemsResponse<T> {
items: T[];
}
export interface PageQueryParams {
filter?: string;
sorting?: string;
skipCount?: number;
maxResultCount?: number;
}
export interface Lookup {
id: string;
displayName: string;
}
export interface Nav {
name: string;
parentName?: string;
requiredPolicy?: string;
order?: number;
invisible?: boolean;
}
export interface Route extends Nav {
path?: string;
layout?: eLayoutType;
iconClass?: string;
group?: string;
}
export interface Tab extends Nav {
component: Type<any>;
}
export interface BasicItem {
id: string;
name: string;
}
export interface Option<T> {
key: Extract<keyof T, string>;
value: T[Extract<keyof T, string>];
}
export interface Dictionary<T = any> {
[key: string]: T;
}
export type ExtractFromOutput<T extends EventEmitter<any> | Subject<any>> =
T extends EventEmitter<infer X> ? X : T extends Subject<infer Y> ? Y : never;
}