@stemy/ngx-utils 19.6.11 → 19.7.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/fesm2022/stemy-ngx-utils.mjs +669 -798
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +23 -37
- package/ngx-utils/components/interactive-canvas/interactive-canvas.component.d.ts +31 -15
- package/ngx-utils/components/interactive-canvas/interactive-circle.component.d.ts +4 -8
- package/ngx-utils/components/interactive-canvas/interactive-item.component.d.ts +23 -21
- package/ngx-utils/components/interactive-canvas/interactive-rect.component.d.ts +6 -9
- package/ngx-utils/ngx-utils.imports.d.ts +2 -5
- package/ngx-utils/tokens.d.ts +1 -2
- package/ngx-utils/utils/{canvas.utils.d.ts → canvas.d.ts} +2 -0
- package/ngx-utils/utils/geometry/distance.d.ts +25 -0
- package/ngx-utils/utils/geometry/functions.d.ts +13 -0
- package/ngx-utils/utils/geometry/index.d.ts +2 -0
- package/ngx-utils/utils/geometry/shapes.d.ts +48 -0
- package/ngx-utils/utils/misc.d.ts +2 -1
- package/ngx-utils/utils/reflect.utils.d.ts +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +5 -8
- package/ngx-utils/services/wasm.service.d.ts +0 -25
- package/ngx-utils/utils/geometry.d.ts +0 -46
- package/ngx-utils/utils/vector.d.ts +0 -23
- package/ngx-utils/utils/wasi.d.ts +0 -26
- package/ngx-utils/utils/wasm-worker-proxy.d.ts +0 -17
- package/ngx-utils/utils/with-options-provider.d.ts +0 -3
|
@@ -3,7 +3,7 @@ import { HttpClient, HttpHeaders } from "@angular/common/http";
|
|
|
3
3
|
import { ActivatedRouteSnapshot, Data, LoadChildrenCallback, Route, Routes, UrlTree } from "@angular/router";
|
|
4
4
|
import { Observable } from "rxjs";
|
|
5
5
|
import { DurationLikeObject } from "luxon";
|
|
6
|
-
import { StringKeys } from "./helper-types";
|
|
6
|
+
import { MaybePromise, StringKeys } from "./helper-types";
|
|
7
7
|
export type DurationUnit = StringKeys<DurationLikeObject>;
|
|
8
8
|
export interface TypedFactoryProvider<T> {
|
|
9
9
|
useFactory: (...args: any[]) => T;
|
|
@@ -92,7 +92,7 @@ export interface IAuthService {
|
|
|
92
92
|
export type RouteValidator = (auth: IAuthService, route?: IRoute, next?: ActivatedRouteSnapshot) => Promise<boolean>;
|
|
93
93
|
export interface IRouteData extends Data {
|
|
94
94
|
returnState?: string[];
|
|
95
|
-
guards?: Array<ResolveFactory | RouteValidator>;
|
|
95
|
+
guards?: Array<ResolveFactory<RouteValidator> | RouteValidator>;
|
|
96
96
|
}
|
|
97
97
|
export interface IRoute extends Route {
|
|
98
98
|
data?: IRouteData;
|
|
@@ -173,32 +173,6 @@ export interface IPromiseService {
|
|
|
173
173
|
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
174
174
|
reject<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
175
175
|
}
|
|
176
|
-
export type TypedArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Float32Array | Float64Array;
|
|
177
|
-
export interface IWasmExports {
|
|
178
|
-
HEAP8: Int8Array;
|
|
179
|
-
HEAP16: Int16Array;
|
|
180
|
-
HEAP32: Int32Array;
|
|
181
|
-
HEAPU8: Uint8Array;
|
|
182
|
-
HEAPU16: Uint16Array;
|
|
183
|
-
HEAPU32: Uint32Array;
|
|
184
|
-
HEAPF32: Float32Array;
|
|
185
|
-
HEAPF64: Float64Array;
|
|
186
|
-
memory: WebAssembly.Memory;
|
|
187
|
-
[key: string]: any;
|
|
188
|
-
}
|
|
189
|
-
export interface IWasi {
|
|
190
|
-
instantiate(bytes: ArrayBuffer): Promise<IWasmExports>;
|
|
191
|
-
}
|
|
192
|
-
export interface IWasm {
|
|
193
|
-
writeArrayToMemory(array: TypedArray): Promise<number> | number;
|
|
194
|
-
readArrayFromMemory<T = TypedArray>(pointer: number, array: T): Promise<T> | T;
|
|
195
|
-
[key: string]: (...args: any[]) => any;
|
|
196
|
-
}
|
|
197
|
-
export interface IWasmAsync {
|
|
198
|
-
writeArrayToMemory(array: TypedArray): Promise<number>;
|
|
199
|
-
readArrayFromMemory<T = TypedArray>(pointer: number, array: T): T;
|
|
200
|
-
[key: string]: (...args: any[]) => Promise<any>;
|
|
201
|
-
}
|
|
202
176
|
export interface IAsyncMessage {
|
|
203
177
|
message: string;
|
|
204
178
|
context?: any;
|
|
@@ -328,26 +302,39 @@ export interface IPoint {
|
|
|
328
302
|
readonly y: number;
|
|
329
303
|
}
|
|
330
304
|
export interface IShape extends IPoint {
|
|
331
|
-
|
|
305
|
+
readonly center: IPoint;
|
|
306
|
+
support(dir: IPoint): IPoint;
|
|
307
|
+
distance(p: IPoint): number;
|
|
308
|
+
minDistance(shape: IShape): number;
|
|
332
309
|
}
|
|
333
|
-
export type CanvasItemShape = "rect" | "circle";
|
|
334
310
|
export type CanvasItemDirection = "horizontal" | "vertical" | "free" | "none";
|
|
311
|
+
export type CanvasPaintFunc = (ctx: CanvasRenderingContext2D) => MaybePromise<GlobalCompositeOperation | null>;
|
|
335
312
|
export interface InteractiveCanvas {
|
|
313
|
+
readonly params?: Record<string, any>;
|
|
314
|
+
readonly items?: ReadonlyArray<InteractiveCanvasItem>;
|
|
315
|
+
readonly canvas: HTMLCanvasElement;
|
|
316
|
+
readonly ratio: number;
|
|
317
|
+
readonly styles: CSSStyleDeclaration;
|
|
318
|
+
readonly ctx: CanvasRenderingContext2D;
|
|
336
319
|
readonly canvasWidth: number;
|
|
337
320
|
readonly canvasHeight: number;
|
|
338
|
-
readonly ratio: number;
|
|
339
321
|
readonly fullHeight: number;
|
|
340
|
-
readonly
|
|
322
|
+
readonly rotation: number;
|
|
323
|
+
readonly basePan: number;
|
|
324
|
+
rendered?: boolean;
|
|
325
|
+
tempPaint(cb: CanvasPaintFunc): Promise<void>;
|
|
341
326
|
}
|
|
342
327
|
export interface InteractiveCanvasItem {
|
|
343
328
|
readonly position: IPoint;
|
|
344
|
-
readonly shape: CanvasItemShape;
|
|
345
329
|
readonly shapes: ReadonlyArray<IShape>;
|
|
346
|
-
readonly
|
|
330
|
+
readonly canvas: InteractiveCanvas;
|
|
347
331
|
readonly index: number;
|
|
348
|
-
|
|
332
|
+
readonly active: boolean;
|
|
333
|
+
readonly isValid: boolean;
|
|
334
|
+
readonly validPosition: IPoint;
|
|
335
|
+
draw(ctx: CanvasRenderingContext2D): MaybePromise<void>;
|
|
349
336
|
}
|
|
350
|
-
export type InteractiveDrawFn = (ctx: InteractiveCanvas
|
|
337
|
+
export type InteractiveDrawFn = (ctx: InteractiveCanvas) => void | Promise<void>;
|
|
351
338
|
export interface InteractivePanEvent {
|
|
352
339
|
pointers?: any[];
|
|
353
340
|
deltaX?: number;
|
|
@@ -552,7 +539,6 @@ export interface IModuleConfig {
|
|
|
552
539
|
promiseService?: Type<IPromiseService>;
|
|
553
540
|
configService?: Type<IConfigService>;
|
|
554
541
|
dialogService?: Type<IDialogService>;
|
|
555
|
-
wasiImplementation?: Type<IWasi>;
|
|
556
542
|
iconType?: Type<IconProps>;
|
|
557
543
|
iconMap?: IconMap;
|
|
558
544
|
buttonType?: Type<ButtonProps>;
|
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, QueryList, Renderer2 } from "@angular/core";
|
|
2
2
|
import { Subscription } from "rxjs";
|
|
3
|
-
import { InteractiveCanvas, InteractiveCanvasPointer, InteractiveDrawFn, InteractivePanEvent } from "../../common-types";
|
|
3
|
+
import { CanvasPaintFunc, InteractiveCanvas, InteractiveCanvasItem, InteractiveCanvasPointer, InteractiveDrawFn, InteractivePanEvent } from "../../common-types";
|
|
4
4
|
import { InteractiveItemComponent } from "./interactive-item.component";
|
|
5
|
+
import { UniversalService } from "../../services/universal.service";
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class InteractiveCanvasComponent implements InteractiveCanvas, OnInit, OnDestroy, AfterViewInit, OnChanges {
|
|
7
|
-
|
|
8
|
+
readonly renderer: Renderer2;
|
|
9
|
+
readonly universal: UniversalService;
|
|
10
|
+
readonly element: ElementRef<HTMLElement>;
|
|
11
|
+
readonly rootElement: HTMLElement;
|
|
12
|
+
debug: boolean;
|
|
8
13
|
horizontal: boolean;
|
|
9
14
|
selectedIndex: number;
|
|
10
15
|
resizeMode: "fit" | "fill";
|
|
11
16
|
realWidth: number;
|
|
12
17
|
realHeight: number;
|
|
13
|
-
|
|
18
|
+
panOffset: number;
|
|
19
|
+
params: Record<string, any>;
|
|
20
|
+
beforeItems: InteractiveDrawFn;
|
|
21
|
+
afterItems: InteractiveDrawFn;
|
|
14
22
|
selectedIndexChange: EventEmitter<number>;
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
itemPan: EventEmitter<InteractivePanEvent>;
|
|
24
|
+
itemPanEnd: EventEmitter<InteractivePanEvent>;
|
|
25
|
+
get items(): ReadonlyArray<InteractiveCanvasItem>;
|
|
26
|
+
get canvas(): HTMLCanvasElement;
|
|
27
|
+
get lockedItem(): InteractiveItemComponent;
|
|
28
|
+
get selectedItem(): InteractiveItemComponent;
|
|
29
|
+
get hoveredItem(): InteractiveItemComponent;
|
|
17
30
|
ratio: number;
|
|
18
|
-
|
|
31
|
+
styles: CSSStyleDeclaration;
|
|
19
32
|
ctx: CanvasRenderingContext2D;
|
|
20
|
-
|
|
33
|
+
canvasWidth: number;
|
|
34
|
+
canvasHeight: number;
|
|
21
35
|
rotation: number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
36
|
+
basePan: number;
|
|
37
|
+
fullHeight: number;
|
|
38
|
+
protected tempCanvas: HTMLCanvasElement;
|
|
25
39
|
protected shouldDraw: boolean;
|
|
26
|
-
protected panOffset: number;
|
|
27
40
|
protected hoveredIndex: number;
|
|
28
|
-
protected
|
|
41
|
+
protected itemComponents: InteractiveItemComponent[];
|
|
29
42
|
protected subscription: Subscription;
|
|
30
43
|
protected containerElem: ElementRef<HTMLDivElement>;
|
|
31
44
|
protected canvasElem: ElementRef<HTMLCanvasElement>;
|
|
@@ -34,11 +47,13 @@ export declare class InteractiveCanvasComponent implements InteractiveCanvas, On
|
|
|
34
47
|
protected deltaX: number;
|
|
35
48
|
protected deltaY: number;
|
|
36
49
|
protected lockedIndex: number;
|
|
37
|
-
constructor(renderer: Renderer2);
|
|
50
|
+
constructor(renderer: Renderer2, universal: UniversalService, element: ElementRef<HTMLElement>, rootElement: HTMLElement);
|
|
51
|
+
ctrInit(): void;
|
|
38
52
|
ngOnInit(): void;
|
|
39
53
|
ngOnDestroy(): void;
|
|
40
54
|
ngOnChanges(): void;
|
|
41
55
|
ngAfterViewInit(): void;
|
|
56
|
+
tempPaint(cb: CanvasPaintFunc): Promise<void>;
|
|
42
57
|
resize(): void;
|
|
43
58
|
onTouchStart($event: TouchEvent): void;
|
|
44
59
|
onTouchEnd($event: TouchEvent): void;
|
|
@@ -49,14 +64,15 @@ export declare class InteractiveCanvasComponent implements InteractiveCanvas, On
|
|
|
49
64
|
onPanStart($event: InteractivePanEvent): void;
|
|
50
65
|
onPan($event: InteractivePanEvent): void;
|
|
51
66
|
onPanEnd(): void;
|
|
52
|
-
protected
|
|
67
|
+
protected fixRotation(): void;
|
|
53
68
|
protected fixItems(): void;
|
|
54
69
|
protected selectItem(pointer: InteractiveCanvasPointer): void;
|
|
55
70
|
protected getIndexUnderPointer(pointer: InteractiveCanvasPointer): number;
|
|
56
71
|
protected updateCursor(): void;
|
|
57
72
|
protected getCursor(): string;
|
|
58
73
|
protected redraw(): void;
|
|
74
|
+
protected drawItems(): Promise<void>;
|
|
59
75
|
protected draw(): Promise<void>;
|
|
60
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveCanvasComponent, never>;
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCanvasComponent, "interactive-canvas", never, { "horizontal": { "alias": "horizontal"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "resizeMode": { "alias": "resizeMode"; "required": false; }; "realWidth": { "alias": "realWidth"; "required": false; }; "realHeight": { "alias": "realHeight"; "required": false; }; "
|
|
77
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCanvasComponent, "interactive-canvas", never, { "debug": { "alias": "debug"; "required": false; }; "horizontal": { "alias": "horizontal"; "required": false; }; "selectedIndex": { "alias": "selectedIndex"; "required": false; }; "resizeMode": { "alias": "resizeMode"; "required": false; }; "realWidth": { "alias": "realWidth"; "required": false; }; "realHeight": { "alias": "realHeight"; "required": false; }; "panOffset": { "alias": "panOffset"; "required": false; }; "params": { "alias": "params"; "required": false; }; "beforeItems": { "alias": "beforeItems"; "required": false; }; "afterItems": { "alias": "afterItems"; "required": false; }; }, { "selectedIndexChange": "selectedIndexChange"; "itemPan": "itemPan"; "itemPanEnd": "itemPanEnd"; }, ["itemList"], never, false, never>;
|
|
62
78
|
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IShape } from "../../common-types";
|
|
2
2
|
import { InteractiveItemComponent } from "./interactive-item.component";
|
|
3
|
-
import { InteractiveCanvasComponent } from "./interactive-canvas.component";
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class InteractiveCircleComponent extends InteractiveItemComponent {
|
|
6
|
-
protected iCanvas: InteractiveCanvasComponent;
|
|
7
5
|
radius: number;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
calcShape(x: number, y: number): IShape;
|
|
12
|
-
draw(ctx: CanvasRenderingContext2D, scale?: number): void;
|
|
6
|
+
constructor();
|
|
7
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
8
|
+
protected calcShape(x: number, y: number): IShape;
|
|
13
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveCircleComponent, never>;
|
|
14
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveCircleComponent, "interactive-circle", never, { "radius": { "alias": "radius"; "required": false; }; }, {}, never, never, false, never>;
|
|
15
11
|
}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CanvasItemDirection, CanvasItemShape, InteractiveCanvas, InteractiveCanvasItem, InteractivePanEvent, IPoint, IShape } from "../../common-types";
|
|
1
|
+
import { OnChanges } from "@angular/core";
|
|
2
|
+
import { CanvasItemDirection, InteractiveCanvas, InteractiveCanvasItem, IPoint, IShape } from "../../common-types";
|
|
4
3
|
import { Point } from "../../utils/geometry";
|
|
4
|
+
import { MaybePromise } from "../../helper-types";
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class InteractiveItemComponent implements
|
|
6
|
+
export declare class InteractiveItemComponent implements OnChanges, InteractiveCanvasItem {
|
|
7
7
|
protected cycles: number[];
|
|
8
8
|
protected pos: Point;
|
|
9
9
|
protected mShapes: IShape[];
|
|
10
|
-
|
|
10
|
+
get shapes(): ReadonlyArray<IShape>;
|
|
11
|
+
get x(): number;
|
|
11
12
|
set x(value: number);
|
|
13
|
+
get y(): number;
|
|
12
14
|
set y(value: number);
|
|
15
|
+
get position(): IPoint;
|
|
13
16
|
set position(value: IPoint);
|
|
14
|
-
|
|
17
|
+
get isValid(): boolean;
|
|
18
|
+
get validPosition(): IPoint;
|
|
19
|
+
set validPosition(value: IPoint);
|
|
15
20
|
direction: CanvasItemDirection;
|
|
16
21
|
disabled: boolean;
|
|
17
|
-
|
|
18
|
-
onPan: EventEmitter<InteractivePanEvent>;
|
|
19
|
-
onPanStart: EventEmitter<InteractivePanEvent>;
|
|
20
|
-
onPanEnd: EventEmitter<InteractivePanEvent>;
|
|
21
|
-
active: boolean;
|
|
22
|
+
canvas: InteractiveCanvas;
|
|
22
23
|
index: number;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
get x(): number;
|
|
27
|
-
get y(): number;
|
|
28
|
-
get shape(): CanvasItemShape;
|
|
24
|
+
active: boolean;
|
|
25
|
+
protected valid: boolean;
|
|
26
|
+
protected validPos: Point;
|
|
29
27
|
constructor();
|
|
30
|
-
|
|
28
|
+
draw(ctx: CanvasRenderingContext2D): MaybePromise<void>;
|
|
31
29
|
ngOnChanges(): void;
|
|
32
30
|
calcShapes(cycles?: number[]): void;
|
|
33
31
|
hit(point: Point): boolean;
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
move(dx: number, dy: number): void;
|
|
33
|
+
moveEnd(): void;
|
|
34
|
+
protected isValidByParams(): boolean;
|
|
35
|
+
protected isValidByDistance(other: InteractiveCanvasItem): boolean;
|
|
36
|
+
protected getMinDistance(other: InteractiveCanvasItem): number;
|
|
37
|
+
protected calcShape(x: number, y: number): IShape;
|
|
36
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveItemComponent, never>;
|
|
37
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveItemComponent, "__interactive-item__", never, { "x": { "alias": "x"; "required": false; }; "y": { "alias": "y"; "required": false; }; "position": { "alias": "position"; "required": false; }; "
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveItemComponent, "__interactive-item__", never, { "x": { "alias": "x"; "required": false; }; "y": { "alias": "y"; "required": false; }; "position": { "alias": "position"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, false, never>;
|
|
38
40
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IShape } from "../../common-types";
|
|
2
2
|
import { InteractiveItemComponent } from "./interactive-item.component";
|
|
3
|
-
import { InteractiveCanvasComponent } from "./interactive-canvas.component";
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class InteractiveRectComponent extends InteractiveItemComponent {
|
|
6
|
-
protected iCanvas: InteractiveCanvasComponent;
|
|
7
5
|
width: number;
|
|
8
6
|
height: number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
calcShape(x: number, y: number): IShape;
|
|
13
|
-
draw(ctx: CanvasRenderingContext2D, scale?: number): void;
|
|
7
|
+
rotation: number;
|
|
8
|
+
constructor();
|
|
9
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
10
|
+
protected calcShape(x: number, y: number): IShape;
|
|
14
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractiveRectComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveRectComponent, "interactive-rect", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, never, false, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InteractiveRectComponent, "interactive-rect", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "rotation": { "alias": "rotation"; "required": false; }; }, {}, never, never, false, never>;
|
|
16
13
|
}
|
|
@@ -25,7 +25,6 @@ import { CacheService } from "./services/cache.service";
|
|
|
25
25
|
import { ComponentLoaderService } from "./services/component-loader.service";
|
|
26
26
|
import { TranslatedUrlSerializer } from "./services/translated-url.serializer";
|
|
27
27
|
import { UniversalService } from "./services/universal.service";
|
|
28
|
-
import { WasmService } from "./services/wasm.service";
|
|
29
28
|
import { DragDropEventPlugin } from "./plugins/drag-drop-event.plugin";
|
|
30
29
|
import { ResizeEventPlugin } from "./plugins/resize-event.plugin";
|
|
31
30
|
import { ScrollEventPlugin } from "./plugins/scroll-event.plugin";
|
|
@@ -60,15 +59,13 @@ import { CloseBtnComponent } from "./components/close-btn/close-btn.component";
|
|
|
60
59
|
import { DropListComponent } from "./components/drop-list/drop-list.component";
|
|
61
60
|
import { DynamicTableComponent } from "./components/dynamic-table/dynamic-table.component";
|
|
62
61
|
import { InteractiveCanvasComponent } from "./components/interactive-canvas/interactive-canvas.component";
|
|
63
|
-
import { InteractiveCircleComponent } from "./components/interactive-canvas/interactive-circle.component";
|
|
64
|
-
import { InteractiveRectComponent } from "./components/interactive-canvas/interactive-rect.component";
|
|
65
62
|
import { PaginationMenuComponent } from "./components/pagination-menu/pagination-menu.component";
|
|
66
63
|
import { UnorderedListComponent } from "./components/unordered-list/unordered-list.component";
|
|
67
64
|
import { UploadComponent } from "./components/upload/upload.component";
|
|
68
65
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
69
66
|
export declare const directives: (typeof AsyncMethodBase | typeof AsyncMethodTargetDirective | typeof BackgroundDirective | typeof ComponentLoaderDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof DropdownDirective | typeof DropdownContentDirective | typeof TabsItemDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
|
|
70
|
-
export declare const components: (typeof ChipsComponent | typeof CloseBtnComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent | typeof InteractiveCanvasComponent | typeof
|
|
71
|
-
export declare const providers: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof BaseHttpClient | typeof BaseHttpService | typeof AuthGuard | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof PromiseService | typeof SocketService | typeof StateService | typeof StorageService | typeof BaseToasterService | typeof CacheService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof
|
|
67
|
+
export declare const components: (typeof ChipsComponent | typeof CloseBtnComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent | typeof InteractiveCanvasComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
|
|
68
|
+
export declare const providers: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof BaseHttpClient | typeof BaseHttpService | typeof AuthGuard | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof PromiseService | typeof SocketService | typeof StateService | typeof StorageService | typeof BaseToasterService | typeof CacheService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof DeviceDetectorService | {
|
|
72
69
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
73
70
|
useClass: typeof DragDropEventPlugin;
|
|
74
71
|
multi: boolean;
|
package/ngx-utils/tokens.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InjectionToken, Type } from "@angular/core";
|
|
2
2
|
import { Request } from "express";
|
|
3
|
-
import { ButtonProps, DynamicEntryComponents, DynamicModuleInfo, ErrorHandlerCallback, IApiService, IAuthService, IConfigService, IConfiguration, IconMap, IconProps, IDialogService, IIconService, ILanguageService, IPromiseService, IToasterService,
|
|
3
|
+
import { ButtonProps, DynamicEntryComponents, DynamicModuleInfo, ErrorHandlerCallback, IApiService, IAuthService, IConfigService, IConfiguration, IconMap, IconProps, IDialogService, IIconService, ILanguageService, IPromiseService, IToasterService, OpenApiSchemas, ResizeEventStrategy } from "./common-types";
|
|
4
4
|
export declare const ICON_TYPE: InjectionToken<Type<IconProps>>;
|
|
5
5
|
export declare const ICON_MAP: InjectionToken<IconMap>;
|
|
6
6
|
export declare const BUTTON_TYPE: InjectionToken<Type<ButtonProps>>;
|
|
@@ -12,7 +12,6 @@ export declare const TOASTER_SERVICE: InjectionToken<IToasterService>;
|
|
|
12
12
|
export declare const DIALOG_SERVICE: InjectionToken<IDialogService<any>>;
|
|
13
13
|
export declare const SOCKET_IO_PATH: InjectionToken<string>;
|
|
14
14
|
export declare const PROMISE_SERVICE: InjectionToken<IPromiseService>;
|
|
15
|
-
export declare const WASI_IMPLEMENTATION: InjectionToken<Type<IWasi>>;
|
|
16
15
|
export declare const EXPRESS_REQUEST: InjectionToken<Request>;
|
|
17
16
|
export declare const API_SERVICE: InjectionToken<IApiService>;
|
|
18
17
|
export declare const DYNAMIC_ENTRY_COMPONENTS: InjectionToken<DynamicEntryComponents[]>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { CanvasColor } from "../common-types";
|
|
2
|
+
export declare function drawRect(ctx: CanvasRenderingContext2D, w: number, h: number): void;
|
|
3
|
+
export declare function drawOval(ctx: CanvasRenderingContext2D, w: number, h: number): void;
|
|
2
4
|
export declare class CanvasUtils {
|
|
3
5
|
static manipulatePixels(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, colorTransformer: (color: CanvasColor, greyscale?: number) => CanvasColor): void;
|
|
4
6
|
static thresholding(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, threshold: number, colorTransformer: (color: CanvasColor, limit: boolean, greyscale?: number) => CanvasColor): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IPoint, IShape } from "../../common-types";
|
|
2
|
+
interface SimplexLine {
|
|
3
|
+
p: IPoint;
|
|
4
|
+
a: IPoint;
|
|
5
|
+
b: IPoint;
|
|
6
|
+
}
|
|
7
|
+
type Simplex = SimplexLine[];
|
|
8
|
+
interface ClosestPointResult {
|
|
9
|
+
simplex: Simplex;
|
|
10
|
+
closest: IPoint;
|
|
11
|
+
bary: number[];
|
|
12
|
+
}
|
|
13
|
+
export declare function closestPointToOrigin(simplex: Simplex): ClosestPointResult;
|
|
14
|
+
/**
|
|
15
|
+
* ====== GJK distance (2D) ======
|
|
16
|
+
* We keep, for each simplex vertex, the Minkowski point p = a - b and the witnesses a,b.
|
|
17
|
+
* @param A
|
|
18
|
+
* @param B
|
|
19
|
+
*/
|
|
20
|
+
export declare function gjkDistance(A: IShape, B: IShape): {
|
|
21
|
+
distance: number;
|
|
22
|
+
pa: IPoint;
|
|
23
|
+
pb: IPoint;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPoint } from "../../common-types";
|
|
2
|
+
export declare function dotProduct(a: IPoint, b: IPoint): number;
|
|
3
|
+
export declare function isPoint(v: IPoint | number): v is IPoint;
|
|
4
|
+
export declare function perpendicular(p: IPoint): IPoint;
|
|
5
|
+
export declare function ptAdd(a: IPoint, b: IPoint): IPoint;
|
|
6
|
+
export declare function ptDistance(a: IPoint, b: IPoint): number;
|
|
7
|
+
export declare function ptLength(p: IPoint): number;
|
|
8
|
+
export declare function ptMultiply(a: IPoint, b: IPoint | number): IPoint;
|
|
9
|
+
export declare function ptSubtract(a: IPoint, b: IPoint): IPoint;
|
|
10
|
+
export declare function rotateDeg(p: IPoint, ang: number): IPoint;
|
|
11
|
+
export declare function rotateRad(p: IPoint, ang: number): IPoint;
|
|
12
|
+
export declare function toDegrees(rad: number): number;
|
|
13
|
+
export declare function toRadians(deg: number): number;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IPoint, IShape } from "../../common-types";
|
|
2
|
+
declare abstract class Shape implements IShape {
|
|
3
|
+
get center(): IPoint;
|
|
4
|
+
get x(): number;
|
|
5
|
+
get y(): number;
|
|
6
|
+
protected pt: IPoint;
|
|
7
|
+
protected constructor(x: number, y: number);
|
|
8
|
+
abstract support(dir: IPoint): IPoint;
|
|
9
|
+
distance(p: IPoint): number;
|
|
10
|
+
minDistance(shape: IShape): number;
|
|
11
|
+
}
|
|
12
|
+
export declare class Point extends Shape {
|
|
13
|
+
static Zero: Point;
|
|
14
|
+
get length(): number;
|
|
15
|
+
get perpendicular(): Point;
|
|
16
|
+
constructor(xOrP: number | IPoint, y?: number);
|
|
17
|
+
support(): IPoint;
|
|
18
|
+
add(p: Point): Point;
|
|
19
|
+
sub(p: Point): Point;
|
|
20
|
+
mul(p: Point | number): Point;
|
|
21
|
+
dot(p: Point): Point;
|
|
22
|
+
distance(p: IPoint): number;
|
|
23
|
+
lerp(p: Point, ratio: number): Point;
|
|
24
|
+
perpendicularTo(p: Point, length: number): Point;
|
|
25
|
+
circleWith(a: Point, b: Point): Circle;
|
|
26
|
+
tangents(c: Circle): Point[];
|
|
27
|
+
angle(p: Point): number;
|
|
28
|
+
rotateAround(p: Point, angle: number): Point;
|
|
29
|
+
}
|
|
30
|
+
export declare class Rect extends Shape {
|
|
31
|
+
readonly width: number;
|
|
32
|
+
readonly height: number;
|
|
33
|
+
readonly rotation: number;
|
|
34
|
+
constructor(x: number, y: number, width: number, height: number, rotation?: number);
|
|
35
|
+
support(dir: IPoint): IPoint;
|
|
36
|
+
}
|
|
37
|
+
export declare class Oval extends Shape {
|
|
38
|
+
readonly width: number;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
readonly rotation: number;
|
|
41
|
+
constructor(x: number, y: number, width: number, height: number, rotation?: number);
|
|
42
|
+
support(dir: IPoint): IPoint;
|
|
43
|
+
}
|
|
44
|
+
export declare class Circle extends Oval {
|
|
45
|
+
readonly radius: number;
|
|
46
|
+
constructor(x: number, y: number, radius: number, rotation?: number);
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type, ValueProvider, ɵComponentDef as ComponentDef } from "@angular/core";
|
|
2
|
-
import { CssSelector, CssSelectorList } from "../common-types";
|
|
2
|
+
import { CssSelector, CssSelectorList, TypedFactoryProvider } from "../common-types";
|
|
3
3
|
export declare function isBrowser(): boolean;
|
|
4
4
|
/**
|
|
5
5
|
* Returns an elements root
|
|
@@ -20,3 +20,4 @@ export declare function getComponentDef<T>(type: Type<T>): ComponentDef<T>;
|
|
|
20
20
|
export declare function parseSelector(selector: string | CssSelector): CssSelector;
|
|
21
21
|
export declare function selectorMatchesList(list: CssSelectorList, selector: CssSelector): boolean;
|
|
22
22
|
export declare function provideEntryComponents(components: Type<any>[], moduleId?: string): ValueProvider;
|
|
23
|
+
export declare function provideWithOptions<O extends Object, T = any>(type: Type<T>, options: O): TypedFactoryProvider<T>;
|
|
@@ -5,5 +5,5 @@ export declare class ReflectUtils {
|
|
|
5
5
|
static defineMetadata(key: string, data: any, target: any, name?: string): void;
|
|
6
6
|
static getMetadata(key: string, target: any, name?: string): any;
|
|
7
7
|
static getOwnMetadata(key: string, target: any, name?: string): any;
|
|
8
|
-
static resolve<T>(obj:
|
|
8
|
+
static resolve<T>(obj: T, injector: Injector): T extends ResolveFactory<infer R> ? R : T;
|
|
9
9
|
}
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import "zone.js";
|
|
2
2
|
export { MaybePromise, MaybeArray, KeysOfType, ObjOfType, StringKeys, CapitalizeFirst, CamelJoin, PrefixedPick } from "./ngx-utils/helper-types";
|
|
3
|
-
export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService,
|
|
4
|
-
export { ICON_TYPE, ICON_MAP, BUTTON_TYPE, ERROR_HANDLER, STATIC_SCHEMAS, RESIZE_STRATEGY, RESIZE_DELAY, ROOT_ELEMENT, SCRIPT_PARAMS, BASE_CONFIG, CONFIG_SERVICE, APP_BASE_URL, API_SERVICE, EXPRESS_REQUEST,
|
|
3
|
+
export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, IShape, CanvasItemDirection, CanvasPaintFunc, InteractiveCanvas, InteractiveCanvasItem, InteractiveDrawFn, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
4
|
+
export { ICON_TYPE, ICON_MAP, BUTTON_TYPE, ERROR_HANDLER, STATIC_SCHEMAS, RESIZE_STRATEGY, RESIZE_DELAY, ROOT_ELEMENT, SCRIPT_PARAMS, BASE_CONFIG, CONFIG_SERVICE, APP_BASE_URL, API_SERVICE, EXPRESS_REQUEST, PROMISE_SERVICE, DIALOG_SERVICE, TOASTER_SERVICE, AUTH_SERVICE, LANGUAGE_SERVICE, ICON_SERVICE, OPTIONS_TOKEN } from "./ngx-utils/tokens";
|
|
5
5
|
export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
|
|
6
6
|
export { ArrayUtils } from "./ngx-utils/utils/array.utils";
|
|
7
7
|
export { AuthGuard } from "./ngx-utils/utils/auth.guard";
|
|
8
8
|
export { createTypedProvider, cachedFactory } from "./ngx-utils/utils/cached-factory";
|
|
9
|
-
export { CanvasUtils } from "./ngx-utils/utils/canvas
|
|
9
|
+
export { drawRect, drawOval, CanvasUtils } from "./ngx-utils/utils/canvas";
|
|
10
10
|
export { DateUtils } from "./ngx-utils/utils/date.utils";
|
|
11
11
|
export { FileUtils } from "./ngx-utils/utils/file.utils";
|
|
12
12
|
export { ForbiddenZone } from "./ngx-utils/utils/forbidden-zone";
|
|
13
13
|
export { GenericValue } from "./ngx-utils/utils/generic-value";
|
|
14
14
|
export { FileSystemEntryOpenResult, FileSystemEntryOpenCb, FileSystemEntry } from "./ngx-utils/utils/file-system";
|
|
15
|
-
export {
|
|
15
|
+
export { dotProduct, isPoint, perpendicular, ptAdd, ptDistance, ptLength, ptMultiply, ptSubtract, rotateDeg, rotateRad, toDegrees, toRadians, Point, Rect, Oval, Circle } from "./ngx-utils/utils/geometry";
|
|
16
16
|
export { Initializer } from "./ngx-utils/utils/initializer";
|
|
17
17
|
export { JSONfn } from "./ngx-utils/utils/jsonfn";
|
|
18
18
|
export { ReflectUtils } from "./ngx-utils/utils/reflect.utils";
|
|
19
19
|
export { LoaderUtils } from "./ngx-utils/utils/loader.utils";
|
|
20
20
|
export { MathUtils } from "./ngx-utils/utils/math.utils";
|
|
21
|
-
export { isBrowser, getRoot, hashCode, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents } from "./ngx-utils/utils/misc";
|
|
21
|
+
export { isBrowser, getRoot, hashCode, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents, provideWithOptions } from "./ngx-utils/utils/misc";
|
|
22
22
|
export { ObjectUtils } from "./ngx-utils/utils/object.utils";
|
|
23
23
|
export { ObservableUtils, ISubscriberInfo } from "./ngx-utils/utils/observable.utils";
|
|
24
24
|
export { CancelablePromise, cancelablePromise, impatientPromise } from "./ngx-utils/utils/promise.utils";
|
|
@@ -28,10 +28,7 @@ export { computedPrevious, cssStyles, cssVariables } from "./ngx-utils/utils/sig
|
|
|
28
28
|
export { SocketFactory, SocketData, SocketDataValue, SocketDataObj, SocketClient } from "./ngx-utils/utils/socket-client";
|
|
29
29
|
export { TimerUtils } from "./ngx-utils/utils/timer.utils";
|
|
30
30
|
export { UniqueUtils } from "./ngx-utils/utils/unique.utils";
|
|
31
|
-
export { Vector } from "./ngx-utils/utils/vector";
|
|
32
|
-
export { provideWithOptions } from "./ngx-utils/utils/with-options-provider";
|
|
33
31
|
export { UniversalService } from "./ngx-utils/services/universal.service";
|
|
34
|
-
export { WasmService } from "./ngx-utils/services/wasm.service";
|
|
35
32
|
export { AclService } from "./ngx-utils/services/acl.service";
|
|
36
33
|
export { ApiService } from "./ngx-utils/services/api.service";
|
|
37
34
|
export { StaticAuthService } from "./ngx-utils/services/auth.service";
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { IPoint, IShape } from "../common-types";
|
|
2
|
-
export declare class Rect implements IShape {
|
|
3
|
-
readonly x: number;
|
|
4
|
-
readonly y: number;
|
|
5
|
-
readonly width: number;
|
|
6
|
-
readonly height: number;
|
|
7
|
-
readonly rotation: number;
|
|
8
|
-
get center(): Point;
|
|
9
|
-
get left(): number;
|
|
10
|
-
get right(): number;
|
|
11
|
-
get bottom(): number;
|
|
12
|
-
get top(): number;
|
|
13
|
-
constructor(x: number, y: number, width: number, height: number, rotation?: number);
|
|
14
|
-
distance(p: IPoint): number;
|
|
15
|
-
}
|
|
16
|
-
export declare class Circle implements IShape {
|
|
17
|
-
readonly x: number;
|
|
18
|
-
readonly y: number;
|
|
19
|
-
readonly radius: number;
|
|
20
|
-
get center(): Point;
|
|
21
|
-
get left(): Point;
|
|
22
|
-
get right(): Point;
|
|
23
|
-
get top(): Point;
|
|
24
|
-
get bottom(): Point;
|
|
25
|
-
get rect(): Rect;
|
|
26
|
-
constructor(x: number, y: number, radius: number);
|
|
27
|
-
distance(p: IPoint): number;
|
|
28
|
-
}
|
|
29
|
-
export declare class Point implements IShape {
|
|
30
|
-
readonly x: number;
|
|
31
|
-
readonly y: number;
|
|
32
|
-
static Zero: Point;
|
|
33
|
-
get length(): number;
|
|
34
|
-
get perpendicular(): Point;
|
|
35
|
-
constructor(x: number, y: number);
|
|
36
|
-
add(p: Point): Point;
|
|
37
|
-
subtract(p: Point): Point;
|
|
38
|
-
multiply(p: Point | number): Point;
|
|
39
|
-
distance(b: IPoint): number;
|
|
40
|
-
lerp(p: Point, ratio: number): Point;
|
|
41
|
-
perpendicularTo(p: Point, length: number): Point;
|
|
42
|
-
circleWith(a: Point, b: Point): Circle;
|
|
43
|
-
tangents(c: Circle): Point[];
|
|
44
|
-
angle(p: Point): number;
|
|
45
|
-
rotateAround(p: Point, angle: number): Point;
|
|
46
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare class Vector {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
z: number;
|
|
5
|
-
get negative(): Vector;
|
|
6
|
-
get length(): number;
|
|
7
|
-
get unit(): Vector;
|
|
8
|
-
get min(): number;
|
|
9
|
-
get max(): number;
|
|
10
|
-
get angles(): any;
|
|
11
|
-
constructor(x: number, y: number, z: number);
|
|
12
|
-
add(v: Vector | number): Vector;
|
|
13
|
-
subtract(v: Vector | number): Vector;
|
|
14
|
-
multiply(v: Vector | number): Vector;
|
|
15
|
-
divide(v: Vector | number): Vector;
|
|
16
|
-
equals(v: Vector): boolean;
|
|
17
|
-
dot(v: Vector): number;
|
|
18
|
-
cross(v: Vector): Vector;
|
|
19
|
-
angleTo(v: Vector): number;
|
|
20
|
-
toArray(n?: number): number[];
|
|
21
|
-
clone(): Vector;
|
|
22
|
-
init(x: number, y: number, z: number): Vector;
|
|
23
|
-
}
|