@willphan1712000/frontend 1.4.4 → 1.5.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/dist/index.d.mts +285 -98
- package/dist/index.d.ts +285 -98
- package/dist/index.js +1450 -613
- package/dist/index.mjs +1559 -706
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ type Options$2 = {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
7
7
|
}[];
|
|
8
|
-
interface Props$
|
|
8
|
+
interface Props$c {
|
|
9
9
|
options: Options$2;
|
|
10
10
|
value: string;
|
|
11
11
|
onChange: (value: string) => void;
|
|
@@ -17,9 +17,9 @@ interface Props$b {
|
|
|
17
17
|
* @param onChange - a function to set a value
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
|
-
declare const DropdownSelect: ({ options, value, onChange }: Props$
|
|
20
|
+
declare const DropdownSelect: ({ options, value, onChange }: Props$c) => react_jsx_runtime.JSX.Element;
|
|
21
21
|
|
|
22
|
-
interface Props$
|
|
22
|
+
interface Props$b {
|
|
23
23
|
value: string;
|
|
24
24
|
onChange: (value: string) => void;
|
|
25
25
|
min?: string;
|
|
@@ -37,13 +37,13 @@ interface Props$a {
|
|
|
37
37
|
* @param onChange - to set a value
|
|
38
38
|
* @returns
|
|
39
39
|
*/
|
|
40
|
-
declare const RangeSlider: ({ min, max, color, width, value, onChange, }: Props$
|
|
40
|
+
declare const RangeSlider: ({ min, max, color, width, value, onChange, }: Props$b) => react_jsx_runtime.JSX.Element;
|
|
41
41
|
|
|
42
42
|
type Options$1 = {
|
|
43
43
|
label: ReactNode;
|
|
44
44
|
value: string;
|
|
45
45
|
}[];
|
|
46
|
-
interface Props$
|
|
46
|
+
interface Props$a {
|
|
47
47
|
value: string;
|
|
48
48
|
onChange: (value: string) => void;
|
|
49
49
|
width?: string;
|
|
@@ -57,9 +57,9 @@ interface Props$9 {
|
|
|
57
57
|
* @options - list of options, format [{ label: React Node Syntax, value: string }]
|
|
58
58
|
* @returns
|
|
59
59
|
*/
|
|
60
|
-
declare const OptionSlider: ({ value, onChange, width, options, color, }: Props$
|
|
60
|
+
declare const OptionSlider: ({ value, onChange, width, options, color, }: Props$a) => react_jsx_runtime.JSX.Element;
|
|
61
61
|
|
|
62
|
-
interface Props$
|
|
62
|
+
interface Props$9 {
|
|
63
63
|
value: string;
|
|
64
64
|
onChange: (value: string) => void;
|
|
65
65
|
width?: string;
|
|
@@ -71,13 +71,13 @@ interface Props$8 {
|
|
|
71
71
|
* @param width
|
|
72
72
|
* @returns
|
|
73
73
|
*/
|
|
74
|
-
declare const ColorPickerSlider: ({ value, onChange, width }: Props$
|
|
74
|
+
declare const ColorPickerSlider: ({ value, onChange, width }: Props$9) => react_jsx_runtime.JSX.Element;
|
|
75
75
|
|
|
76
76
|
type Options = {
|
|
77
77
|
label: string;
|
|
78
78
|
value: string;
|
|
79
79
|
}[];
|
|
80
|
-
interface Props$
|
|
80
|
+
interface Props$8 {
|
|
81
81
|
options: Options;
|
|
82
82
|
value: string[];
|
|
83
83
|
onChange: React.Dispatch<React.SetStateAction<string[]>>;
|
|
@@ -91,9 +91,9 @@ interface Props$7 {
|
|
|
91
91
|
* @param width - specify the width of the component
|
|
92
92
|
* @returns
|
|
93
93
|
*/
|
|
94
|
-
declare const MultiSelect: ({ options, value, onChange, width }: Props$
|
|
94
|
+
declare const MultiSelect: ({ options, value, onChange, width }: Props$8) => react_jsx_runtime.JSX.Element;
|
|
95
95
|
|
|
96
|
-
interface Props$
|
|
96
|
+
interface Props$7 {
|
|
97
97
|
buttonType?: 'gradient' | 'solid' | 'normal';
|
|
98
98
|
}
|
|
99
99
|
interface Data {
|
|
@@ -117,9 +117,9 @@ interface Children {
|
|
|
117
117
|
* @param second second color when using gradient button, default is #aa6392
|
|
118
118
|
* @returns button UI component
|
|
119
119
|
*/
|
|
120
|
-
declare const Button: ({ buttonType, content, main, first, second, text, isLoading, children, ...props }: Props$
|
|
120
|
+
declare const Button: ({ buttonType, content, main, first, second, text, isLoading, children, ...props }: Props$7 & Data & Children & React.ComponentProps<"button">) => react_jsx_runtime.JSX.Element;
|
|
121
121
|
|
|
122
|
-
interface Props$
|
|
122
|
+
interface Props$6 {
|
|
123
123
|
src?: string;
|
|
124
124
|
setValue: (src?: string) => void;
|
|
125
125
|
}
|
|
@@ -143,9 +143,9 @@ interface Props$5 {
|
|
|
143
143
|
* <Avatar src={src} setValue={setValue} />
|
|
144
144
|
* )
|
|
145
145
|
*/
|
|
146
|
-
declare const Avatar: ({ src, setValue }: Props$
|
|
146
|
+
declare const Avatar: ({ src, setValue }: Props$6) => react_jsx_runtime.JSX.Element;
|
|
147
147
|
|
|
148
|
-
interface Props$
|
|
148
|
+
interface Props$5 {
|
|
149
149
|
value?: string;
|
|
150
150
|
setValue?: (value?: string) => void;
|
|
151
151
|
label?: string;
|
|
@@ -172,9 +172,9 @@ interface Props$4 {
|
|
|
172
172
|
* <InputGoogle value={value} setValue={setValue} label="Input Google Component Label" options={{ focusColor: "yellow" }}/>
|
|
173
173
|
* )
|
|
174
174
|
*/
|
|
175
|
-
declare const InputGoogle: ({ value, setValue, label, options, ...props }: Props$
|
|
175
|
+
declare const InputGoogle: ({ value, setValue, label, options, ...props }: Props$5 & React.ComponentProps<"input">) => react_jsx_runtime.JSX.Element;
|
|
176
176
|
|
|
177
|
-
interface Props$
|
|
177
|
+
interface Props$4 {
|
|
178
178
|
value?: string;
|
|
179
179
|
setValue?: (value?: string) => void;
|
|
180
180
|
label?: string;
|
|
@@ -198,10 +198,10 @@ interface Props$3 {
|
|
|
198
198
|
* <TextArea value={value} setValue={setValue} label="Text Component Label" options={{ focusColor: "yellow" }}/>
|
|
199
199
|
* )
|
|
200
200
|
*/
|
|
201
|
-
declare const TextArea: ({ value, setValue, label, options, ...props }: Props$
|
|
201
|
+
declare const TextArea: ({ value, setValue, label, options, ...props }: Props$4 & React.ComponentProps<"textarea">) => react_jsx_runtime.JSX.Element;
|
|
202
202
|
|
|
203
203
|
type FileType = 'image/*' | 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'image/bmp' | 'image/tiff' | 'video/*' | 'video/mp4' | 'video/mpeg' | 'video/quicktime' | 'video/x-msvideo' | 'video/x-ms-wmv' | 'video/webm' | 'video/ogg' | 'audito/*' | 'audio/mpeg' | 'audio/wav' | 'audio/ogg' | 'audio/aac' | 'audio/flac' | 'audio/x-wav' | 'application/*' | 'application/pdf' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'text/plain' | 'text/csv' | 'application/json' | 'application/zip' | 'application/octet-stream' | 'application/x-tar' | 'application/x-rar-compressed';
|
|
204
|
-
interface Props$
|
|
204
|
+
interface Props$3 {
|
|
205
205
|
file?: File;
|
|
206
206
|
onChoose: (file: File) => void;
|
|
207
207
|
onCancel?: () => void;
|
|
@@ -214,9 +214,9 @@ interface Props$2 {
|
|
|
214
214
|
* @param onCancel if a popup is closed without any chosen data
|
|
215
215
|
* @param acceptType accepted file type
|
|
216
216
|
*/
|
|
217
|
-
declare const InputFile: ({ file, onChoose, onCancel, acceptType, ...props }: Props$
|
|
217
|
+
declare const InputFile: ({ file, onChoose, onCancel, acceptType, ...props }: Props$3 & React$1.ComponentProps<"input">) => react_jsx_runtime.JSX.Element;
|
|
218
218
|
|
|
219
|
-
interface Props$
|
|
219
|
+
interface Props$2 {
|
|
220
220
|
setSrc?: (src?: string) => void;
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
@@ -225,7 +225,7 @@ interface Props$1 {
|
|
|
225
225
|
* @param setSrc
|
|
226
226
|
* @returns
|
|
227
227
|
*/
|
|
228
|
-
declare const UploadImage: ({ setSrc, ...props }: Props$
|
|
228
|
+
declare const UploadImage: ({ setSrc, ...props }: Props$2 & React.ComponentProps<"input">) => react_jsx_runtime.JSX.Element;
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* A wrap around HTML Image Element
|
|
@@ -234,7 +234,7 @@ declare const UploadImage: ({ setSrc, ...props }: Props$1 & React.ComponentProps
|
|
|
234
234
|
*/
|
|
235
235
|
declare const Image$1: ({ ...props }: React.ComponentProps<"img">) => react_jsx_runtime.JSX.Element;
|
|
236
236
|
|
|
237
|
-
interface Props {
|
|
237
|
+
interface Props$1 {
|
|
238
238
|
src?: string;
|
|
239
239
|
setSrc?: (src?: string) => void;
|
|
240
240
|
isOpen?: boolean;
|
|
@@ -260,40 +260,42 @@ interface Props {
|
|
|
260
260
|
* - When hitting cancel button, it changes isOpen state
|
|
261
261
|
* - When hitting reset button, it runs reset method on transform object state
|
|
262
262
|
*/
|
|
263
|
-
declare const ImageEditor: ({ src, setSrc, isOpen, setOpen, isNew, }: Props) => react_jsx_runtime.JSX.Element | undefined;
|
|
263
|
+
declare const ImageEditor: ({ src, setSrc, isOpen, setOpen, isNew, }: Props$1) => react_jsx_runtime.JSX.Element | undefined;
|
|
264
264
|
|
|
265
|
-
interface
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
*/
|
|
278
|
-
drawImage(e: any, ctx: CanvasRenderingContext2D, x: number, y: number, scale: number, angle: number, canvas: HTMLCanvasElement, containerWidth: number, containerHeight: number): {
|
|
279
|
-
context: CanvasRenderingContext2D;
|
|
280
|
-
src: string;
|
|
281
|
-
};
|
|
282
|
-
/**
|
|
283
|
-
* Draw a color on canvas
|
|
284
|
-
*/
|
|
285
|
-
drawColor(type: string, color: string, ctx: CanvasRenderingContext2D, width: number, ratio: number): [CanvasRenderingContext2D, string];
|
|
265
|
+
interface WICanvas {
|
|
266
|
+
drawImage({ e, x, y, angle, width, height, containerHeight, containerWidth, }: {
|
|
267
|
+
e: HTMLImageElement;
|
|
268
|
+
x: number;
|
|
269
|
+
y: number;
|
|
270
|
+
angle: number;
|
|
271
|
+
width: number;
|
|
272
|
+
height: number;
|
|
273
|
+
containerWidth: number;
|
|
274
|
+
containerHeight: number;
|
|
275
|
+
}): void;
|
|
276
|
+
drawColor(type: string, color: string, width: number, ratio: number): void;
|
|
286
277
|
}
|
|
287
|
-
declare class Canvas implements
|
|
288
|
-
|
|
278
|
+
declare class Canvas implements WICanvas {
|
|
279
|
+
private canvas;
|
|
280
|
+
private canvas2DContext;
|
|
281
|
+
private src?;
|
|
282
|
+
constructor(width: number, height: number);
|
|
283
|
+
get(): {
|
|
289
284
|
canvas: HTMLCanvasElement;
|
|
290
285
|
context: CanvasRenderingContext2D;
|
|
286
|
+
src: string | undefined;
|
|
291
287
|
};
|
|
292
|
-
drawImage(e
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
288
|
+
drawImage({ e, x, y, angle, width, height, containerHeight, containerWidth, }: {
|
|
289
|
+
e: HTMLImageElement;
|
|
290
|
+
x: number;
|
|
291
|
+
y: number;
|
|
292
|
+
angle: number;
|
|
293
|
+
width: number;
|
|
294
|
+
height: number;
|
|
295
|
+
containerWidth: number;
|
|
296
|
+
containerHeight: number;
|
|
297
|
+
}): void;
|
|
298
|
+
drawColor(type: string, color: string, width: number, ratio: number): void;
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
declare const Image: {
|
|
@@ -304,7 +306,7 @@ declare const Image: {
|
|
|
304
306
|
*/
|
|
305
307
|
FromFileToImageSrc(file?: File | Blob): Promise<string | null>;
|
|
306
308
|
/**
|
|
307
|
-
*
|
|
309
|
+
* Take a url, look for the corresponding image file, and convert it to base64 format
|
|
308
310
|
* @param url
|
|
309
311
|
* @returns
|
|
310
312
|
*/
|
|
@@ -318,63 +320,175 @@ declare const Image: {
|
|
|
318
320
|
isBase64(url?: string): boolean;
|
|
319
321
|
};
|
|
320
322
|
|
|
323
|
+
interface IWElement {
|
|
324
|
+
/**
|
|
325
|
+
* Add Event Listener
|
|
326
|
+
* @param type
|
|
327
|
+
* @param listener
|
|
328
|
+
* @param options
|
|
329
|
+
*/
|
|
330
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
331
|
+
/**
|
|
332
|
+
* Get element dimension
|
|
333
|
+
*/
|
|
334
|
+
getDimension(): {
|
|
335
|
+
x: number;
|
|
336
|
+
y: number;
|
|
337
|
+
angle: number;
|
|
338
|
+
width: number;
|
|
339
|
+
height: number;
|
|
340
|
+
ratio: number;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Set element dimension
|
|
344
|
+
*/
|
|
345
|
+
setDimension({ x, y, angle, width, height, }: {
|
|
346
|
+
x?: number;
|
|
347
|
+
y?: number;
|
|
348
|
+
angle?: number;
|
|
349
|
+
width?: number;
|
|
350
|
+
height?: number;
|
|
351
|
+
}): void;
|
|
352
|
+
/**
|
|
353
|
+
* Set position css property
|
|
354
|
+
* @param position
|
|
355
|
+
*/
|
|
356
|
+
setPosition(position: 'fixed' | 'relative' | 'absolute' | 'unset'): void;
|
|
357
|
+
/**
|
|
358
|
+
* Perform drag
|
|
359
|
+
* @param x
|
|
360
|
+
* @param y
|
|
361
|
+
*/
|
|
362
|
+
drag(x?: number, y?: number): void;
|
|
363
|
+
/**
|
|
364
|
+
* Perform rotation
|
|
365
|
+
* @param angle
|
|
366
|
+
*/
|
|
367
|
+
rotate(angle?: number): void;
|
|
368
|
+
/**
|
|
369
|
+
* Perform resize
|
|
370
|
+
* @param width
|
|
371
|
+
* @param height
|
|
372
|
+
*/
|
|
373
|
+
resize(width?: number, height?: number): void;
|
|
374
|
+
/**
|
|
375
|
+
* Method runs a side effect handler for a specific element
|
|
376
|
+
*/
|
|
377
|
+
runSideEffectHandler(): void;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
declare class TransformOperationExtension {
|
|
381
|
+
private xOrigin;
|
|
382
|
+
private yOrigin;
|
|
383
|
+
private wOrigin;
|
|
384
|
+
private hOrigin;
|
|
385
|
+
private isSideEffect;
|
|
386
|
+
private sideEffectList;
|
|
387
|
+
subscribeSideEffect(element: IWElement): void;
|
|
388
|
+
runSideEffectHandler(): void;
|
|
389
|
+
setSideEffectState(value?: boolean): void;
|
|
390
|
+
getSideEffectState(): boolean;
|
|
391
|
+
setOrigin({ x, y, width, height, }: {
|
|
392
|
+
x: number;
|
|
393
|
+
y: number;
|
|
394
|
+
width: number;
|
|
395
|
+
height: number;
|
|
396
|
+
}): void;
|
|
397
|
+
getOrigin(): {
|
|
398
|
+
x: number;
|
|
399
|
+
y: number;
|
|
400
|
+
width: number;
|
|
401
|
+
height: number;
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
321
405
|
/**
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
* Element 3 : Image element
|
|
327
|
-
*
|
|
328
|
-
* Element 4 : Controller
|
|
329
|
-
*
|
|
330
|
-
* @example
|
|
331
|
-
* ```ts
|
|
332
|
-
* <div class="frame"> (2)
|
|
333
|
-
* <div class="wrapper"> (1)
|
|
334
|
-
* <img class="img__preview" /> (3)
|
|
335
|
-
* </div>
|
|
336
|
-
* </div>
|
|
337
|
-
* ```
|
|
406
|
+
* Transform Operation class
|
|
407
|
+
* - Design pattern used here is Composite Pattern
|
|
408
|
+
* - Implement IWElement as group of IWElement
|
|
338
409
|
*/
|
|
339
|
-
declare class
|
|
340
|
-
private
|
|
341
|
-
private ele2;
|
|
410
|
+
declare class TransformOperation extends TransformOperationExtension implements IWElement {
|
|
411
|
+
private list;
|
|
342
412
|
private x;
|
|
343
413
|
private y;
|
|
344
414
|
private angle;
|
|
345
|
-
private
|
|
346
|
-
private
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
initialize(): Promise<void>;
|
|
358
|
-
reset(): void;
|
|
359
|
-
setState({ x, y, angle, w, }: {
|
|
415
|
+
private width;
|
|
416
|
+
private height;
|
|
417
|
+
setPosition(position: 'fixed' | 'relative' | 'absolute' | 'unset'): void;
|
|
418
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
419
|
+
setDimension({ x, y, angle, width, height, }: {
|
|
420
|
+
x?: number;
|
|
421
|
+
y?: number;
|
|
422
|
+
angle?: number;
|
|
423
|
+
width?: number;
|
|
424
|
+
height?: number;
|
|
425
|
+
}): void;
|
|
426
|
+
getDimension(): {
|
|
360
427
|
x: number;
|
|
361
428
|
y: number;
|
|
362
429
|
angle: number;
|
|
363
|
-
|
|
430
|
+
width: number;
|
|
431
|
+
height: number;
|
|
432
|
+
ratio: number;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Register an HTML Element to the TransformOperation
|
|
436
|
+
* @param element
|
|
437
|
+
*/
|
|
438
|
+
subscribe(element: IWElement): void;
|
|
439
|
+
drag(x?: number, y?: number): void;
|
|
440
|
+
rotate(angle?: number): void;
|
|
441
|
+
resize(width?: number, height?: number): void;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
interface Props {
|
|
445
|
+
container: HTMLElement;
|
|
446
|
+
frame: HTMLElement;
|
|
447
|
+
img: HTMLImageElement;
|
|
448
|
+
controller: HTMLElement;
|
|
449
|
+
topLeft: HTMLElement;
|
|
450
|
+
topRight: HTMLElement;
|
|
451
|
+
bottomLeft: HTMLElement;
|
|
452
|
+
bottomRight: HTMLElement;
|
|
453
|
+
rotate: HTMLElement;
|
|
454
|
+
transformOperation: TransformOperation;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Transform is responsible for correctly setting dimension and side effect for editor
|
|
458
|
+
* - Intialize state
|
|
459
|
+
* - Get state
|
|
460
|
+
* - Set state
|
|
461
|
+
* - Reset state
|
|
462
|
+
*/
|
|
463
|
+
declare class Transform {
|
|
464
|
+
private frame;
|
|
465
|
+
private img;
|
|
466
|
+
private container;
|
|
467
|
+
private controller;
|
|
468
|
+
private topLeft;
|
|
469
|
+
private topRight;
|
|
470
|
+
private bottomLeft;
|
|
471
|
+
private bottomRight;
|
|
472
|
+
private rotate;
|
|
473
|
+
private transformOperation;
|
|
474
|
+
constructor({ container, frame, img, controller, topLeft, topRight, bottomLeft, bottomRight, rotate, transformOperation, }: Props);
|
|
475
|
+
initialize(): Transform;
|
|
476
|
+
setState({ x, y, angle, width, height, }: {
|
|
477
|
+
x?: number;
|
|
478
|
+
y?: number;
|
|
479
|
+
angle?: number;
|
|
480
|
+
width?: number;
|
|
481
|
+
height?: number;
|
|
364
482
|
}): void;
|
|
365
|
-
|
|
366
|
-
exportData(): {
|
|
483
|
+
getState(): {
|
|
367
484
|
x: number;
|
|
368
485
|
y: number;
|
|
369
486
|
angle: number;
|
|
370
|
-
|
|
371
|
-
|
|
487
|
+
width: number;
|
|
488
|
+
height: number;
|
|
489
|
+
ratio: number;
|
|
372
490
|
};
|
|
373
|
-
|
|
374
|
-
private resize;
|
|
375
|
-
private rotateBox;
|
|
376
|
-
private handleElementGoOffScreen;
|
|
377
|
-
private transform;
|
|
491
|
+
reset(): Transform;
|
|
378
492
|
}
|
|
379
493
|
|
|
380
494
|
interface HandleAsyncType<DataType> {
|
|
@@ -541,4 +655,77 @@ declare const SessionProvider: ({ value, children, }: {
|
|
|
541
655
|
*/
|
|
542
656
|
declare const useAuthClient: (auth: AuthInterface<SessionType>) => SessionContextType;
|
|
543
657
|
|
|
544
|
-
|
|
658
|
+
/**
|
|
659
|
+
* Linear Algebra library - Will Phan
|
|
660
|
+
* - Vector used in this library will be 3 dimension vector = [x, y, 1] : number[]
|
|
661
|
+
* - Accessing x by using vector[0]
|
|
662
|
+
* - Accessing y by using vector[1]
|
|
663
|
+
*/
|
|
664
|
+
declare const LinearAlgebra: {
|
|
665
|
+
/**
|
|
666
|
+
* Translate a point by a vector
|
|
667
|
+
* @param vector coordinates of a point
|
|
668
|
+
* @param translateVector vector for translation
|
|
669
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
670
|
+
*/
|
|
671
|
+
translateVector(vector: number[], translateVector: number[]): number[];
|
|
672
|
+
/**
|
|
673
|
+
* Rotate a vector by an angle in radian
|
|
674
|
+
* @param vector
|
|
675
|
+
* @param angle
|
|
676
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
677
|
+
*/
|
|
678
|
+
rotateVector(vector: number[], angle: number): number[];
|
|
679
|
+
/**
|
|
680
|
+
* Get opposite vector
|
|
681
|
+
* @param vector
|
|
682
|
+
*/
|
|
683
|
+
getOppositeVector(vector: number[]): number[];
|
|
684
|
+
/**
|
|
685
|
+
* Nicolas Mattia formula
|
|
686
|
+
* @param vector
|
|
687
|
+
* @param translate
|
|
688
|
+
* @param angle
|
|
689
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
690
|
+
*
|
|
691
|
+
* @link https://nmattia.com/posts/2020-03-03-drag-resize-rotate/
|
|
692
|
+
*/
|
|
693
|
+
NicolasMattia(vector: number[], translate: number[], angle: number): number[];
|
|
694
|
+
/**
|
|
695
|
+
* Set coofficient for a vector
|
|
696
|
+
* @param coefficient
|
|
697
|
+
* @param vector
|
|
698
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
699
|
+
*/
|
|
700
|
+
setCoefficient(coefficient: number, vector: number[]): number[];
|
|
701
|
+
/**
|
|
702
|
+
* Plus 2 vectors
|
|
703
|
+
* @param vector1
|
|
704
|
+
* @param vector2
|
|
705
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
706
|
+
*/
|
|
707
|
+
plusVectors(vector1: number[], vector2: number[]): number[];
|
|
708
|
+
/**
|
|
709
|
+
* Get middle vector from 2 vectors
|
|
710
|
+
* @param vector1
|
|
711
|
+
* @param vector2
|
|
712
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
713
|
+
*/
|
|
714
|
+
getMiddleVectorFrom(vector1: number[], vector2: number[]): number[];
|
|
715
|
+
/**
|
|
716
|
+
* Compute dot products between two vectors
|
|
717
|
+
* @param vector1
|
|
718
|
+
* @param vector2
|
|
719
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
720
|
+
*/
|
|
721
|
+
dotProduct(vector1: number[], vector2: number[]): number;
|
|
722
|
+
/**
|
|
723
|
+
* Get vector magnitude
|
|
724
|
+
* - formula : if vector = [x,y] => magnitude = square root of x^2 + y^2
|
|
725
|
+
* @param vector
|
|
726
|
+
* @throws Exception if the vector is not in 3 dimension
|
|
727
|
+
*/
|
|
728
|
+
getVectorMagnitude(vector: number[]): number;
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
export { type AuthInterface, Avatar, Button, Canvas, ColorPickerSlider, DropdownSelect, Image$1 as Image, ImageEditor, Image as ImageUtilities, InputFile, InputGoogle, LinearAlgebra, MultiSelect, OptionSlider, type Options$2 as Options, RangeSlider, SessionProvider, type SessionType, type Options$1 as SliderOptions, type StorageInterface, TextArea, Transform, UploadImage, tools, useAuthClient, useSession };
|