@ngrdt/utils 0.0.4 → 0.0.6
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/.swcrc +29 -0
- package/eslint.config.js +22 -0
- package/jest.config.ts +30 -0
- package/package.json +7 -5
- package/project.json +29 -0
- package/rollup.config.js +20 -0
- package/src/index.ts +17 -0
- package/src/lib/__test__/array.utils.spec.ts +13 -0
- package/src/lib/__test__/css.utils.spec.ts +27 -0
- package/src/lib/__test__/date-format.spec.ts +71 -0
- package/src/lib/__test__/date.utils.spec.ts +72 -0
- package/src/lib/__test__/file-zip.utils.spec.ts +14 -0
- package/src/lib/__test__/object.utils.spec.ts +23 -0
- package/src/lib/__test__/random.utils.spec.ts +7 -0
- package/src/lib/__test__/string.utils.spec.ts +17 -0
- package/src/lib/types/aria.ts +334 -0
- package/src/lib/types/encodings.ts +273 -0
- package/src/lib/types/keyboard.ts +29 -0
- package/src/lib/types/mime-types.ts +119 -0
- package/src/lib/types/router.ts +1 -0
- package/src/lib/types/type.ts +43 -0
- package/src/lib/utils/array.ts +30 -0
- package/src/lib/utils/css.ts +69 -0
- package/src/lib/utils/date-format.ts +580 -0
- package/src/lib/utils/date.ts +363 -0
- package/src/lib/utils/file.ts +258 -0
- package/src/lib/utils/html.ts +26 -0
- package/src/lib/utils/model.ts +73 -0
- package/src/lib/utils/names.ts +73 -0
- package/src/lib/utils/object.ts +58 -0
- package/src/lib/utils/random.ts +9 -0
- package/src/lib/utils/rxjs.ts +30 -0
- package/src/lib/utils/string.ts +123 -0
- package/tsconfig.json +22 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +14 -0
- package/index.cjs.d.ts +0 -1
- package/index.cjs.js +0 -1
- package/index.esm.d.ts +0 -1
- package/index.esm.js +0 -1
- package/src/index.d.ts +0 -16
- package/src/lib/array.utils.d.ts +0 -6
- package/src/lib/color.utils.d.ts +0 -5
- package/src/lib/css.utils.d.ts +0 -12
- package/src/lib/date-format.d.ts +0 -77
- package/src/lib/date.utils.d.ts +0 -60
- package/src/lib/encodings.d.ts +0 -44
- package/src/lib/file.utils.d.ts +0 -69
- package/src/lib/html.utils.d.ts +0 -4
- package/src/lib/keyboard.utils.d.ts +0 -36
- package/src/lib/mime-types.d.ts +0 -109
- package/src/lib/model.utils.d.ts +0 -22
- package/src/lib/names.d.ts +0 -19
- package/src/lib/object.utils.d.ts +0 -5
- package/src/lib/random.utils.d.ts +0 -4
- package/src/lib/rxjs.utils.d.ts +0 -6
- package/src/lib/string.utils.d.ts +0 -22
- package/src/lib/type.utils.d.ts +0 -13
package/src/lib/date.utils.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Nullable } from './type.utils';
|
|
2
|
-
export declare class RdtDateUtils {
|
|
3
|
-
static readonly MS = 1;
|
|
4
|
-
static readonly SECOND: number;
|
|
5
|
-
static readonly MINUTE: number;
|
|
6
|
-
static readonly HOUR: number;
|
|
7
|
-
static readonly DAY: number;
|
|
8
|
-
/**
|
|
9
|
-
* Returns number of days between two dates.
|
|
10
|
-
* Returns zero in case dates are the same. Ignores time.
|
|
11
|
-
*/
|
|
12
|
-
static getDays(a: Date | string | number, b: Date | string | number): number;
|
|
13
|
-
static checkDate(year: number, month: number, day: number): boolean;
|
|
14
|
-
static isValidDate(value: any): value is string | number | Date;
|
|
15
|
-
static startOfDay(input: Date | string): Date;
|
|
16
|
-
static endOfDay(input: Date | string): Date;
|
|
17
|
-
static startOfMonth(input: Date | string): Date;
|
|
18
|
-
static endOfMonth(input: Date | string): Date;
|
|
19
|
-
static startOfYear(year: number): Date;
|
|
20
|
-
static endOfYear(year: number): Date;
|
|
21
|
-
static beginningOfNextMonth(): Date;
|
|
22
|
-
static endOfNextMonth(): Date;
|
|
23
|
-
static beginningOfInThreeMonths(): Date;
|
|
24
|
-
static endOfInNextThreeMonths(): Date;
|
|
25
|
-
static minusOneDay(date: Date): Date;
|
|
26
|
-
static toISOLocal(d: Date): string;
|
|
27
|
-
static formatDate(date: any): string;
|
|
28
|
-
static timeToDate(time: string): Date | null;
|
|
29
|
-
static setTime(date: Date, time: string): Date;
|
|
30
|
-
static getTime(d: Date, showSeconds?: boolean): string;
|
|
31
|
-
static parseToDate(input: Nullable<string | Date>): Date | null;
|
|
32
|
-
static parse(input: Nullable<string | Date>): number | null;
|
|
33
|
-
static isEqual(d1: Date | null, d2: Date | null): boolean;
|
|
34
|
-
static isLeapYear(year: number): boolean;
|
|
35
|
-
static getDaysInYear(year: number): 365 | 366;
|
|
36
|
-
private static hhMmRegex;
|
|
37
|
-
private static hhMmSsRegex;
|
|
38
|
-
private static hhMmSsMsRegex;
|
|
39
|
-
private static daysUpToMonth;
|
|
40
|
-
private static daysUpToMonthLeapYear;
|
|
41
|
-
private static getDayOffset;
|
|
42
|
-
static doubleDigitYearToPast(year2: number): number;
|
|
43
|
-
static doubleDigitYearToFuture(year2: number): number;
|
|
44
|
-
static getCurrentYear(): number;
|
|
45
|
-
static calculateAge(birthDateStr: string, referenceDateStr: string): number;
|
|
46
|
-
}
|
|
47
|
-
export declare enum Month {
|
|
48
|
-
January = 0,
|
|
49
|
-
February = 1,
|
|
50
|
-
March = 2,
|
|
51
|
-
April = 3,
|
|
52
|
-
May = 4,
|
|
53
|
-
June = 5,
|
|
54
|
-
July = 6,
|
|
55
|
-
August = 7,
|
|
56
|
-
September = 8,
|
|
57
|
-
October = 9,
|
|
58
|
-
November = 10,
|
|
59
|
-
December = 11
|
|
60
|
-
}
|
package/src/lib/encodings.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export declare enum RdtEncoding {
|
|
2
|
-
UTF_8 = "utf-8",
|
|
3
|
-
IBM_866 = "ibm866",
|
|
4
|
-
ISO_8859_2 = "iso-8859-2",
|
|
5
|
-
ISO_8859_3 = "iso-8859-3",
|
|
6
|
-
ISO_8859_4 = "iso-8859-4",
|
|
7
|
-
ISO_8859_5 = "iso-8859-5",
|
|
8
|
-
ISO_8859_6 = "iso-8859-6",
|
|
9
|
-
ISO_8859_7 = "iso-8859-7",
|
|
10
|
-
ISO_8859_8 = "iso-8859-8",
|
|
11
|
-
ISO_8859_8_I = "iso-8859-8-i",
|
|
12
|
-
ISO_8859_10 = "iso-8859-10",
|
|
13
|
-
ISO_8859_13 = "iso-8859-13",
|
|
14
|
-
ISO_8859_14 = "iso-8859-14",
|
|
15
|
-
ISO_8859_15 = "iso-8859-15",
|
|
16
|
-
ISO_8859_16 = "iso-8859-16",
|
|
17
|
-
KOI8_R = "koi8-r",
|
|
18
|
-
MACINTOSH = "macintosh",
|
|
19
|
-
WINDOWS_874 = "windows-874",
|
|
20
|
-
WINDOWS_1250 = "windows-1250",
|
|
21
|
-
WINDOWS_1251 = "windows-1251",
|
|
22
|
-
WINDOWS_1252 = "windows-1252",
|
|
23
|
-
WINDOWS_1253 = "windows-1253",
|
|
24
|
-
WINDOWS_1254 = "windows-1254",
|
|
25
|
-
WINDOWS_1255 = "windows-1255",
|
|
26
|
-
WINDOWS_1256 = "windows-1256",
|
|
27
|
-
WINDOWS_1257 = "windows-1257",
|
|
28
|
-
WINDOWS_1258 = "windows-1258",
|
|
29
|
-
X_MAC_CYRILLIC = "x-mac-cyrillic",
|
|
30
|
-
GBK = "gbk",
|
|
31
|
-
GB18030 = "gb18030",
|
|
32
|
-
BIG5 = "big5",
|
|
33
|
-
EUC_JP = "euc-jp",
|
|
34
|
-
ISO_2022_JP = "iso-2022-jp",
|
|
35
|
-
SHIFT_JIS = "shift-jis",
|
|
36
|
-
EUC_KR = "euc-kr",
|
|
37
|
-
HZ_GB_2312 = "hz-gb-2312",
|
|
38
|
-
ISO_2022_CN = "iso-2022-cn",
|
|
39
|
-
ISO_2022_CN_EXT = "iso-2022-cn-ext",
|
|
40
|
-
ISO_2022_KR = "iso-2022-kr",
|
|
41
|
-
UTF_16 = "utf-16",
|
|
42
|
-
X_USER_DEFINED = "x-user-defined"
|
|
43
|
-
}
|
|
44
|
-
export type AllEncodingAliases = 'unicode-1-1-utf-8' | 'unicode11utf8' | 'unicode20utf8' | 'utf-8' | 'utf8' | 'x-unicode20utf8' | '866' | 'cp866' | 'csibm866' | 'ibm866' | 'csisolatin2' | 'iso-8859-2' | 'iso-ir-101' | 'iso8859-2' | 'iso88592' | 'iso_8859-2' | 'iso_8859-2:1987' | 'l2' | 'latin2' | 'csisolatin3' | 'iso-8859-3' | 'iso-ir-109' | 'iso8859-3' | 'iso88593' | 'iso_8859-3' | 'iso_8859-3:1988' | 'l3' | 'latin3' | 'csisolatin4' | 'iso-8859-4' | 'iso-ir-110' | 'iso8859-4' | 'iso88594' | 'iso_8859-4' | 'iso_8859-4:1988' | 'l4' | 'latin4' | 'csisolatincyrillic' | 'cyrillic' | 'iso-8859-5' | 'iso-ir-144' | 'iso8859-5' | 'iso88595' | 'iso_8859-5' | 'iso_8859-5:1988' | 'arabic' | 'asmo-708' | 'csiso88596e' | 'csiso88596i' | 'csisolatinarabic' | 'ecma-114' | 'iso-8859-6' | 'iso-8859-6-e' | 'iso-8859-6-i' | 'iso-ir-127' | 'iso8859-6' | 'iso88596' | 'iso_8859-6' | 'iso_8859-6:1987' | 'csisolatingreek' | 'ecma-118' | 'elot_928' | 'greek' | 'greek8' | 'iso-8859-7' | 'iso-ir-126' | 'iso8859-7' | 'iso88597' | 'iso_8859-7' | 'iso_8859-7:1987' | 'sun_eu_greek' | 'csiso88598e' | 'csisolatinhebrew' | 'hebrew' | 'iso-8859-8' | 'iso-8859-8-e' | 'iso-ir-138' | 'iso8859-8' | 'iso88598' | 'iso_8859-8' | 'iso_8859-8:1988' | 'visual' | 'csiso88598i' | 'iso-8859-8-i' | 'logical' | 'csisolatin6' | 'iso-8859-10' | 'iso-ir-157' | 'iso8859-10' | 'iso885910' | 'l6' | 'latin6' | 'iso-8859-13' | 'iso8859-13' | 'iso885913' | 'iso-8859-14' | 'iso8859-14' | 'iso885914' | 'csisolatin9' | 'iso-8859-15' | 'iso8859-15' | 'iso885915' | 'iso_8859-15' | 'l9' | 'iso-8859-16' | 'cskoi8r' | 'koi' | 'koi8' | 'koi8-r' | 'koi8_r' | 'koi8-ru' | 'koi8-u' | 'csmacintosh' | 'mac' | 'macintosh' | 'x-mac-roman' | 'dos-874' | 'iso-8859-11' | 'iso8859-11' | 'iso885911' | 'tis-620' | 'windows-874' | 'cp1250' | 'windows-1250' | 'x-cp1250' | 'cp1251' | 'windows-1251' | 'x-cp1251' | 'ansi_x3.4-1968' | 'ascii' | 'cp1252' | 'cp819' | 'csisolatin1' | 'ibm819' | 'iso-8859-1' | 'iso-ir-100' | 'iso8859-1' | 'iso88591' | 'iso_8859-1' | 'iso_8859-1:1987' | 'l1' | 'latin1' | 'us-ascii' | 'windows-1252' | 'x-cp1252' | 'cp1253' | 'windows-1253' | 'x-cp1253' | 'cp1254' | 'csisolatin5' | 'iso-8859-9' | 'iso-ir-148' | 'iso8859-9' | 'iso88599' | 'iso_8859-9' | 'iso_8859-9:1989' | 'l5' | 'latin5' | 'windows-1254' | 'x-cp1254' | 'cp1255' | 'windows-1255' | 'x-cp1255' | 'cp1256' | 'windows-1256' | 'x-cp1256' | 'cp1257' | 'windows-1257' | 'x-cp1257' | 'cp1258' | 'windows-1258' | 'x-cp1258' | 'x-mac-cyrillic' | 'x-mac-ukrainian' | 'chinese' | 'csgb2312' | 'csiso58gb231280' | 'gb2312' | 'gb_2312' | 'gb_2312-80' | 'gbk' | 'iso-ir-58' | 'x-gbk' | 'gb18030' | 'big5' | 'big5-hkscs' | 'cn-big5' | 'csbig5' | 'x-x-big5' | 'cseucpkdfmtjapanese' | 'euc-jp' | 'x-euc-jp' | 'csiso2022jp' | 'iso-2022-jp' | 'csshiftjis' | 'ms932' | 'ms_kanji' | 'shift-jis' | 'shift_jis' | 'sjis' | 'windows-31j' | 'x-sjis' | 'cseuckr' | 'csksc56011987' | 'euc-kr' | 'iso-ir-149' | 'korean' | 'ks_c_5601-1987' | 'ks_c_5601-1989' | 'ksc5601' | 'ksc_5601' | 'windows-949' | 'csiso2022kr' | 'hz-gb-2312' | 'iso-2022-cn' | 'iso-2022-cn-ext' | 'iso-2022-kr' | 'replacement' | 'unicodefffe' | 'utf-16be' | 'csunicode' | 'iso-10646-ucs-2' | 'ucs-2' | 'unicode' | 'unicodefeff' | 'utf-16' | 'utf-16le' | 'x-user-defined';
|
package/src/lib/file.utils.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { HttpResponse } from '@angular/common/http';
|
|
2
|
-
import { RdtEncoding } from './encodings';
|
|
3
|
-
import { RdtMimeType } from './mime-types';
|
|
4
|
-
import { Nullable } from './type.utils';
|
|
5
|
-
export declare enum RdtMsOfficeAction {
|
|
6
|
-
Edit = "ofe|u|",
|
|
7
|
-
View = "ofv|u|"
|
|
8
|
-
}
|
|
9
|
-
export declare enum RdtMsOfficeApp {
|
|
10
|
-
Word = "ms-word",
|
|
11
|
-
Excel = "ms-excel",
|
|
12
|
-
PowerPoint = "ms-powerpoint"
|
|
13
|
-
}
|
|
14
|
-
export interface RdtMsOfficeConfig {
|
|
15
|
-
mimeType?: RdtMimeType;
|
|
16
|
-
app?: RdtMsOfficeApp;
|
|
17
|
-
action?: RdtMsOfficeAction;
|
|
18
|
-
}
|
|
19
|
-
export interface RdtDocumentFile<T = string> {
|
|
20
|
-
fileName: string;
|
|
21
|
-
content?: T;
|
|
22
|
-
url?: string;
|
|
23
|
-
mimeType?: RdtMimeType;
|
|
24
|
-
size?: number;
|
|
25
|
-
modified?: Date;
|
|
26
|
-
originalFile?: File;
|
|
27
|
-
}
|
|
28
|
-
export interface DokumentProtokol {
|
|
29
|
-
DokumentProtokol: {
|
|
30
|
-
filename: string;
|
|
31
|
-
content_data: string;
|
|
32
|
-
guid: string;
|
|
33
|
-
code: string;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export declare const Rdt_DEFAULT_MIME_TYPE = RdtMimeType.BIN;
|
|
37
|
-
export declare const Rdt_DEFAULT_MS_OFFICE_ACTION = RdtMsOfficeAction.View;
|
|
38
|
-
export declare enum FileSizeUnit {
|
|
39
|
-
B = "B",
|
|
40
|
-
KB = "KB",
|
|
41
|
-
MB = "MB",
|
|
42
|
-
GB = "GB",
|
|
43
|
-
TB = "TB",
|
|
44
|
-
PB = "PB",
|
|
45
|
-
EB = "EB",
|
|
46
|
-
ZB = "ZB",
|
|
47
|
-
YB = "YB"
|
|
48
|
-
}
|
|
49
|
-
export type RdtFileSize = `${number} ${FileSizeUnit}`;
|
|
50
|
-
export declare class FileUtils {
|
|
51
|
-
static getMsOfficeLink(url: string, config: RdtMsOfficeConfig): string;
|
|
52
|
-
static openFileFromRemoteUrl(url: string, config: RdtMsOfficeConfig): void;
|
|
53
|
-
static openFileInBrowser(stringData: string, mimeType?: RdtMimeType): void;
|
|
54
|
-
static fileAsArrayBuffer(file: Blob): Promise<ArrayBuffer>;
|
|
55
|
-
static fileAsText(file: Blob, encoding?: RdtEncoding): Promise<string>;
|
|
56
|
-
static downloadFileFromData(stringData: string, filename: string, mimeType?: RdtMimeType): void;
|
|
57
|
-
static downloadFileFromRemoteUrl(url: string, filename: string, mimeType?: RdtMimeType): void;
|
|
58
|
-
static getMimeTypeFromBase64(base64Data: string): RdtMimeType | undefined;
|
|
59
|
-
static getMimeTypeFromFileName(fileName: Nullable<string>): RdtMimeType;
|
|
60
|
-
static getFileName(filename: string, mimeType?: RdtMimeType): string;
|
|
61
|
-
static getBase64Link(base64Data: string, mimeType?: RdtMimeType): string;
|
|
62
|
-
static getMimeTypeFromResponse(resp: HttpResponse<Blob>): RdtMimeType;
|
|
63
|
-
static getFileNameFromResponse(resp: HttpResponse<Blob>): string;
|
|
64
|
-
static blobToDataUrl(file: Blob): Promise<string>;
|
|
65
|
-
static convertFromBytes(bytes: number, decimals?: number): string;
|
|
66
|
-
static convertToBytes(amount: number, unit: FileSizeUnit): number;
|
|
67
|
-
static fileSizeToBytes(fileSize: RdtFileSize): number | null;
|
|
68
|
-
static getMsOfficeAppByMimeType(mimeType: RdtMimeType | undefined): RdtMsOfficeApp | null;
|
|
69
|
-
}
|
package/src/lib/html.utils.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare const ARROW: {
|
|
2
|
-
UP: string;
|
|
3
|
-
DOWN: string;
|
|
4
|
-
LEFT: string;
|
|
5
|
-
RIGHT: string;
|
|
6
|
-
};
|
|
7
|
-
export declare const KB_KEY: {
|
|
8
|
-
SPACEBAR: string;
|
|
9
|
-
ENTER: string;
|
|
10
|
-
ESCAPE: string;
|
|
11
|
-
HOME: string;
|
|
12
|
-
END: string;
|
|
13
|
-
TAB: string;
|
|
14
|
-
ARROW: {
|
|
15
|
-
UP: string;
|
|
16
|
-
DOWN: string;
|
|
17
|
-
LEFT: string;
|
|
18
|
-
RIGHT: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare const KB_CODE: {
|
|
22
|
-
SPACEBAR: string;
|
|
23
|
-
ENTER: string;
|
|
24
|
-
ESCAPE: string;
|
|
25
|
-
HOME: string;
|
|
26
|
-
END: string;
|
|
27
|
-
TAB: string;
|
|
28
|
-
ARROW: {
|
|
29
|
-
UP: string;
|
|
30
|
-
DOWN: string;
|
|
31
|
-
LEFT: string;
|
|
32
|
-
RIGHT: string;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export declare const ALPHABET_KB_KEYS: string[];
|
|
36
|
-
export declare const KB_ALPHABET_CODES: string[];
|
package/src/lib/mime-types.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
export declare enum RdtMimeType {
|
|
2
|
-
DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
3
|
-
XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
4
|
-
PDF = "application/pdf",
|
|
5
|
-
TXT = "text/plain",
|
|
6
|
-
CSV = "text/csv",
|
|
7
|
-
ZIP = "application/zip",
|
|
8
|
-
JPG = "image/jpeg",
|
|
9
|
-
PNG = "image/png",
|
|
10
|
-
GIF = "image/gif",
|
|
11
|
-
SVG = "image/svg+xml",
|
|
12
|
-
HTML = "text/html",
|
|
13
|
-
XML = "application/xml",
|
|
14
|
-
JSON = "application/json",
|
|
15
|
-
MP3 = "audio/mpeg",
|
|
16
|
-
MP4 = "video/mp4",
|
|
17
|
-
OGG = "audio/ogg",
|
|
18
|
-
WEBM = "video/webm",
|
|
19
|
-
WAV = "audio/wav",
|
|
20
|
-
AVI = "video/x-msvideo",
|
|
21
|
-
MPEG = "video/mpeg",
|
|
22
|
-
WEBP = "image/webp",
|
|
23
|
-
ICO = "image/x-icon",
|
|
24
|
-
TTF = "font/ttf",
|
|
25
|
-
WOFF = "font/woff",
|
|
26
|
-
WOFF2 = "font/woff2",
|
|
27
|
-
EOT = "application/vnd.ms-fontobject",
|
|
28
|
-
OTF = "font/otf",
|
|
29
|
-
PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
30
|
-
PPT = "application/vnd.ms-powerpoint",
|
|
31
|
-
XLS = "application/vnd.ms-excel",
|
|
32
|
-
DOC = "application/msword",
|
|
33
|
-
ODT = "application/vnd.oasis.opendocument.text",
|
|
34
|
-
ODS = "application/vnd.oasis.opendocument.spreadsheet",
|
|
35
|
-
ODP = "application/vnd.oasis.opendocument.presentation",
|
|
36
|
-
ODF = "application/vnd.oasis.opendocument.formula",
|
|
37
|
-
RAR = "application/vnd.rar",
|
|
38
|
-
TAR = "application/x-tar",
|
|
39
|
-
GZIP = "application/gzip",
|
|
40
|
-
BZIP2 = "application/x-bzip2",
|
|
41
|
-
XZ = "application/x-xz",
|
|
42
|
-
SEVENZ = "application/x-7z-compressed",
|
|
43
|
-
RAR5 = "application/x-rar-compressed",
|
|
44
|
-
WMA = "audio/x-ms-wma",
|
|
45
|
-
WMV = "video/x-ms-wmv",
|
|
46
|
-
FLV = "video/x-flv",
|
|
47
|
-
OGV = "video/ogg",
|
|
48
|
-
BIN = "application/octet-stream"
|
|
49
|
-
}
|
|
50
|
-
export declare enum VnshCombinedMimeType {
|
|
51
|
-
IMAGE = "image/*",
|
|
52
|
-
AUDIO = "audio/*",
|
|
53
|
-
VIDEO = "video/*",
|
|
54
|
-
FONT = "font/*",
|
|
55
|
-
DOCUMENT = "application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.oasis.opendocument.text,application/pdf,text/plain,text/csv",
|
|
56
|
-
SPREADSHEET = "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.oasis.opendocument.spreadsheet",
|
|
57
|
-
PRESENTATION = "application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.oasis.opendocument.presentation",
|
|
58
|
-
ARCHIVE = "application/zip,application/vnd.rar,application/x-tar,application/gzip,application/x-bzip2,application/x-xz,application/x-7z-compressed,application/x-rar-compressed"
|
|
59
|
-
}
|
|
60
|
-
export declare const EXTENSION_BY_MIME_TYPE: {
|
|
61
|
-
readonly "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx";
|
|
62
|
-
readonly "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx";
|
|
63
|
-
readonly "application/pdf": "pdf";
|
|
64
|
-
readonly "text/plain": "txt";
|
|
65
|
-
readonly "text/csv": "csv";
|
|
66
|
-
readonly "application/zip": "zip";
|
|
67
|
-
readonly "image/jpeg": "jpg";
|
|
68
|
-
readonly "image/png": "png";
|
|
69
|
-
readonly "image/gif": "gif";
|
|
70
|
-
readonly "image/svg+xml": "svg";
|
|
71
|
-
readonly "text/html": "html";
|
|
72
|
-
readonly "application/xml": "xml";
|
|
73
|
-
readonly "application/json": "json";
|
|
74
|
-
readonly "audio/mpeg": "mp3";
|
|
75
|
-
readonly "video/mp4": "mp4";
|
|
76
|
-
readonly "audio/ogg": "ogg";
|
|
77
|
-
readonly "video/webm": "webm";
|
|
78
|
-
readonly "audio/wav": "wav";
|
|
79
|
-
readonly "video/x-msvideo": "avi";
|
|
80
|
-
readonly "video/mpeg": "mpeg";
|
|
81
|
-
readonly "image/webp": "webp";
|
|
82
|
-
readonly "image/x-icon": "ico";
|
|
83
|
-
readonly "font/ttf": "ttf";
|
|
84
|
-
readonly "font/woff": "woff";
|
|
85
|
-
readonly "font/woff2": "woff2";
|
|
86
|
-
readonly "application/vnd.ms-fontobject": "eot";
|
|
87
|
-
readonly "font/otf": "otf";
|
|
88
|
-
readonly "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx";
|
|
89
|
-
readonly "application/vnd.ms-powerpoint": "ppt";
|
|
90
|
-
readonly "application/vnd.ms-excel": "xls";
|
|
91
|
-
readonly "application/msword": "doc";
|
|
92
|
-
readonly "application/vnd.oasis.opendocument.text": "odt";
|
|
93
|
-
readonly "application/vnd.oasis.opendocument.spreadsheet": "ods";
|
|
94
|
-
readonly "application/vnd.oasis.opendocument.presentation": "odp";
|
|
95
|
-
readonly "application/vnd.oasis.opendocument.formula": "odf";
|
|
96
|
-
readonly "application/vnd.rar": "rar";
|
|
97
|
-
readonly "application/x-tar": "tar";
|
|
98
|
-
readonly "application/gzip": "gz";
|
|
99
|
-
readonly "application/x-bzip2": "bz2";
|
|
100
|
-
readonly "application/x-xz": "xz";
|
|
101
|
-
readonly "application/x-7z-compressed": "7z";
|
|
102
|
-
readonly "application/x-rar-compressed": "rar";
|
|
103
|
-
readonly "audio/x-ms-wma": "wma";
|
|
104
|
-
readonly "video/x-ms-wmv": "wmv";
|
|
105
|
-
readonly "video/x-flv": "flv";
|
|
106
|
-
readonly "video/ogg": "ogv";
|
|
107
|
-
readonly "application/octet-stream": "bin";
|
|
108
|
-
};
|
|
109
|
-
export declare const MIME_TYPE_BY_EXTENSION: Record<(typeof EXTENSION_BY_MIME_TYPE)[keyof typeof EXTENSION_BY_MIME_TYPE], RdtMimeType>;
|
package/src/lib/model.utils.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare class RdtModelUtils {
|
|
2
|
-
static inferPropertyInfo(properties: {
|
|
3
|
-
key: string;
|
|
4
|
-
type: string;
|
|
5
|
-
}[], interfaceName: string): RdtModelProperty[];
|
|
6
|
-
static names(name: string): {
|
|
7
|
-
name: string;
|
|
8
|
-
className: string;
|
|
9
|
-
propertyName: string;
|
|
10
|
-
constantName: string;
|
|
11
|
-
fileName: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface RdtModelProperty {
|
|
15
|
-
key: string;
|
|
16
|
-
type: 'string' | 'number' | 'date' | 'boolean' | 'array' | 'object' | 'any';
|
|
17
|
-
formControlType: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any';
|
|
18
|
-
required: boolean;
|
|
19
|
-
foreignKey: boolean;
|
|
20
|
-
primaryKey: boolean;
|
|
21
|
-
probablyBoolean: boolean;
|
|
22
|
-
}
|
package/src/lib/names.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* From @nx/devkit because it has nodejs as dependency and won't transpile.
|
|
3
|
-
* Util function to generate different strings based off the provided name.
|
|
4
|
-
*
|
|
5
|
-
* Examples:
|
|
6
|
-
*
|
|
7
|
-
* ```typescript
|
|
8
|
-
* names("my-name") // {name: 'my-name', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}
|
|
9
|
-
* names("myName") // {name: 'myName', className: 'MyName', propertyName: 'myName', constantName: 'MY_NAME', fileName: 'my-name'}
|
|
10
|
-
* ```
|
|
11
|
-
* @param name
|
|
12
|
-
*/
|
|
13
|
-
export declare function names(name: string): {
|
|
14
|
-
name: string;
|
|
15
|
-
className: string;
|
|
16
|
-
propertyName: string;
|
|
17
|
-
constantName: string;
|
|
18
|
-
fileName: string;
|
|
19
|
-
};
|
package/src/lib/rxjs.utils.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
export declare class RdtRxUtils {
|
|
3
|
-
static repeatLatestWhen<T>(notifier$: Observable<any>): (source: Observable<T>) => Observable<T>;
|
|
4
|
-
static completeIfNull<T>(source$: Observable<T>): Observable<NonNullable<T>>;
|
|
5
|
-
static makeObservable<T>(value: T | Observable<T>): Observable<T>;
|
|
6
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Params } from '@angular/router';
|
|
2
|
-
import { Nullable } from './type.utils';
|
|
3
|
-
export declare class RdtStringUtils {
|
|
4
|
-
static tokenize(value: string | undefined): string[];
|
|
5
|
-
static joinPaths(parent: string, child: string): string;
|
|
6
|
-
static isAlphabetCharacter(char: string): boolean;
|
|
7
|
-
static isNumericCharacter(char: string): boolean;
|
|
8
|
-
static capitalize(str: string): string;
|
|
9
|
-
static toDataTestId(str: string): string;
|
|
10
|
-
static removeAccents(str: string): string;
|
|
11
|
-
static stripTrailingSlash(url: string): string;
|
|
12
|
-
static createAbsoluteUrl(url: string, baseHref: string): string;
|
|
13
|
-
static appendQueryParams(url: string, params: Params): string;
|
|
14
|
-
static localeCompare(a: Nullable<string>, b: Nullable<string>, order?: 'asc' | 'desc'): number;
|
|
15
|
-
static komixcomlocalReplaceString(url: string): {
|
|
16
|
-
replaceString: string;
|
|
17
|
-
toReplace: string;
|
|
18
|
-
};
|
|
19
|
-
static swapChars(src: string, i: number, j: number): string;
|
|
20
|
-
static insertAt(src: string, index: number, value: string): string;
|
|
21
|
-
static getDataTestId(label: string, prefix?: Nullable<string>, suffix?: Nullable<string>): string;
|
|
22
|
-
}
|
package/src/lib/type.utils.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type TypesAreEqual<T, U> = [T] extends [U] ? [U] extends [T] ? true : false : false;
|
|
2
|
-
export type DotNotationPath<T> = keyof T extends string ? PathImpl2<T> extends infer P ? P extends string | keyof T ? P : keyof T : keyof T : never;
|
|
3
|
-
export type StringKey<T, TGrid = T> = keyof T & keyof TGrid & string;
|
|
4
|
-
export type Nullable<T> = T | null | undefined;
|
|
5
|
-
type IsAny<T> = unknown extends T ? [keyof T] extends [never] ? false : true : false;
|
|
6
|
-
type ExcludeArrayKeys<T> = T extends ArrayLike<any> ? Exclude<keyof T, keyof any[]> : keyof T;
|
|
7
|
-
type PathImpl<T, Key extends keyof T> = Key extends string ? IsAny<T[Key]> extends true ? never : T[Key] extends Record<string, any> ? `${Key}.${PathImpl<T[Key], ExcludeArrayKeys<T[Key]>> & string}` | `${Key}.${ExcludeArrayKeys<T[Key]> & string}` : never : never;
|
|
8
|
-
type PathImpl2<T> = PathImpl<T, keyof T> | keyof T;
|
|
9
|
-
export type NullPartial<T> = {
|
|
10
|
-
[key in keyof T]: T[key] | null;
|
|
11
|
-
};
|
|
12
|
-
export type Modify<T, R> = Omit<T, keyof R> & R;
|
|
13
|
-
export {};
|