@oardi/ts-utils 0.0.19 → 0.0.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.
- package/extensions/array-extension.ts +54 -0
- package/extensions/date-extension.ts +69 -0
- package/extensions/{index.d.ts → index.ts} +0 -1
- package/extensions/string-extensions.ts +21 -0
- package/helpers/browser/browser-type.enum.ts +13 -0
- package/helpers/browser/browser.helper.ts +95 -0
- package/helpers/browser/index.ts +2 -0
- package/helpers/clipboard.helper.ts +3 -0
- package/helpers/csv.helper.ts +23 -0
- package/helpers/download.helper.ts +127 -0
- package/helpers/enum.helper.ts +20 -0
- package/helpers/file.helper.ts +105 -0
- package/helpers/{index.d.ts → index.ts} +0 -1
- package/helpers/local-storage.helper.ts +30 -0
- package/helpers/logger/index.ts +1 -0
- package/helpers/logger/logger-type.enum.ts +7 -0
- package/helpers/logger/logger.helper.ts +63 -0
- package/helpers/logger/{logger.types.d.ts → logger.types.ts} +5 -4
- package/helpers/sort.helper.ts +33 -0
- package/helpers/token/{index.d.ts → index.ts} +0 -1
- package/helpers/token/{token-type.enum.d.ts → token-type.enum.ts} +0 -1
- package/helpers/token/token.helper.ts +16 -0
- package/{index.d.ts → index.ts} +0 -1
- package/interfaces/{index.d.ts → index.ts} +0 -1
- package/interfaces/keyvalue.interface.ts +7 -0
- package/package.json +1 -1
- package/services/browser/browser.consts.ts +11 -0
- package/services/browser/browser.interface.ts +6 -0
- package/services/browser/browser.service.ts +119 -0
- package/services/browser/browser.types.ts +4 -0
- package/services/browser/{index.d.ts → index.ts} +2 -2
- package/services/index.ts +1 -0
- package/tsconfig.json +33 -0
- package/types/index.ts +11 -0
- package/vite.config.ts +21 -0
- package/extensions/array-extension.d.ts +0 -13
- package/extensions/array-extension.d.ts.map +0 -1
- package/extensions/date-extension.d.ts +0 -16
- package/extensions/date-extension.d.ts.map +0 -1
- package/extensions/index.d.ts.map +0 -1
- package/extensions/string-extensions.d.ts +0 -9
- package/extensions/string-extensions.d.ts.map +0 -1
- package/helpers/clipboard.helper.d.ts +0 -2
- package/helpers/clipboard.helper.d.ts.map +0 -1
- package/helpers/csv.helper.d.ts +0 -6
- package/helpers/csv.helper.d.ts.map +0 -1
- package/helpers/download.helper.d.ts +0 -14
- package/helpers/download.helper.d.ts.map +0 -1
- package/helpers/enum.helper.d.ts +0 -6
- package/helpers/enum.helper.d.ts.map +0 -1
- package/helpers/file.helper.d.ts +0 -16
- package/helpers/file.helper.d.ts.map +0 -1
- package/helpers/index.d.ts.map +0 -1
- package/helpers/local-storage.helper.d.ts +0 -8
- package/helpers/local-storage.helper.d.ts.map +0 -1
- package/helpers/logger/index.d.ts +0 -2
- package/helpers/logger/index.d.ts.map +0 -1
- package/helpers/logger/logger-type.enum.d.ts +0 -8
- package/helpers/logger/logger-type.enum.d.ts.map +0 -1
- package/helpers/logger/logger.helper.d.ts +0 -12
- package/helpers/logger/logger.helper.d.ts.map +0 -1
- package/helpers/logger/logger.types.d.ts.map +0 -1
- package/helpers/sort.helper.d.ts +0 -2
- package/helpers/sort.helper.d.ts.map +0 -1
- package/helpers/token/index.d.ts.map +0 -1
- package/helpers/token/token-type.enum.d.ts.map +0 -1
- package/helpers/token/token.helper.d.ts +0 -7
- package/helpers/token/token.helper.d.ts.map +0 -1
- package/index.cjs.js +0 -15
- package/index.d.ts.map +0 -1
- package/index.es.js +0 -1162
- package/index.umd.js +0 -15
- package/interfaces/index.d.ts.map +0 -1
- package/interfaces/keyvalue.interface.d.ts +0 -5
- package/interfaces/keyvalue.interface.d.ts.map +0 -1
- package/readme.md +0 -15
- package/services/browser/browser-type.enum.d.ts +0 -14
- package/services/browser/browser-type.enum.d.ts.map +0 -1
- package/services/browser/browser.interface.d.ts +0 -6
- package/services/browser/browser.interface.d.ts.map +0 -1
- package/services/browser/browser.service.d.ts +0 -44
- package/services/browser/browser.service.d.ts.map +0 -1
- package/services/browser/index.d.ts.map +0 -1
- package/services/index.d.ts +0 -2
- package/services/index.d.ts.map +0 -1
- package/types/index.d.ts +0 -9
- package/types/index.d.ts.map +0 -1
- package/vite.config.d.ts +0 -3
- package/vite.config.d.ts.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
enum SortOrder {
|
|
2
|
+
NONE = 0,
|
|
3
|
+
ASC = 1,
|
|
4
|
+
DESC = -1,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const compareString = (valA: string, valB: string, ascending: boolean | undefined): number => {
|
|
8
|
+
return valA.localeCompare(valB) * (ascending ? SortOrder.ASC : SortOrder.DESC);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const getSortOrder = <T>(valA: T, valB: T): SortOrder => {
|
|
12
|
+
return valA < valB ? SortOrder.DESC : valA === valB ? SortOrder.NONE : SortOrder.ASC;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const compareNonString = <T>(valA: T, valB: T, ascending: boolean | undefined): number => {
|
|
16
|
+
return getSortOrder(valA, valB) * (ascending ? SortOrder.ASC : SortOrder.DESC);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const getValue = <T>(valA: T, valB: T, ascending: boolean | undefined): number => {
|
|
20
|
+
let result: number = 0;
|
|
21
|
+
if (typeof valA === 'string' && typeof valB === 'string') {
|
|
22
|
+
result = compareString(valA, valB, ascending);
|
|
23
|
+
} else {
|
|
24
|
+
result = compareNonString(valA, valB, ascending);
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const sortHelper = <T, G>(a: T, b: T, valueGetter: (a: T) => G, ascending?: boolean): number => {
|
|
30
|
+
const valA: G = valueGetter(a);
|
|
31
|
+
const valB: G = valueGetter(b);
|
|
32
|
+
return getValue(valA, valB, ascending);
|
|
33
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LocalStorageHelper } from '../local-storage.helper';
|
|
2
|
+
import { TokenType } from './token-type.enum';
|
|
3
|
+
|
|
4
|
+
export class TokenHelper {
|
|
5
|
+
static get(key: TokenType): string | null {
|
|
6
|
+
return LocalStorageHelper.get<string>(key);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static set(key: TokenType, token: string): void {
|
|
10
|
+
LocalStorageHelper.set(key, token);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static remove(key: TokenType): void {
|
|
14
|
+
LocalStorageHelper.remove(key);
|
|
15
|
+
}
|
|
16
|
+
}
|
package/{index.d.ts → index.ts}
RENAMED
package/package.json
CHANGED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Size } from '../../types';
|
|
2
|
+
import { ScreenBreakpoints } from './browser.consts';
|
|
3
|
+
import { IScreenBreakpoint } from './browser.interface';
|
|
4
|
+
import { OnResizeCallback, ResizeCallback } from './browser.types';
|
|
5
|
+
|
|
6
|
+
// TODO - extract into Resize and breakpoint separated?
|
|
7
|
+
|
|
8
|
+
export class BrowserService {
|
|
9
|
+
private screenBreakpoints!: Record<Size, number>;
|
|
10
|
+
private screenWidth: number = 0;
|
|
11
|
+
private lastBreakpoint!: IScreenBreakpoint;
|
|
12
|
+
private resizeListener!: (event: UIEvent) => void;
|
|
13
|
+
private breakpointChangeCallbacks: Set<ResizeCallback> = new Set(); // feuert nur bei Breakpoint-Änderung
|
|
14
|
+
private onResizeCallbacks: Set<OnResizeCallback> = new Set(); // feuert bei jedem throttled Resize
|
|
15
|
+
private rafId: number | null = null;
|
|
16
|
+
private emitTimeoutId: number | null = null; // für debounce der onResizeCallbacks
|
|
17
|
+
private pendingWidth?: number;
|
|
18
|
+
private pendingBreakpoint?: IScreenBreakpoint;
|
|
19
|
+
private duplicateThresholdMs = 60;
|
|
20
|
+
|
|
21
|
+
constructor(screenBreakpoints?: Record<Size, number>) {
|
|
22
|
+
if (typeof window !== 'undefined') {
|
|
23
|
+
this.screenBreakpoints = screenBreakpoints || ScreenBreakpoints;
|
|
24
|
+
|
|
25
|
+
this.screenWidth = window.innerWidth;
|
|
26
|
+
this.resizeListener = this.onResize.bind(this);
|
|
27
|
+
|
|
28
|
+
window.addEventListener('resize', this.resizeListener, { passive: true }); // passive: true für bessere Scroll/Resize-Performance
|
|
29
|
+
this.lastBreakpoint = this.getBreakpointByScreenWidth(this.screenWidth);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public destroy(): void {
|
|
34
|
+
if (typeof window !== 'undefined') {
|
|
35
|
+
window.removeEventListener('resize', this.resizeListener);
|
|
36
|
+
}
|
|
37
|
+
this.breakpointChangeCallbacks.clear();
|
|
38
|
+
this.onResizeCallbacks.clear();
|
|
39
|
+
if (this.rafId !== null) {
|
|
40
|
+
cancelAnimationFrame(this.rafId);
|
|
41
|
+
this.rafId = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public getCurrentScreenWidth(): number {
|
|
46
|
+
return this.screenWidth;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public getCurrentBreakpoint(): IScreenBreakpoint {
|
|
50
|
+
return this.lastBreakpoint;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public onBreakpointChange(callback: ResizeCallback): void {
|
|
54
|
+
this.breakpointChangeCallbacks.add(callback);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public offBreakpointChange(callback: ResizeCallback): void {
|
|
58
|
+
this.breakpointChangeCallbacks.delete(callback);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public onResizeChange(callback: OnResizeCallback): void {
|
|
62
|
+
this.onResizeCallbacks.add(callback);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public offResizeChange(callback: OnResizeCallback): void {
|
|
66
|
+
this.onResizeCallbacks.delete(callback);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public getBreakpointByScreenWidth(width: number = this.screenWidth): IScreenBreakpoint {
|
|
70
|
+
let result: Size = 'xs';
|
|
71
|
+
for (const key of Object.keys(this.screenBreakpoints) as Size[]) {
|
|
72
|
+
if (this.screenBreakpoints[key] <= width) {
|
|
73
|
+
result = key;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { breakpoint: result, screenWidth: this.screenBreakpoints[result] };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public isScreenGreaterThan(size: Size): boolean {
|
|
80
|
+
return this.screenWidth > this.screenBreakpoints[size];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public isScreenSmallerThan(size: Size): boolean {
|
|
84
|
+
return this.screenWidth < this.screenBreakpoints[size];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public getBreakpoint(size: Size): IScreenBreakpoint {
|
|
88
|
+
return {
|
|
89
|
+
breakpoint: size,
|
|
90
|
+
screenWidth: this.screenBreakpoints[size],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private onResize = (): void => {
|
|
95
|
+
if (typeof window === 'undefined') return;
|
|
96
|
+
|
|
97
|
+
const width: number = window.innerWidth;
|
|
98
|
+
const breakpoint: IScreenBreakpoint = this.getBreakpointByScreenWidth(width);
|
|
99
|
+
|
|
100
|
+
if (this.lastBreakpoint?.breakpoint !== breakpoint?.breakpoint) {
|
|
101
|
+
this.lastBreakpoint = breakpoint;
|
|
102
|
+
breakpoint && this.breakpointChangeCallbacks.forEach((cb) => cb(breakpoint));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
this.pendingWidth = width;
|
|
106
|
+
this.pendingBreakpoint = breakpoint;
|
|
107
|
+
|
|
108
|
+
if (this.emitTimeoutId) clearTimeout(this.emitTimeoutId);
|
|
109
|
+
|
|
110
|
+
this.emitTimeoutId = window.setTimeout(() => {
|
|
111
|
+
if (this.pendingBreakpoint) {
|
|
112
|
+
this.onResizeCallbacks.forEach((cb) => cb(this.pendingWidth!, this.pendingBreakpoint!));
|
|
113
|
+
}
|
|
114
|
+
this.pendingWidth = undefined;
|
|
115
|
+
this.pendingBreakpoint = undefined;
|
|
116
|
+
this.emitTimeoutId = null;
|
|
117
|
+
}, this.duplicateThresholdMs);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './browser';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"declarationMap": true,
|
|
5
|
+
"emitDeclarationOnly": true,
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
|
|
8
|
+
"target": "ES2022",
|
|
9
|
+
"useDefineForClassFields": true,
|
|
10
|
+
"module": "ESNext",
|
|
11
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
|
|
14
|
+
/* Bundler mode */
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"allowImportingTsExtensions": true,
|
|
17
|
+
"isolatedModules": true,
|
|
18
|
+
"moduleDetection": "force",
|
|
19
|
+
"noEmit": true,
|
|
20
|
+
|
|
21
|
+
/* Linting */
|
|
22
|
+
"strict": true,
|
|
23
|
+
"noImplicitAny": true,
|
|
24
|
+
"noImplicitOverride": true,
|
|
25
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
26
|
+
"noImplicitReturns": true,
|
|
27
|
+
"noFallthroughCasesInSwitch": true,
|
|
28
|
+
"noUnusedLocals": true,
|
|
29
|
+
"noUnusedParameters": true
|
|
30
|
+
},
|
|
31
|
+
"include": ["**/*"],
|
|
32
|
+
"exclude": ["node_modules", "dist"]
|
|
33
|
+
}
|
package/types/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Dictionary<T> = Record<string, T>;
|
|
2
|
+
|
|
3
|
+
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
export type UnknownObject = any;
|
|
8
|
+
export type Nullable<T> = T | null;
|
|
9
|
+
export type Optional<T> = T | undefined;
|
|
10
|
+
export const InstallTrigger: unknown;
|
|
11
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import dts from 'vite-plugin-dts';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
root: './lib',
|
|
6
|
+
build: {
|
|
7
|
+
lib: {
|
|
8
|
+
entry: 'index.ts',
|
|
9
|
+
name: 'ts-utils',
|
|
10
|
+
fileName: (format) => `index.${format}.js`,
|
|
11
|
+
formats: ['es', 'cjs', 'umd'],
|
|
12
|
+
},
|
|
13
|
+
outDir: '../dist/lib',
|
|
14
|
+
emptyOutDir: true,
|
|
15
|
+
},
|
|
16
|
+
plugins: [
|
|
17
|
+
dts({
|
|
18
|
+
insertTypesEntry: true,
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '../types';
|
|
2
|
-
export {};
|
|
3
|
-
declare global {
|
|
4
|
-
interface Array<T> {
|
|
5
|
-
distinct<T>(comparator?: (obj1: unknown, obj2: unknown) => boolean): T[];
|
|
6
|
-
filterBy<T>(valueGetter: (a: T) => boolean): T[];
|
|
7
|
-
first(): T;
|
|
8
|
-
groupBy(valueGetter: (a: T) => string): Dictionary<T[]>;
|
|
9
|
-
orderBy<T, G>(valueGetter: (a: T) => G, ascending?: boolean): T[];
|
|
10
|
-
removeBy<T, G>(valueGetter: (a: T) => G, val: G): T[];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=array-extension.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array-extension.d.ts","sourceRoot":"","sources":["../../../lib/extensions/array-extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,KAAK,CAAC,CAAC;QAChB,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;QACzE,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,IAAI,CAAC,CAAC;QACX,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,CAAC;QAClE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;KACtD;CACD"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ConfigType, ManipulateType, OpUnitType, UnitType } from 'dayjs';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Date {
|
|
4
|
-
isAfter(date: ConfigType, unit?: OpUnitType): boolean;
|
|
5
|
-
isBefore(date: ConfigType, unit?: OpUnitType): boolean;
|
|
6
|
-
format(template?: string): string;
|
|
7
|
-
isValid(): boolean;
|
|
8
|
-
add(value: number, unit?: ManipulateType): Date;
|
|
9
|
-
subtract(value: number, unit?: ManipulateType): Date;
|
|
10
|
-
firstDayOfMonth(): Date;
|
|
11
|
-
lastDayOfMonth(): Date;
|
|
12
|
-
set(unit: UnitType, value: number): Date;
|
|
13
|
-
diff(date: Date, unit?: UnitType): number;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=date-extension.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-extension.d.ts","sourceRoot":"","sources":["../../../lib/extensions/date-extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAK9E,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,IAAI;QACb,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;QACtD,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,OAAO,CAAC;QACnB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;QAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;QACrD,eAAe,IAAI,IAAI,CAAC;QACxB,cAAc,IAAI,IAAI,CAAC;QACvB,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACzC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;KAG1C;CACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-extensions.d.ts","sourceRoot":"","sources":["../../../lib/extensions/string-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,IAAI,MAAM,CAAC;QACrB,QAAQ,IAAI,OAAO,CAAC;QACpB,OAAO,IAAI,OAAO,CAAC;KACnB;CACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/clipboard.helper.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D"}
|
package/helpers/csv.helper.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ParseResult, UnparseConfig, UnparseObject } from 'papaparse';
|
|
2
|
-
export declare class CsvHelper {
|
|
3
|
-
static unparse<T>(data: T[] | UnparseObject<T>, config?: UnparseConfig): string;
|
|
4
|
-
static parse<T>(content: string | File): Promise<ParseResult<T>>;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=csv.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"csv.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/csv.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI3E,qBAAa,SAAS;IACrB,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM;IAI/E,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAShE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type SaveSource = Blob | ArrayBuffer | Uint8Array | string;
|
|
2
|
-
export interface SaveOptions {
|
|
3
|
-
mimeType?: string; /** MIME-Type, falls `source` kein Blob ist (z. B. "application/pdf") */
|
|
4
|
-
showSaveFilePicker?: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* save file on client
|
|
8
|
-
*
|
|
9
|
-
* 1) File System Access API (showSaveFilePicker) – if supported
|
|
10
|
-
* 2) Fallback: <a download> + blob: URL
|
|
11
|
-
* 3) iOS-/Safari-Fallback: open new Tab if download-attribute is being ignored
|
|
12
|
-
*/
|
|
13
|
-
export declare function saveAs(source: SaveSource, fileName: string, options?: SaveOptions): Promise<void>;
|
|
14
|
-
//# sourceMappingURL=download.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/download.helper.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAElE,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,wEAAwE;IAC3F,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyDvG"}
|
package/helpers/enum.helper.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IKeyValue } from '../interfaces/keyvalue.interface';
|
|
2
|
-
export declare class EnumHelper {
|
|
3
|
-
static getEnumValue<T extends object>(enumObj: T, key: string): T[keyof T];
|
|
4
|
-
static getKeyValues<T extends object>(enumObj: T): IKeyValue<string>[];
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=enum.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enum.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/enum.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,qBAAa,UAAU;IACtB,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAQ1E,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE;CAQtE"}
|
package/helpers/file.helper.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare class FileHelper {
|
|
2
|
-
static getFileExtension(filename: string): string;
|
|
3
|
-
/**
|
|
4
|
-
* read content from a file or blob
|
|
5
|
-
*/
|
|
6
|
-
static readAsText(file: File): Promise<string>;
|
|
7
|
-
static readAsArrayBuffer(file: File): Promise<ArrayBuffer>;
|
|
8
|
-
static readAsDataUrl(file: File): Promise<ProgressEvent<FileReader>>;
|
|
9
|
-
/** usage:
|
|
10
|
-
* const file = new File(['Hello'], 'test.txt');
|
|
11
|
-
* FileHelper.formatFileSize(file.size);
|
|
12
|
-
* */
|
|
13
|
-
static formatFileSize(bytes: number, decimals?: number, unit?: 'Bytes' | 'KB' | 'MB' | 'GB' | 'TB'): string;
|
|
14
|
-
static save(content: BlobPart, fileName: string, fileType: string): void;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=file.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/file.helper.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IACtB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAWjD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB9C,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAsB1D,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAWpE;;;SAGK;IACL,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM;IAoB9G,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAIxE"}
|
package/helpers/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare class LocalStorageHelper {
|
|
2
|
-
static set<T>(key: string, value: T): void;
|
|
3
|
-
static get<T>(key: string): Nullable<T>;
|
|
4
|
-
static remove(key: string): boolean;
|
|
5
|
-
static removeAll(): void;
|
|
6
|
-
static getKeysBy(key: string): string[];
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=local-storage.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/local-storage.helper.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC9B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAI1C,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IASvC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAQnC,MAAM,CAAC,SAAS,IAAI,IAAI;IAIxB,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;CAGvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger-type.enum.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/logger/logger-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;CACf"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { LoggerListener } from './logger.types';
|
|
2
|
-
export declare class LoggerHelper {
|
|
3
|
-
private static listeners;
|
|
4
|
-
static log(...args: unknown[]): void;
|
|
5
|
-
static info(...args: unknown[]): void;
|
|
6
|
-
static warn(...args: unknown[]): void;
|
|
7
|
-
static debug(...args: unknown[]): void;
|
|
8
|
-
static error(...args: unknown[]): void;
|
|
9
|
-
private static doLog;
|
|
10
|
-
static onLog(listener: LoggerListener, once?: boolean): () => void;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=logger.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.helper.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/logger/logger.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiB,MAAM,gBAAgB,CAAC;AAE/D,qBAAa,YAAY;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAkC;WAE5C,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI7B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;WAI/B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI7C,OAAO,CAAC,MAAM,CAAC,KAAK;WAoBN,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,UAAQ,GAAG,MAAM,IAAI;CAgBvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.types.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/logger/logger.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC"}
|
package/helpers/sort.helper.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sort.helper.d.ts","sourceRoot":"","sources":["../../../lib/helpers/sort.helper.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,YAAY,OAAO,KAAG,MAI5F,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/token/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-type.enum.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/token/token-type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token.helper.d.ts","sourceRoot":"","sources":["../../../../lib/helpers/token/token.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,WAAW;IACvB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IAIzC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/C,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI;CAGnC"}
|