@ngrdt/utils 0.0.72 → 0.0.77

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.
@@ -1,69 +0,0 @@
1
- import { HttpResponse } from '@angular/common/http';
2
- import { AllEncodingAliases } from '../types/encodings';
3
- import { RdtMimeType } from '../types/mime-types';
4
- import { Nullable } from '../types/type';
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 RdtFile<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.UNKNOWN;
37
- export declare const RDT_DEFAULT_MS_OFFICE_ACTION = RdtMsOfficeAction.View;
38
- export declare enum RdtFileSizeUnit {
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} ${RdtFileSizeUnit}`;
50
- export declare class RdtFileUtils {
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?: AllEncodingAliases): 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 | undefined;
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: RdtFileSizeUnit): number;
67
- static fileSizeToBytes(fileSize: RdtFileSize): number | null;
68
- static getMsOfficeAppByMimeType(mimeType: RdtMimeType | undefined): RdtMsOfficeApp | null;
69
- }
@@ -1,4 +0,0 @@
1
- export declare class RdtHTMLUtils {
2
- static scrollIntoViewHorizontallyWithinParent(element: HTMLElement): void;
3
- static setCaretPosition(element: HTMLInputElement, index: number): void;
4
- }
@@ -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
- }
@@ -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
- };
@@ -1,6 +0,0 @@
1
- export declare class RdtObjectUtils {
2
- static pluck<T>(obj: T, path: string | (string | number)[]): any;
3
- static notNullGuard<T>(value: T | undefined | null): value is T;
4
- static expandKey(key: string, value: any): any;
5
- static someValuesTrue(obj: Record<symbol, boolean>): boolean;
6
- }
@@ -1,4 +0,0 @@
1
- export declare class RdtRandomUtils {
2
- static randomId(): string;
3
- static trueFalse(): boolean;
4
- }
@@ -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,4 +0,0 @@
1
- import { Signal } from '@angular/core';
2
- import { ToObservableOptions } from '@angular/core/rxjs-interop';
3
- export declare function signalToPromise<T>(source: Signal<T>, options?: ToObservableOptions): Promise<T>;
4
- export declare function signalToPromiseOnce<T>(source: Signal<T>, options?: ToObservableOptions): Promise<T>;
@@ -1,23 +0,0 @@
1
- import { Params } from '@angular/router';
2
- import { Nullable } from '../types/type';
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: Nullable<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
- static stripQueryParams(url: string): string;
23
- }