@mosa-ng/core 19.0.1 → 20.0.1

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.
Files changed (53) hide show
  1. package/fesm2022/mosa-ng-core.mjs +126 -240
  2. package/fesm2022/mosa-ng-core.mjs.map +1 -1
  3. package/index.d.ts +816 -3
  4. package/package.json +3 -3
  5. package/lib/constants/local-storage.constant.d.ts +0 -2
  6. package/lib/enums/browser.enum.d.ts +0 -9
  7. package/lib/enums/content-position.enum.d.ts +0 -11
  8. package/lib/enums/i18n-supported.enum.d.ts +0 -10
  9. package/lib/enums/theme.enum.d.ts +0 -4
  10. package/lib/models/api-options.model.d.ts +0 -17
  11. package/lib/models/dictionary-item.model.d.ts +0 -7
  12. package/lib/models/key-map.model.d.ts +0 -3
  13. package/lib/models/logger/log-event.model.d.ts +0 -7
  14. package/lib/models/logger/log-message-data.model.d.ts +0 -4
  15. package/lib/models/logger/log-type.model.d.ts +0 -1
  16. package/lib/models/logger/log.model.d.ts +0 -9
  17. package/lib/models/logger/logger-base-config.model.d.ts +0 -8
  18. package/lib/models/logger/logger-config.model.d.ts +0 -8
  19. package/lib/models/logger/logger-default-config.model.d.ts +0 -4
  20. package/lib/models/mosa-duration.model.d.ts +0 -1
  21. package/lib/models/sieve/sieve-filter.model.d.ts +0 -9
  22. package/lib/models/sieve/sieve-operator.model.d.ts +0 -69
  23. package/lib/models/sieve/sieve-options.model.d.ts +0 -12
  24. package/lib/models/sieve/sieve-response.model.d.ts +0 -4
  25. package/lib/models/sieve/sieve-sort.model.d.ts +0 -7
  26. package/lib/models/token-settings.model.d.ts +0 -5
  27. package/lib/models/transform-matrix.model.d.ts +0 -5
  28. package/lib/mosa-core.module.d.ts +0 -80
  29. package/lib/pipes/dictionary-item-pipe/dictionary-item-pipe.module.d.ts +0 -8
  30. package/lib/pipes/dictionary-item-pipe/dictionary-item.pipe.d.ts +0 -8
  31. package/lib/pipes/find-in-array/find-in-array-pipe.module.d.ts +0 -8
  32. package/lib/pipes/find-in-array/find-in-array.pipe.d.ts +0 -7
  33. package/lib/pipes/join/join-pipe.module.d.ts +0 -8
  34. package/lib/pipes/join/join.pipe.d.ts +0 -13
  35. package/lib/pipes/mosa-date-pipe/mosa-date-pipe.module.d.ts +0 -8
  36. package/lib/pipes/mosa-date-pipe/mosa-date.pipe.d.ts +0 -18
  37. package/lib/pipes/mosa-duration-pipe/mosa-duration-pipe.module.d.ts +0 -8
  38. package/lib/pipes/mosa-duration-pipe/mosa-duration.pipe.d.ts +0 -27
  39. package/lib/services/api.service.d.ts +0 -110
  40. package/lib/services/core-logger.service.d.ts +0 -80
  41. package/lib/services/guards/can-deactivate.guard.d.ts +0 -11
  42. package/lib/services/mosa-socket.service.d.ts +0 -11
  43. package/lib/services/translation/assets-i18n-loader.service.d.ts +0 -16
  44. package/lib/services/translation/custom-translate-loader.service.d.ts +0 -9
  45. package/lib/services/translation/translate-collector.service.d.ts +0 -15
  46. package/lib/utils/commons.util.d.ts +0 -47
  47. package/lib/utils/dictionary.util.d.ts +0 -70
  48. package/lib/utils/item.util.d.ts +0 -4
  49. package/lib/utils/promise.util.d.ts +0 -2
  50. package/lib/utils/prototypes.util.d.ts +0 -80
  51. package/lib/utils/sieve.util.d.ts +0 -71
  52. package/lib/utils/size.util.d.ts +0 -4
  53. package/public-api.d.ts +0 -1
@@ -1,80 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ILogEvent } from '../models/logger/log-event.model';
3
- import { LogType } from '../models/logger/log-type.model';
4
- import { ILoggerConfig } from '../models/logger/logger-config.model';
5
- import { ILoggerDefaultConfig } from '../models/logger/logger-default-config.model';
6
- import * as i0 from "@angular/core";
7
- export declare class CoreLoggerService {
8
- defaultConfig: ILoggerDefaultConfig;
9
- private readonly uiLogs$;
10
- /**
11
- * Default constructor
12
- */
13
- constructor();
14
- subUiLogs(): Observable<ILogEvent>;
15
- /**
16
- * Gets the error message from any type of object
17
- */
18
- getErrorMsg(err: any): string;
19
- /**
20
- * Get the title to be shown in logger toast
21
- * @param err
22
- */
23
- getErrorTitle(err: any): string;
24
- /**
25
- * Logs an error to the user
26
- * @param data
27
- * @param showUser
28
- * @param config
29
- */
30
- logError(config: ILoggerConfig): void;
31
- /**
32
- * Logs a success message to the user
33
- * @param data
34
- * @param config
35
- */
36
- logSuccess(config: ILoggerConfig): void;
37
- /**
38
- * Logs a warning to the user
39
- * @param data
40
- * @param showUser
41
- * @param config
42
- */
43
- logWarning(config: ILoggerConfig): void;
44
- /**
45
- * Logs an info to the user
46
- * @param data
47
- * @param config
48
- */
49
- logInfo(config: ILoggerConfig): void;
50
- /**
51
- * Logs any kind of message to the user
52
- * @param data
53
- * @param config
54
- */
55
- log(config: ILoggerConfig): void;
56
- /**
57
- * Show the log
58
- * @requires @mosa-ng/material
59
- * @param data
60
- * @param type
61
- * @param config
62
- */
63
- show(config: ILoggerConfig, type: LogType): void;
64
- /**
65
- * Serializes empty values, so no error is being returned
66
- * @param config
67
- * @private
68
- */
69
- private serializeConfig;
70
- /**
71
- * Gets a value which is not undefined or null
72
- * @param val
73
- * @param val1
74
- * @param def
75
- * @private
76
- */
77
- private static getValue;
78
- static ɵfac: i0.ɵɵFactoryDeclaration<CoreLoggerService, never>;
79
- static ɵprov: i0.ɵɵInjectableDeclaration<CoreLoggerService>;
80
- }
@@ -1,11 +0,0 @@
1
- import { CanDeactivate } from '@angular/router';
2
- import { Observable } from 'rxjs';
3
- import * as i0 from "@angular/core";
4
- export interface CanComponentDeactivate {
5
- canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;
6
- }
7
- export declare class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> {
8
- canDeactivate(component: CanComponentDeactivate): boolean;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<CanDeactivateGuard, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<CanDeactivateGuard>;
11
- }
@@ -1,11 +0,0 @@
1
- import { Subject } from 'rxjs';
2
- import * as i0 from "@angular/core";
3
- export declare class MosaSocketService {
4
- private subject;
5
- constructor();
6
- connect(url: string): Subject<MessageEvent>;
7
- send(data: MessageEvent): void;
8
- private create;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<MosaSocketService, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<MosaSocketService>;
11
- }
@@ -1,16 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { TranslateCollectorService } from './translate-collector.service';
4
- import * as i0 from "@angular/core";
5
- export declare class AssetsI18nLoaderService {
6
- protected myHttpClient: HttpClient;
7
- protected myTranslateCollectorService: TranslateCollectorService;
8
- protected priority: number;
9
- protected supportedLanguages: string[];
10
- private subLanguages;
11
- constructor(myHttpClient: HttpClient, myTranslateCollectorService: TranslateCollectorService);
12
- init(path?: string, libName?: string, priority?: number): Promise<void>;
13
- protected loadTranslations(lang: string, path?: string, libName?: string, priority?: number): Observable<Record<string, string>>;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<AssetsI18nLoaderService, never>;
15
- static ɵprov: i0.ɵɵInjectableDeclaration<AssetsI18nLoaderService>;
16
- }
@@ -1,9 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { IKeyMap } from '../../models/key-map.model';
3
- import * as i0 from "@angular/core";
4
- export declare class CustomTranslateLoaderService {
5
- getTranslation(lang: string): Observable<IKeyMap<string>>;
6
- private loadFallbackLanguage;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<CustomTranslateLoaderService, never>;
8
- static ɵprov: i0.ɵɵInjectableDeclaration<CustomTranslateLoaderService>;
9
- }
@@ -1,15 +0,0 @@
1
- import { TranslateService } from '@ngx-translate/core';
2
- import { IKeyMap } from '../../models/key-map.model';
3
- import * as i0 from "@angular/core";
4
- export interface ITranslationMap {
5
- priority: number;
6
- translation: IKeyMap<string>;
7
- }
8
- export declare class TranslateCollectorService {
9
- private readonly myTranslateService;
10
- private translationMap;
11
- constructor(myTranslateService: TranslateService);
12
- addTranslations(translation: Record<string, string>, lang: string, priority: number): void;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<TranslateCollectorService, never>;
14
- static ɵprov: i0.ɵɵInjectableDeclaration<TranslateCollectorService>;
15
- }
@@ -1,47 +0,0 @@
1
- import { ITransformMatrix } from '../models/transform-matrix.model';
2
- /**
3
- * Checks if an object is null or undefined. Does not check for
4
- * empty strings, or false booleans
5
- * @param val
6
- */
7
- export declare function isNullOrUndefined(val: any): boolean;
8
- /**
9
- * Checks if a string is null or empty
10
- * @param str
11
- */
12
- export declare function isNullOrEmpty(str: string): boolean;
13
- /**
14
- * Checks if a string or number is zero or higher
15
- * @param num
16
- */
17
- export declare function isZeroOrHigher(num: number | string): boolean;
18
- /**
19
- * Checks if an object is a number
20
- * @param num
21
- */
22
- export declare function isNumber(num: any): boolean;
23
- /**
24
- * Round to nearest number given
25
- * @param value
26
- * @param round
27
- */
28
- export declare function roundNearest(value: number): number;
29
- /**
30
- * Merge a two dimensional array
31
- * @param array
32
- */
33
- export declare function mergeArray<T>(array: T[][]): T[];
34
- /**
35
- * Get CSS Transform matrix from an element
36
- * @param element
37
- */
38
- export declare function getTransformMatrix(element: HTMLElement): ITransformMatrix;
39
- /**
40
- * Generates a random string with numbers and letters
41
- * @param length
42
- */
43
- export declare function getRandomString(length?: number): string;
44
- /**
45
- * Trys to convert a json string. If it fails it returns [null] or a given fallback of [T]
46
- */
47
- export declare function tryJsonParse<T>(data: string, fallback?: () => T): T | null;
@@ -1,70 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { IDictionaryItem } from '../models/dictionary-item.model';
3
- import { IKeyMap } from '../models/key-map.model';
4
- export declare class Dictionary<Key, Value> {
5
- private readonly dictionaryItems$;
6
- /**
7
- * Default constructor.
8
- * @param data Requires an array of IDictionaryItem with a key and a value
9
- */
10
- constructor(...data: IDictionaryItem<Key, Value>[]);
11
- /**
12
- * Observable to subscribe to dictionary changes
13
- */
14
- valueChanges(): Observable<IDictionaryItem<Key, Value>[]>;
15
- /**
16
- * Observable to subscribe to dictionary as object changes
17
- */
18
- objectArray(): Observable<IKeyMap<Value>>;
19
- /**
20
- * Gets the items of the dictionary
21
- * @returns dictionary items
22
- */
23
- get items(): IDictionaryItem<Key, Value>[];
24
- /**
25
- * Gets a dictionary item by key
26
- * @param key
27
- * @returns single dictionary item
28
- */
29
- get(key: Key): IDictionaryItem<Key, Value>;
30
- /**
31
- * Checks if dictionary contains item
32
- * @param key
33
- */
34
- contains(key: Key): boolean;
35
- /**
36
- * Adds a dictionary item
37
- * @param key
38
- * @param value
39
- */
40
- add(key: Key, value: Value): void;
41
- /**
42
- * Updates a dictionary item
43
- * @param data
44
- * @param index
45
- */
46
- update(data: IDictionaryItem<Key, Value>, index?: number): void;
47
- /**
48
- * Gets an index with a specific key
49
- * @param key
50
- */
51
- getIndex(key: Key): number;
52
- /**
53
- * Removes an item from the dictionary
54
- * @param value
55
- * @param index
56
- */
57
- remove(value: Key, index?: number): void;
58
- /**
59
- * Private function to cast array to an object
60
- * @param items
61
- * @private
62
- */
63
- private toObject;
64
- /**
65
- * Private function to update dictionary items
66
- * @param items
67
- * @private
68
- */
69
- private updateItems;
70
- }
@@ -1,4 +0,0 @@
1
- export interface IItem {
2
- key: number;
3
- label: string;
4
- }
@@ -1,2 +0,0 @@
1
- export type PromiseResolve<T> = (value?: T | PromiseLike<T>) => void;
2
- export type PromiseReject = (reason?: any) => void;
@@ -1,80 +0,0 @@
1
- /**
2
- * Cast any type
3
- * @param data to be casted
4
- * @returns casted data
5
- */
6
- export declare function cast<T>(data: any): T;
7
- export declare class StringExtensions implements IStringExtensions {
8
- getPart(maxChars: number, appendDot?: boolean): string;
9
- fromJSON<T>(): T;
10
- toCSSClass(): string;
11
- toUTC(): string;
12
- }
13
- export declare class ArrayExtensions implements IArrayExtensions {
14
- hasChanges<T>(data: T[]): boolean;
15
- replaceRange<T>(data: T[], start: number, end: number): T[];
16
- }
17
- export declare class NumberExtensions implements INumberExtensions {
18
- between(start: number, end: number): boolean;
19
- }
20
- /**
21
- * @interface StringExtensions
22
- */
23
- export interface IStringExtensions {
24
- /**
25
- * Gets a part of a string
26
- * @param maxChars maximum amount of chars
27
- * @param appendDot append three dots at the end
28
- * @returns splitted string
29
- */
30
- getPart(maxChars: number, appendDot?: boolean): string;
31
- /**
32
- * Converts a string from json
33
- * @returns object of expected type
34
- */
35
- fromJSON<T>(): T;
36
- /**
37
- * Converts a string to a css class
38
- * @returns converted kebab case css class
39
- */
40
- toCSSClass(): string;
41
- /**
42
- * Converts a datetime string to utc format
43
- */
44
- toUTC(): string;
45
- }
46
- export interface IArrayExtensions {
47
- /**
48
- * Checks if array has changes
49
- * @param data array passed
50
- * @deprecated learn how to program
51
- */
52
- hasChanges: <T>(data: T[]) => boolean;
53
- /**
54
- * Replaces a specific element range in an array
55
- * @param data
56
- */
57
- replaceRange: <T>(replaceData: T[], start: number, end: number) => T[];
58
- }
59
- export interface INumberExtensions {
60
- /**
61
- * checks if a number in a range
62
- * @param start of range
63
- * @param end of range
64
- */
65
- between(start: number, end: number): boolean;
66
- }
67
- declare global {
68
- interface String extends IStringExtensions {
69
- }
70
- interface Array<T> extends IArrayExtensions {
71
- }
72
- interface Number extends INumberExtensions {
73
- }
74
- }
75
- export declare class Prototypes {
76
- /**
77
- * Initialize prototypes
78
- */
79
- static init(): void;
80
- }
@@ -1,71 +0,0 @@
1
- import { ISieveFilter } from '../models/sieve/sieve-filter.model';
2
- import { SieveOperator } from '../models/sieve/sieve-operator.model';
3
- import { ISieveOptions } from '../models/sieve/sieve-options.model';
4
- import { ISieveSort } from '../models/sieve/sieve-sort.model';
5
- export declare class Sieve {
6
- private readonly options;
7
- constructor(options: ISieveOptions);
8
- /**
9
- * public getter to get page size
10
- */
11
- get pageSize(): number;
12
- /**
13
- * Setter to set page size
14
- */
15
- set pageSize(pageSize: number);
16
- /**
17
- * public getter to get page
18
- */
19
- get page(): number;
20
- /**
21
- * Setter to set page
22
- */
23
- set page(page: number);
24
- /**
25
- * public getter to get filters
26
- */
27
- get filters(): ISieveFilter[];
28
- /**
29
- * Setter to set filters
30
- */
31
- set filters(filters: ISieveFilter[]);
32
- /**
33
- * public getter to get sorts
34
- */
35
- get sorts(): ISieveSort[];
36
- /**
37
- * Setter to set sorts
38
- */
39
- set sorts(sorts: ISieveSort[]);
40
- /**
41
- * method to add a sort option
42
- * @param name of the item to sort
43
- * @param desc sort descending
44
- */
45
- addSort(name: string, desc?: boolean): void;
46
- /**
47
- * method to add a filter option
48
- * @param key of the item
49
- * @param operator { SieveOperator }
50
- * @param value filtered value
51
- */
52
- addFilter(key: string, operator: SieveOperator, value: string): void;
53
- /**
54
- * Getter for base url
55
- */
56
- get baseUrl(): string;
57
- /**
58
- * Setter for base url
59
- * @param url
60
- */
61
- set baseUrl(url: string);
62
- /**
63
- * Convert to queried string
64
- */
65
- getUrl(): string;
66
- /**
67
- * to Query
68
- * @private converts options to actual query
69
- */
70
- private toQuery;
71
- }
@@ -1,4 +0,0 @@
1
- export interface ISize {
2
- width: number;
3
- height: number;
4
- }
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/mosa-core.module';