@stemy/ngx-utils 13.2.3 → 13.3.0
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/esm2020/ngx-utils/common-types.mjs +2 -1
- package/esm2020/ngx-utils/ngx-utils.imports.mjs +5 -1
- package/esm2020/ngx-utils/ngx-utils.module.mjs +7 -2
- package/esm2020/ngx-utils/services/base-http.service.mjs +4 -1
- package/esm2020/ngx-utils/services/local-http.service.mjs +47 -0
- package/esm2020/ngx-utils/services/state.service.mjs +2 -2
- package/esm2020/ngx-utils/services/wasm.service.mjs +46 -0
- package/esm2020/ngx-utils/utils/jsonfn.mjs +45 -0
- package/esm2020/ngx-utils/utils/wasi.mjs +159 -0
- package/esm2020/ngx-utils/utils/wasm-worker-proxy.mjs +99 -0
- package/esm2020/public_api.mjs +5 -2
- package/fesm2015/stemy-ngx-utils.mjs +465 -70
- package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
- package/fesm2020/stemy-ngx-utils.mjs +460 -68
- package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +29 -0
- package/ngx-utils/services/base-http.service.d.ts +1 -0
- package/ngx-utils/services/local-http.service.d.ts +14 -0
- package/ngx-utils/services/wasm.service.d.ts +25 -0
- package/ngx-utils/utils/jsonfn.d.ts +6 -0
- package/ngx-utils/utils/wasi.d.ts +26 -0
- package/ngx-utils/utils/wasm-worker-proxy.d.ts +17 -0
- package/package.json +1 -1
- package/public_api.d.ts +4 -1
|
@@ -97,6 +97,33 @@ export interface IPromiseService {
|
|
|
97
97
|
reject<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
98
98
|
}
|
|
99
99
|
export declare const PROMISE_SERVICE: InjectionToken<IPromiseService>;
|
|
100
|
+
export declare type TypedArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Float32Array | Float64Array;
|
|
101
|
+
export interface IWasmExports {
|
|
102
|
+
HEAP8: Int8Array;
|
|
103
|
+
HEAP16: Int16Array;
|
|
104
|
+
HEAP32: Int32Array;
|
|
105
|
+
HEAPU8: Uint8Array;
|
|
106
|
+
HEAPU16: Uint16Array;
|
|
107
|
+
HEAPU32: Uint32Array;
|
|
108
|
+
HEAPF32: Float32Array;
|
|
109
|
+
HEAPF64: Float64Array;
|
|
110
|
+
memory: WebAssembly.Memory;
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}
|
|
113
|
+
export interface IWasi {
|
|
114
|
+
instantiate(bytes: ArrayBuffer): Promise<IWasmExports>;
|
|
115
|
+
}
|
|
116
|
+
export interface IWasm {
|
|
117
|
+
writeArrayToMemory(array: TypedArray): Promise<number> | number;
|
|
118
|
+
readArrayFromMemory<T = TypedArray>(pointer: number, array: T): Promise<T> | T;
|
|
119
|
+
[key: string]: (...args: any[]) => any;
|
|
120
|
+
}
|
|
121
|
+
export interface IWasmAsync {
|
|
122
|
+
writeArrayToMemory(array: TypedArray): Promise<number>;
|
|
123
|
+
readArrayFromMemory<T = TypedArray>(pointer: number, array: T): T;
|
|
124
|
+
[key: string]: (...args: any[]) => Promise<any>;
|
|
125
|
+
}
|
|
126
|
+
export declare const WASI_IMPLEMENTATION: InjectionToken<Type<IWasi>>;
|
|
100
127
|
export interface IAsyncMessage {
|
|
101
128
|
message: string;
|
|
102
129
|
context?: any;
|
|
@@ -264,6 +291,7 @@ export declare class ResourceIfContext {
|
|
|
264
291
|
}
|
|
265
292
|
export declare const APP_BASE_URL: InjectionToken<string>;
|
|
266
293
|
export declare class IConfiguration {
|
|
294
|
+
cdnUrl?: string;
|
|
267
295
|
baseUrl?: string;
|
|
268
296
|
baseDomain?: string;
|
|
269
297
|
translationUrl?: string;
|
|
@@ -302,6 +330,7 @@ export interface IModuleConfig {
|
|
|
302
330
|
promiseService?: Type<IPromiseService>;
|
|
303
331
|
configService?: Type<IConfigService>;
|
|
304
332
|
globalTemplates?: Type<IGlobalTemplates>;
|
|
333
|
+
wasiImplementation?: Type<IWasi>;
|
|
305
334
|
initializeApp?: (injector: Injector) => AppInitializerFunc;
|
|
306
335
|
baseUrl?: (injector: Injector) => string;
|
|
307
336
|
}
|
|
@@ -21,6 +21,7 @@ export declare class BaseHttpService implements IHttpService {
|
|
|
21
21
|
protected static retryFailedRequests(): void;
|
|
22
22
|
get universal(): UniversalService;
|
|
23
23
|
constructor(client: BaseHttpClient, storage: StorageService, language: ILanguageService, toaster: IToasterService, configs: IConfigService, request?: Request);
|
|
24
|
+
protected initService(): void;
|
|
24
25
|
url(url: string): string;
|
|
25
26
|
createUrl(url: string, params: IHttpParams): string;
|
|
26
27
|
makeListParams(page: number, itemsPerPage: number, orderBy?: string, orderDescending?: boolean, filter?: string): IHttpParams;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IRequestOptions } from "../common-types";
|
|
2
|
+
import { BaseHttpService } from "./base-http.service";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class LocalHttpService extends BaseHttpService {
|
|
5
|
+
private images;
|
|
6
|
+
get name(): string;
|
|
7
|
+
protected get withCredentials(): boolean;
|
|
8
|
+
protected initService(): void;
|
|
9
|
+
url(url: string): string;
|
|
10
|
+
get(url: string, options?: IRequestOptions): Promise<any>;
|
|
11
|
+
getImage(url: string): Promise<HTMLImageElement>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocalHttpService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LocalHttpService>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Type } from "@angular/core";
|
|
2
|
+
import { IWasi, IWasm, IWasmAsync } from "../common-types";
|
|
3
|
+
import { UniversalService } from "./universal.service";
|
|
4
|
+
import { LocalHttpService } from "./local-http.service";
|
|
5
|
+
import { Wasi } from "../utils/wasi";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Use this service to load WebAssembly modules
|
|
9
|
+
*/
|
|
10
|
+
export declare class WasmService {
|
|
11
|
+
protected universal: UniversalService;
|
|
12
|
+
protected http: LocalHttpService;
|
|
13
|
+
protected wasi: Type<Wasi>;
|
|
14
|
+
protected modules: {
|
|
15
|
+
[url: string]: Promise<any>;
|
|
16
|
+
};
|
|
17
|
+
protected workerModules: {
|
|
18
|
+
[url: string]: any;
|
|
19
|
+
};
|
|
20
|
+
constructor(universal: UniversalService, http: LocalHttpService, wasi: IWasi);
|
|
21
|
+
getModule<T = IWasm>(name: string): Promise<T>;
|
|
22
|
+
getWorkerModule<T = IWasmAsync>(name: string): T;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WasmService, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WasmService>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IWasi, IWasmExports } from "../common-types";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class Wasi implements IWasi {
|
|
4
|
+
protected env: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
7
|
+
protected instantiated: boolean;
|
|
8
|
+
protected wasi: any;
|
|
9
|
+
protected wasm: IWasmExports;
|
|
10
|
+
protected envStrings: string[];
|
|
11
|
+
constructor();
|
|
12
|
+
instantiate(bytes: ArrayBuffer): Promise<IWasmExports>;
|
|
13
|
+
protected updateMemoryViews(): void;
|
|
14
|
+
protected getEnvStrings(): string[];
|
|
15
|
+
protected stringToAscii(str: any, buffer: any): void;
|
|
16
|
+
emscripten_notify_memory_growth(memoryIndex: number): void;
|
|
17
|
+
proc_exit(rval: number): void;
|
|
18
|
+
environ_get(environ: number, environ_buf: number): number;
|
|
19
|
+
environ_sizes_get(penviron_count: number, penviron_buf_size: number): number;
|
|
20
|
+
fd_close(fd: number): number;
|
|
21
|
+
fd_write(fd: number, iovs: number, iovs_len: number, nwritten: number): number;
|
|
22
|
+
fd_read(fd: number, iovs: number, iovs_len: number, nread: number): number;
|
|
23
|
+
fd_seek(fd: number, offset: number, whence: number, newOffset: number): number;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Wasi, never>;
|
|
25
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<Wasi>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IWasi } from "../common-types";
|
|
2
|
+
import { Type } from "@angular/core";
|
|
3
|
+
interface IPromiseExecutor {
|
|
4
|
+
resolve: (value?: any) => void;
|
|
5
|
+
reject: (reason?: any) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function workerFunction(JSONfn: any, logTimes: boolean): void;
|
|
8
|
+
export declare class WasmWorkerProxy {
|
|
9
|
+
protected methods: Promise<string[]>;
|
|
10
|
+
protected onMethods: (methods: string[]) => void;
|
|
11
|
+
protected worker: Worker;
|
|
12
|
+
protected promises: Map<string, IPromiseExecutor>;
|
|
13
|
+
constructor(wasmPath: string, wasi: Type<IWasi>, logTimes?: boolean);
|
|
14
|
+
onMessage(e: MessageEvent): void;
|
|
15
|
+
call(method: string, args: any[]): Promise<any>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorederedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, ITableColumns, ITableTemplate, ITableTemplates, TableDataLoader, ResourceIfContext, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, IGlobalTemplates, GLOBAL_TEMPLATES, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
1
|
+
export { IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorederedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, ITableColumns, ITableTemplate, ITableTemplates, TableDataLoader, ResourceIfContext, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, IGlobalTemplates, GLOBAL_TEMPLATES, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
2
2
|
export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
|
|
3
3
|
export { ObjectUtils } from "./ngx-utils/utils/object.utils";
|
|
4
4
|
export { DateUtils } from "./ngx-utils/utils/date.utils";
|
|
@@ -8,6 +8,7 @@ export { GenericValue } from "./ngx-utils/utils/generic-value";
|
|
|
8
8
|
export { FileSystemEntryOpenResult, FileSystemEntryOpenCb, FileSystemEntry } from "./ngx-utils/utils/file-system";
|
|
9
9
|
export { IShape, Rect, Circle, Point } from "./ngx-utils/utils/geometry";
|
|
10
10
|
export { Initializer } from "./ngx-utils/utils/initializer";
|
|
11
|
+
export { JSONfn } from "./ngx-utils/utils/jsonfn";
|
|
11
12
|
export { ReflectUtils } from "./ngx-utils/utils/reflect.utils";
|
|
12
13
|
export { LoaderUtils } from "./ngx-utils/utils/loader.utils";
|
|
13
14
|
export { MathUtils } from "./ngx-utils/utils/math.utils";
|
|
@@ -20,6 +21,7 @@ export { TimerUtils } from "./ngx-utils/utils/timer.utils";
|
|
|
20
21
|
export { UniqueUtils } from "./ngx-utils/utils/unique.utils";
|
|
21
22
|
export { Vector } from "./ngx-utils/utils/vector";
|
|
22
23
|
export { UniversalService } from "./ngx-utils/services/universal.service";
|
|
24
|
+
export { WasmService } from "./ngx-utils/services/wasm.service";
|
|
23
25
|
export { AclService } from "./ngx-utils/services/acl.service";
|
|
24
26
|
export { ApiService } from "./ngx-utils/services/api.service";
|
|
25
27
|
export { StaticAuthService } from "./ngx-utils/services/auth.service";
|
|
@@ -32,6 +34,7 @@ export { FormatterService } from "./ngx-utils/services/formatter.service";
|
|
|
32
34
|
export { GlobalTemplateService } from "./ngx-utils/services/global-template.service";
|
|
33
35
|
export { IconService } from "./ngx-utils/services/icon.service";
|
|
34
36
|
export { LanguageService } from "./ngx-utils/services/language.service";
|
|
37
|
+
export { LocalHttpService } from "./ngx-utils/services/local-http.service";
|
|
35
38
|
export { OpenApiService } from "./ngx-utils/services/open-api.service";
|
|
36
39
|
export { IStateInfo, StateService } from "./ngx-utils/services/state.service";
|
|
37
40
|
export { StaticLanguageService } from "./ngx-utils/services/static-language.service";
|