@baleada/logic 0.20.8 → 0.20.12
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/lib/index.cjs +2807 -2723
- package/lib/index.d.ts +69 -7
- package/lib/index.js +2774 -2724
- package/package.json +7 -5
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { getStroke, StrokeOptions } from 'perfect-freehand';
|
|
2
2
|
import createDOMPurify, { Config } from 'dompurify';
|
|
3
3
|
import { FullOptions, MatchData, Searcher } from 'fast-fuzzy';
|
|
4
4
|
import { Options } from '@sindresorhus/slugify';
|
|
@@ -112,6 +112,36 @@ declare class Animateable {
|
|
|
112
112
|
stop(): this;
|
|
113
113
|
private stopped;
|
|
114
114
|
}
|
|
115
|
+
declare const linear: AnimateableKeyframe['timing'];
|
|
116
|
+
declare const materialStandard: AnimateableKeyframe['timing'];
|
|
117
|
+
declare const materialDecelerated: AnimateableKeyframe['timing'];
|
|
118
|
+
declare const materialAccelerated: AnimateableKeyframe['timing'];
|
|
119
|
+
declare const verouEase: AnimateableKeyframe['timing'];
|
|
120
|
+
declare const verouEaseIn: AnimateableKeyframe['timing'];
|
|
121
|
+
declare const verouEaseOut: AnimateableKeyframe['timing'];
|
|
122
|
+
declare const verouEaseInOut: AnimateableKeyframe['timing'];
|
|
123
|
+
declare const easingsNetInSine: AnimateableKeyframe['timing'];
|
|
124
|
+
declare const easingsNetOutSine: AnimateableKeyframe['timing'];
|
|
125
|
+
declare const easingsNetInOutSine: AnimateableKeyframe['timing'];
|
|
126
|
+
declare const easingsNetInQuad: AnimateableKeyframe['timing'];
|
|
127
|
+
declare const easingsNetOutQuad: AnimateableKeyframe['timing'];
|
|
128
|
+
declare const easingsNetInOutQuad: AnimateableKeyframe['timing'];
|
|
129
|
+
declare const easingsNetInCubic: AnimateableKeyframe['timing'];
|
|
130
|
+
declare const easingsNetOutCubic: AnimateableKeyframe['timing'];
|
|
131
|
+
declare const easingsNetInOutCubic: AnimateableKeyframe['timing'];
|
|
132
|
+
declare const easingsNetInQuart: AnimateableKeyframe['timing'];
|
|
133
|
+
declare const easingsNetInQuint: AnimateableKeyframe['timing'];
|
|
134
|
+
declare const easingsNetOutQuint: AnimateableKeyframe['timing'];
|
|
135
|
+
declare const easingsNetInOutQuint: AnimateableKeyframe['timing'];
|
|
136
|
+
declare const easingsNetInExpo: AnimateableKeyframe['timing'];
|
|
137
|
+
declare const easingsNetOutExpo: AnimateableKeyframe['timing'];
|
|
138
|
+
declare const easingsNetInOutExpo: AnimateableKeyframe['timing'];
|
|
139
|
+
declare const easingsNetInCirc: AnimateableKeyframe['timing'];
|
|
140
|
+
declare const easingsNetOutCirc: AnimateableKeyframe['timing'];
|
|
141
|
+
declare const easingsNetInOutCirc: AnimateableKeyframe['timing'];
|
|
142
|
+
declare const easingsNetInBack: AnimateableKeyframe['timing'];
|
|
143
|
+
declare const easingsNetOutBack: AnimateableKeyframe['timing'];
|
|
144
|
+
declare const easingsNetInOutBack: AnimateableKeyframe['timing'];
|
|
115
145
|
|
|
116
146
|
declare type CompleteableOptions = {
|
|
117
147
|
segment?: {
|
|
@@ -317,7 +347,9 @@ declare type ListenOptions<Type extends ListenableSupportedType> = Type extends
|
|
|
317
347
|
observe?: ResizeObserverOptions;
|
|
318
348
|
} & ObservationListenOptions : Type extends 'idle' ? {
|
|
319
349
|
requestIdleCallback?: IdleRequestOptions;
|
|
320
|
-
} : Type extends ListenableMediaQuery ? {
|
|
350
|
+
} : Type extends ListenableMediaQuery ? {
|
|
351
|
+
instantEffect?: (list: MediaQueryList) => any;
|
|
352
|
+
} : Type extends ListenableClickcombo ? EventListenOptions : Type extends ListenablePointercombo ? EventListenOptions : Type extends ListenableKeycombo ? {
|
|
321
353
|
keyDirection?: 'up' | 'down';
|
|
322
354
|
} & EventListenOptions : Type extends keyof Omit<HTMLElementEventMap, 'resize'> ? EventListenOptions : Type extends keyof Omit<DocumentEventMap, 'resize'> ? EventListenOptions : never;
|
|
323
355
|
declare type ObservationListenOptions = {
|
|
@@ -399,7 +431,7 @@ declare function eventMatchesKeycombo({ event, keycombo }: {
|
|
|
399
431
|
declare type DispatchableOptions = Record<string, never>;
|
|
400
432
|
declare type DispatchableStatus = 'ready' | 'dispatched';
|
|
401
433
|
declare type DispatchOptions<EventType extends ListenableSupportedEventType> = {
|
|
402
|
-
init?: EventType extends ListenableClickcombo ? EventHandlersEventInitMap['mousedown'] : EventType extends ListenablePointercombo ? EventHandlersEventInitMap['pointerdown'] : EventType extends ListenableKeycombo ? EventHandlersEventInitMap['keydown'] : EventType extends keyof Omit<HTMLElementEventMap, 'resize'> ? EventHandlersEventInitMap[EventType] : EventType extends keyof Omit<DocumentEventMap, 'resize'> ? EventHandlersEventInitMap[EventType] : never;
|
|
434
|
+
init?: EventType extends ListenableClickcombo ? EventHandlersEventInitMap['mousedown'] : EventType extends ListenablePointercombo ? EventHandlersEventInitMap['pointerdown'] : EventType extends ListenableKeycombo ? EventHandlersEventInitMap['keydown'] : EventType extends keyof Omit<HTMLElementEventMap$1, 'resize'> ? EventHandlersEventInitMap[EventType] : EventType extends keyof Omit<DocumentEventMap, 'resize'> ? EventHandlersEventInitMap[EventType] : never;
|
|
403
435
|
target?: Window & typeof globalThis | Document | Element;
|
|
404
436
|
} & (EventType extends ListenableKeycombo ? {
|
|
405
437
|
keyDirection?: 'up' | 'down';
|
|
@@ -418,7 +450,11 @@ declare class Dispatchable<EventType extends ListenableSupportedEventType> {
|
|
|
418
450
|
dispatch(options?: DispatchOptions<EventType>): this;
|
|
419
451
|
private dispatched;
|
|
420
452
|
}
|
|
421
|
-
declare type EventHandlersEventInitMap = GlobalEventHandlersEventInitMap & DocumentAndElementEventHandlersEventInitMap & DocumentEventInitMap;
|
|
453
|
+
declare type EventHandlersEventInitMap = GlobalEventHandlersEventInitMap & DocumentAndElementEventHandlersEventInitMap & DocumentEventInitMap & HTMLElementEventMap$1;
|
|
454
|
+
declare type HTMLElementEventMap$1 = {
|
|
455
|
+
"fullscreenchange": EventInit;
|
|
456
|
+
"fullscreenerror": EventInit;
|
|
457
|
+
};
|
|
422
458
|
declare type GlobalEventHandlersEventInitMap = {
|
|
423
459
|
"abort": UIEventInit;
|
|
424
460
|
"animationcancel": AnimationEventInit;
|
|
@@ -428,7 +464,6 @@ declare type GlobalEventHandlersEventInitMap = {
|
|
|
428
464
|
"auxclick": MouseEventInit;
|
|
429
465
|
"beforeinput": InputEventInit;
|
|
430
466
|
"blur": FocusEventInit;
|
|
431
|
-
"cancel": EventInit;
|
|
432
467
|
"canplay": EventInit;
|
|
433
468
|
"canplaythrough": EventInit;
|
|
434
469
|
"change": EventInit;
|
|
@@ -443,7 +478,6 @@ declare type GlobalEventHandlersEventInitMap = {
|
|
|
443
478
|
"drag": DragEventInit;
|
|
444
479
|
"dragend": DragEventInit;
|
|
445
480
|
"dragenter": DragEventInit;
|
|
446
|
-
"dragexit": EventInit;
|
|
447
481
|
"dragleave": DragEventInit;
|
|
448
482
|
"dragover": DragEventInit;
|
|
449
483
|
"dragstart": DragEventInit;
|
|
@@ -455,6 +489,7 @@ declare type GlobalEventHandlersEventInitMap = {
|
|
|
455
489
|
"focus": FocusEventInit;
|
|
456
490
|
"focusin": FocusEventInit;
|
|
457
491
|
"focusout": FocusEventInit;
|
|
492
|
+
"formdata": FormDataEventInit;
|
|
458
493
|
"gotpointercapture": PointerEventInit;
|
|
459
494
|
"input": EventInit;
|
|
460
495
|
"invalid": EventInit;
|
|
@@ -510,6 +545,10 @@ declare type GlobalEventHandlersEventInitMap = {
|
|
|
510
545
|
"transitionstart": TransitionEventInit;
|
|
511
546
|
"volumechange": EventInit;
|
|
512
547
|
"waiting": EventInit;
|
|
548
|
+
"webkitanimationend": EventInit;
|
|
549
|
+
"webkitanimationiteration": EventInit;
|
|
550
|
+
"webkitanimationstart": EventInit;
|
|
551
|
+
"webkittransitionend": EventInit;
|
|
513
552
|
"wheel": WheelEventInit;
|
|
514
553
|
};
|
|
515
554
|
declare type DocumentAndElementEventHandlersEventInitMap = {
|
|
@@ -526,6 +565,29 @@ declare type DocumentEventInitMap = {
|
|
|
526
565
|
"visibilitychange": EventInit;
|
|
527
566
|
};
|
|
528
567
|
|
|
568
|
+
declare type DrawableOptions = {
|
|
569
|
+
toD?: (stroke: ReturnType<typeof getStroke>) => string;
|
|
570
|
+
};
|
|
571
|
+
declare type DrawableStatus = 'ready' | 'drawing' | 'drawn';
|
|
572
|
+
declare class Drawable {
|
|
573
|
+
private computedD;
|
|
574
|
+
private toD;
|
|
575
|
+
constructor(stroke: ReturnType<typeof getStroke>, options?: DrawableOptions);
|
|
576
|
+
computedStatus: DrawableStatus;
|
|
577
|
+
private ready;
|
|
578
|
+
get stroke(): number[][];
|
|
579
|
+
set stroke(stroke: number[][]);
|
|
580
|
+
get status(): DrawableStatus;
|
|
581
|
+
get d(): string;
|
|
582
|
+
private computedStroke;
|
|
583
|
+
setStroke(stroke: ReturnType<typeof getStroke>): this;
|
|
584
|
+
draw(points: Parameters<typeof getStroke>[0], options?: StrokeOptions): this;
|
|
585
|
+
private drawing;
|
|
586
|
+
private drawn;
|
|
587
|
+
}
|
|
588
|
+
declare function toD(stroke: number[][]): string;
|
|
589
|
+
declare function toFlattenedD(stroke: number[][]): string;
|
|
590
|
+
|
|
529
591
|
declare type ResolveableOptions = Record<string, never>;
|
|
530
592
|
declare type ResolveableGetPromise<Value> = (...args: any[]) => (Promise<Value> | Promise<Value>[]);
|
|
531
593
|
declare type ResolveableStatus = 'ready' | 'resolving' | 'resolved' | 'errored';
|
|
@@ -800,4 +862,4 @@ declare class Pipeable {
|
|
|
800
862
|
pipeAsync(...fns: ((...args: any[]) => Promise<any>)[]): Promise<any>;
|
|
801
863
|
}
|
|
802
864
|
|
|
803
|
-
export { AnimateFrame, AnimateFrameEffect, AnimateOptions, Animateable, AnimateableKeyframe, AnimateableOptions, AnimateableStatus, ArrayFunction, ArrayFunctionAsync, CompleteOptions, Completeable, CompleteableOptions, CompleteableStatus, Copyable, CopyableOptions, CopyableStatus, Delayable, DelayableEffect, DelayableOptions, DelayableStatus, DispatchOptions, Dispatchable, DispatchableOptions, DispatchableStatus, FetchOptions, FetchOptionsApi, Fetchable, FetchableOptions, FetchableStatus, Fullscreenable, FullscreenableGetElement, FullscreenableOptions, FullscreenableStatus, Grantable, GrantableOptions, GrantableStatus, ListenEffect, ListenEffectParam, ListenOptions, Listenable, ListenableActive, ListenableClickcombo, ListenableKeycombo, ListenableKeycomboItem, ListenableOptions, ListenablePointercombo, ListenableStatus, ListenableSupportedEventType, ListenableSupportedType, MapFunction, Navigateable, NavigateableOptions, NavigateableStatus, NumberFunction, Pipeable, RecognizeOptions, Recognizeable, RecognizeableEffectApi, RecognizeableOptions, RecognizeableStatus, Resolveable, ResolveableGetPromise, ResolveableOptions, ResolveableStatus, Sanitizeable, SanitizeableOptions, SanitizeableStatus, Searchable, SearchableOptions, SearchableStatus, Storeable, StoreableOptions, StoreableStatus, StringFunction, createClamp, createClip, createConcat, createDelete, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, ensureKeycombo, eventMatchesKeycombo };
|
|
865
|
+
export { AnimateFrame, AnimateFrameEffect, AnimateOptions, Animateable, AnimateableKeyframe, AnimateableOptions, AnimateableStatus, ArrayFunction, ArrayFunctionAsync, CompleteOptions, Completeable, CompleteableOptions, CompleteableStatus, Copyable, CopyableOptions, CopyableStatus, Delayable, DelayableEffect, DelayableOptions, DelayableStatus, DispatchOptions, Dispatchable, DispatchableOptions, DispatchableStatus, Drawable, DrawableOptions, DrawableStatus, FetchOptions, FetchOptionsApi, Fetchable, FetchableOptions, FetchableStatus, Fullscreenable, FullscreenableGetElement, FullscreenableOptions, FullscreenableStatus, Grantable, GrantableOptions, GrantableStatus, ListenEffect, ListenEffectParam, ListenOptions, Listenable, ListenableActive, ListenableClickcombo, ListenableKeycombo, ListenableKeycomboItem, ListenableOptions, ListenablePointercombo, ListenableStatus, ListenableSupportedEventType, ListenableSupportedType, MapFunction, Navigateable, NavigateableOptions, NavigateableStatus, NumberFunction, Pipeable, RecognizeOptions, Recognizeable, RecognizeableEffectApi, RecognizeableOptions, RecognizeableStatus, Resolveable, ResolveableGetPromise, ResolveableOptions, ResolveableStatus, Sanitizeable, SanitizeableOptions, SanitizeableStatus, Searchable, SearchableOptions, SearchableStatus, Storeable, StoreableOptions, StoreableStatus, StringFunction, createClamp, createClip, createConcat, createDelete, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|