@baleada/logic 0.23.4 → 0.24.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.
- package/lib/index.cjs +2268 -1915
- package/lib/index.d.ts +936 -587
- package/lib/index.js +2195 -1881
- package/package.json +4 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,150 +1,254 @@
|
|
|
1
1
|
import { getStroke, StrokeOptions } from 'perfect-freehand';
|
|
2
2
|
import * as ky_distribution_types_ky from 'ky/distribution/types/ky';
|
|
3
|
-
import ky, { Options } from 'ky';
|
|
4
|
-
import { Config, DOMPurifyI } from 'dompurify';
|
|
5
|
-
import { FullOptions, MatchData, Searcher } from 'fast-fuzzy';
|
|
6
|
-
import { Options as Options$1 } from '@sindresorhus/slugify';
|
|
3
|
+
import ky, { Options as Options$1 } from 'ky';
|
|
7
4
|
import { ClassValue } from 'clsx';
|
|
5
|
+
import { FullOptions, sortKind, MatchData } from 'fast-fuzzy';
|
|
6
|
+
import { Config } from 'dompurify';
|
|
7
|
+
import { Options } from '@sindresorhus/slugify';
|
|
8
8
|
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
type AnyTransform<Transformed> = (param: any) => Transformed;
|
|
10
|
+
/**
|
|
11
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/clone)
|
|
12
|
+
*/
|
|
13
|
+
declare function createClone<Any>(): AnyTransform<Any>;
|
|
14
|
+
/**
|
|
15
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/deep-equal)
|
|
16
|
+
*/
|
|
17
|
+
declare function createDeepEqual(compared: any): AnyTransform<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/equal)
|
|
20
|
+
*/
|
|
21
|
+
declare function createEqual(compared: any): AnyTransform<boolean>;
|
|
22
|
+
|
|
23
|
+
type ArrayTransform<Item, Transformed> = (array: Item[]) => Transformed;
|
|
24
|
+
/**
|
|
25
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/concat)
|
|
26
|
+
*/
|
|
27
|
+
declare function createConcat<Item>(...arrays: Item[][]): ArrayTransform<Item, Item[]>;
|
|
28
|
+
/**
|
|
29
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/filter)
|
|
30
|
+
*/
|
|
31
|
+
declare function createFilter<Item>(predicate: (item: Item, index: number) => boolean): ArrayTransform<Item, Item[]>;
|
|
32
|
+
/**
|
|
33
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/insert)
|
|
34
|
+
*/
|
|
35
|
+
declare function createInsert<Item>(item: Item, index: number): ArrayTransform<Item, Item[]>;
|
|
36
|
+
/**
|
|
37
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/map)
|
|
38
|
+
*/
|
|
39
|
+
declare function createMap<Item, Transformed = Item>(transform: (item: Item, index: number) => Transformed): ArrayTransform<Item, Transformed[]>;
|
|
40
|
+
/**
|
|
41
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/reduce)
|
|
42
|
+
*/
|
|
43
|
+
declare function createReduce<Item, Accumulator>(accumulate: (accumulator: Accumulator, item: Item, index: number) => Accumulator, initialValue?: Accumulator): (array: Item[]) => Accumulator;
|
|
44
|
+
/**
|
|
45
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/remove)
|
|
46
|
+
*/
|
|
47
|
+
declare function createRemove<Item>(index: number): ArrayTransform<Item, Item[]>;
|
|
48
|
+
/**
|
|
49
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/reorder)
|
|
50
|
+
*/
|
|
51
|
+
declare function createReorder<Item>(from: {
|
|
52
|
+
start: number;
|
|
53
|
+
itemCount: number;
|
|
54
|
+
} | number, to: number): ArrayTransform<Item, Item[]>;
|
|
55
|
+
/**
|
|
56
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/replace)
|
|
57
|
+
*/
|
|
58
|
+
declare function createReplace<Item>(index: number, replacement: Item): ArrayTransform<Item, Item[]>;
|
|
59
|
+
/**
|
|
60
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/reverse)
|
|
61
|
+
*/
|
|
62
|
+
declare function createReverse<Item>(): ArrayTransform<Item, Item[]>;
|
|
63
|
+
/**
|
|
64
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/slice)
|
|
65
|
+
*/
|
|
66
|
+
declare function createSlice<Item>(from: number, to?: number): ArrayTransform<Item, Item[]>;
|
|
67
|
+
/**
|
|
68
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/shuffle)
|
|
69
|
+
*/
|
|
70
|
+
declare function createShuffle<Item>(): ArrayTransform<Item, Item[]>;
|
|
71
|
+
/**
|
|
72
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/sort)
|
|
73
|
+
*/
|
|
74
|
+
declare function createSort<Item>(compare?: (itemA: Item, itemB: Item) => number): ArrayTransform<Item, Item[]>;
|
|
75
|
+
/**
|
|
76
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/swap)
|
|
77
|
+
*/
|
|
78
|
+
declare function createSwap<Item>(item1Index: number, item2Index: number): ArrayTransform<Item, Item[]>;
|
|
79
|
+
/**
|
|
80
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/unique)
|
|
81
|
+
*/
|
|
82
|
+
declare function createUnique<Item>(): ArrayTransform<Item, Item[]>;
|
|
83
|
+
|
|
84
|
+
type ArrayAsyncTransform<Item, Transformed> = (array: Item[]) => Promise<Transformed>;
|
|
85
|
+
/**
|
|
86
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/filter-async)
|
|
87
|
+
*/
|
|
88
|
+
declare function createFilterAsync<Item>(predicate: (item: Item, index: number) => Promise<boolean>): ArrayAsyncTransform<Item, Item[]>;
|
|
89
|
+
/**
|
|
90
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/find-async)
|
|
91
|
+
*/
|
|
92
|
+
declare function createFindAsync<Item>(predicate: (item: Item, index: number) => Promise<boolean>): ArrayAsyncTransform<Item, Item | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/find-index-async)
|
|
95
|
+
*/
|
|
96
|
+
declare function createFindIndexAsync<Item>(predicate: (item: Item, index: number) => Promise<boolean>): ArrayAsyncTransform<Item, number>;
|
|
97
|
+
/**
|
|
98
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/map-async)
|
|
99
|
+
*/
|
|
100
|
+
declare function createMapAsync<Item, Mapped>(transform: (item: Item, index: number) => Promise<Mapped>): ArrayAsyncTransform<Item, Mapped[]>;
|
|
101
|
+
/**
|
|
102
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/reduce-async)
|
|
103
|
+
*/
|
|
104
|
+
declare function createReduceAsync<Item, Accumulator>(accumulate: (accumulator: Accumulator, item: Item, index: number) => Promise<Accumulator>, initialValue?: Accumulator): (array: Item[]) => Promise<Accumulator>;
|
|
105
|
+
|
|
106
|
+
type AssociativeArrayEffect<Key, Value> = (associativeArray: AssociativeArray<Key, Value>) => AssociativeArray<Key, Value>;
|
|
107
|
+
/**
|
|
108
|
+
* [Docs](https://baleada.dev/docs/logic/links/associative-array-set)
|
|
109
|
+
*/
|
|
110
|
+
declare function createSet$1<Key extends any, Value extends any>(key: Key, value: Value, options?: WithPredicateKey): AssociativeArrayEffect<Key, Value>;
|
|
111
|
+
/**
|
|
112
|
+
* [Docs](https://baleada.dev/docs/logic/links/associative-array-clear)
|
|
113
|
+
*/
|
|
114
|
+
declare function createClear$1<Key extends any, Value extends any>(): AssociativeArrayEffect<Key, Value>;
|
|
115
|
+
/**
|
|
116
|
+
* [Docs](https://baleada.dev/docs/logic/links/associative-array-delete)
|
|
117
|
+
*/
|
|
118
|
+
declare function createDelete$1<Key extends any>(key: Key, options?: WithPredicateKey): AssociativeArrayEffect<Key, any>;
|
|
119
|
+
|
|
120
|
+
type AssociativeArray<Key, Value> = [Key, Value][];
|
|
121
|
+
|
|
122
|
+
type KeyStatusCode = string;
|
|
123
|
+
|
|
124
|
+
type CreateAliasesOptions = {
|
|
125
|
+
toLonghand?: (shorthand: string) => string;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type CreateKeycomboDownOptions = CreateAliasesOptions & {
|
|
129
|
+
toCode?: (alias: string) => KeyStatusCode;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
type CreateKeycomboMatchOptions$1 = CreateKeycomboDownOptions & {
|
|
133
|
+
toAliases?: (code: KeyStatusCode) => string[];
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
type KeyboardEventDescriptor = {
|
|
137
|
+
code: string;
|
|
138
|
+
shiftKey?: boolean;
|
|
139
|
+
altKey?: boolean;
|
|
140
|
+
ctrlKey?: boolean;
|
|
141
|
+
metaKey?: boolean;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
type Direction = 'up' | 'upRight' | 'right' | 'downRight' | 'down' | 'downLeft' | 'left' | 'upLeft';
|
|
145
|
+
|
|
146
|
+
type HookApi<Type extends ListenableSupportedType, Metadata extends Record<any, any>> = {
|
|
147
|
+
status: RecognizeableStatus;
|
|
148
|
+
metadata: Metadata;
|
|
149
|
+
sequence: ListenEffectParam<Type>[];
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
type PolarCoordinates = {
|
|
153
|
+
distance: number;
|
|
154
|
+
angle: {
|
|
155
|
+
radians: number;
|
|
156
|
+
degrees: number;
|
|
13
157
|
};
|
|
14
|
-
timing?: AnimateableTiming;
|
|
15
158
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
159
|
+
|
|
160
|
+
type KeyboardTimeMetadata = {
|
|
161
|
+
times: {
|
|
162
|
+
start: number;
|
|
163
|
+
end: number;
|
|
164
|
+
};
|
|
165
|
+
duration: number;
|
|
21
166
|
};
|
|
22
|
-
|
|
23
|
-
type
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
167
|
+
|
|
168
|
+
type PointerStartMetadata = {
|
|
169
|
+
points: {
|
|
170
|
+
start: {
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
};
|
|
174
|
+
end: {
|
|
175
|
+
x: number;
|
|
176
|
+
y: number;
|
|
32
177
|
};
|
|
33
178
|
};
|
|
34
|
-
timestamp: number;
|
|
35
179
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
180
|
+
|
|
181
|
+
type PointerTimeMetadata = {
|
|
182
|
+
times: {
|
|
183
|
+
start: number;
|
|
184
|
+
end: number;
|
|
39
185
|
};
|
|
186
|
+
duration: number;
|
|
187
|
+
velocity: number;
|
|
40
188
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
private getEaseables;
|
|
57
|
-
private getReversedEaseables;
|
|
58
|
-
constructor(keyframes: AnimateableKeyframe[], options?: AnimateableOptions);
|
|
59
|
-
private computedStatus;
|
|
60
|
-
private ready;
|
|
61
|
-
private computedTime;
|
|
62
|
-
private resetTime;
|
|
63
|
-
private computedProgress;
|
|
64
|
-
private resetProgress;
|
|
65
|
-
private computedIterations;
|
|
66
|
-
private resetIterations;
|
|
67
|
-
get keyframes(): AnimateableKeyframe[];
|
|
68
|
-
set keyframes(keyframes: AnimateableKeyframe[]);
|
|
69
|
-
get playbackRate(): number;
|
|
70
|
-
set playbackRate(playbackRate: number);
|
|
71
|
-
get status(): AnimateableStatus;
|
|
72
|
-
get iterations(): number;
|
|
73
|
-
get request(): number;
|
|
74
|
-
get time(): {
|
|
75
|
-
elapsed: number;
|
|
76
|
-
remaining: number;
|
|
189
|
+
|
|
190
|
+
type PointerMoveMetadata = {
|
|
191
|
+
distance: {
|
|
192
|
+
straight: {
|
|
193
|
+
fromStart: PolarCoordinates['distance'];
|
|
194
|
+
fromPrevious: PolarCoordinates['distance'];
|
|
195
|
+
};
|
|
196
|
+
horizontal: {
|
|
197
|
+
fromStart: PolarCoordinates['distance'];
|
|
198
|
+
fromPrevious: PolarCoordinates['distance'];
|
|
199
|
+
};
|
|
200
|
+
vertical: {
|
|
201
|
+
fromStart: PolarCoordinates['distance'];
|
|
202
|
+
fromPrevious: PolarCoordinates['distance'];
|
|
203
|
+
};
|
|
77
204
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
205
|
+
angle: {
|
|
206
|
+
fromPrevious: PolarCoordinates['angle'];
|
|
207
|
+
fromStart: PolarCoordinates['angle'];
|
|
81
208
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
declare const verouEaseInOut: AnimateableKeyframe['timing'];
|
|
126
|
-
declare const easingsNetInSine: AnimateableKeyframe['timing'];
|
|
127
|
-
declare const easingsNetOutSine: AnimateableKeyframe['timing'];
|
|
128
|
-
declare const easingsNetInOutSine: AnimateableKeyframe['timing'];
|
|
129
|
-
declare const easingsNetInQuad: AnimateableKeyframe['timing'];
|
|
130
|
-
declare const easingsNetOutQuad: AnimateableKeyframe['timing'];
|
|
131
|
-
declare const easingsNetInOutQuad: AnimateableKeyframe['timing'];
|
|
132
|
-
declare const easingsNetInCubic: AnimateableKeyframe['timing'];
|
|
133
|
-
declare const easingsNetOutCubic: AnimateableKeyframe['timing'];
|
|
134
|
-
declare const easingsNetInOutCubic: AnimateableKeyframe['timing'];
|
|
135
|
-
declare const easingsNetInQuart: AnimateableKeyframe['timing'];
|
|
136
|
-
declare const easingsNetInQuint: AnimateableKeyframe['timing'];
|
|
137
|
-
declare const easingsNetOutQuint: AnimateableKeyframe['timing'];
|
|
138
|
-
declare const easingsNetInOutQuint: AnimateableKeyframe['timing'];
|
|
139
|
-
declare const easingsNetInExpo: AnimateableKeyframe['timing'];
|
|
140
|
-
declare const easingsNetOutExpo: AnimateableKeyframe['timing'];
|
|
141
|
-
declare const easingsNetInOutExpo: AnimateableKeyframe['timing'];
|
|
142
|
-
declare const easingsNetInCirc: AnimateableKeyframe['timing'];
|
|
143
|
-
declare const easingsNetOutCirc: AnimateableKeyframe['timing'];
|
|
144
|
-
declare const easingsNetInOutCirc: AnimateableKeyframe['timing'];
|
|
145
|
-
declare const easingsNetInBack: AnimateableKeyframe['timing'];
|
|
146
|
-
declare const easingsNetOutBack: AnimateableKeyframe['timing'];
|
|
147
|
-
declare const easingsNetInOutBack: AnimateableKeyframe['timing'];
|
|
209
|
+
direction: {
|
|
210
|
+
fromPrevious: Direction;
|
|
211
|
+
fromStart: Direction;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
type Graph<Id extends string, StateValue> = {
|
|
216
|
+
nodes: GraphNode<Id>[];
|
|
217
|
+
edges: GraphEdge<Id, StateValue>[];
|
|
218
|
+
};
|
|
219
|
+
type GraphNode<Id extends string> = Id;
|
|
220
|
+
type GraphEdge<Id extends string, StateValue> = {
|
|
221
|
+
from: Id;
|
|
222
|
+
to: Id;
|
|
223
|
+
predicateShouldTraverse: (state: GraphState<Id, StateValue>) => boolean;
|
|
224
|
+
};
|
|
225
|
+
type GraphState<Id extends string, StateValue> = Record<Id, {
|
|
226
|
+
status: 'set' | 'unset';
|
|
227
|
+
value?: StateValue | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
type GraphPath<Id extends string> = GraphNode<Id>[];
|
|
230
|
+
type GraphStep<Id extends string, StateValue> = {
|
|
231
|
+
state: GraphState<Id, StateValue>;
|
|
232
|
+
path: GraphPath<Id>;
|
|
233
|
+
};
|
|
234
|
+
type GraphCommonAncestor<Id extends string> = {
|
|
235
|
+
node: GraphNode<Id>;
|
|
236
|
+
distances: Record<GraphNode<Id>, number>;
|
|
237
|
+
};
|
|
238
|
+
type GraphTreeNode<Id extends string> = {
|
|
239
|
+
node: GraphNode<Id>;
|
|
240
|
+
children: GraphTreeNode<Id>[];
|
|
241
|
+
};
|
|
242
|
+
type GraphTree<Id extends string> = GraphTreeNode<Id>[];
|
|
243
|
+
type GraphAsync<Id extends string, StateValue> = {
|
|
244
|
+
nodes: GraphNode<Id>[];
|
|
245
|
+
edges: GraphAsyncEdge<Id, StateValue>[];
|
|
246
|
+
};
|
|
247
|
+
type GraphAsyncEdge<Id extends string, StateValue> = {
|
|
248
|
+
from: Id;
|
|
249
|
+
to: Id;
|
|
250
|
+
predicateShouldTraverse: (state: GraphState<Id, StateValue>) => Promise<boolean>;
|
|
251
|
+
};
|
|
148
252
|
|
|
149
253
|
type RecognizeableOptions<Type extends ListenableSupportedType, Metadata extends Record<any, any>> = {
|
|
150
254
|
maxSequenceLength?: true | number;
|
|
@@ -161,12 +265,18 @@ type RecognizeableEffectApi<Type extends ListenableSupportedType, Metadata exten
|
|
|
161
265
|
denied: () => void;
|
|
162
266
|
getSequence: () => ListenEffectParam<Type>[];
|
|
163
267
|
pushSequence: (sequenceItem: ListenEffectParam<Type>) => void;
|
|
164
|
-
|
|
268
|
+
listenInjection: RecognizeOptions<Type>['listenInjection'];
|
|
165
269
|
};
|
|
166
270
|
type RecognizeableStatus = 'recognized' | 'recognizing' | 'denied' | 'ready';
|
|
167
271
|
type RecognizeOptions<Type extends ListenableSupportedType> = {
|
|
168
|
-
|
|
272
|
+
listenInjection?: {
|
|
273
|
+
effect: (sequenceItem: ListenEffectParam<Type>) => any;
|
|
274
|
+
optionsByType: Record<Type, ListenOptions<Type>>;
|
|
275
|
+
};
|
|
169
276
|
};
|
|
277
|
+
/**
|
|
278
|
+
* [Docs](https://baleada.dev/docs/logic/classes/recognizeable)
|
|
279
|
+
*/
|
|
170
280
|
declare class Recognizeable<Type extends ListenableSupportedType, Metadata extends Record<any, any>> {
|
|
171
281
|
private maxSequenceLength;
|
|
172
282
|
private effects;
|
|
@@ -184,7 +294,7 @@ declare class Recognizeable<Type extends ListenableSupportedType, Metadata exten
|
|
|
184
294
|
get metadata(): Metadata;
|
|
185
295
|
private computedSequence;
|
|
186
296
|
setSequence(sequence: ListenEffectParam<Type>[]): this;
|
|
187
|
-
recognize(sequenceItem: ListenEffectParam<Type>,
|
|
297
|
+
recognize(sequenceItem: ListenEffectParam<Type>, options?: RecognizeOptions<Type>): this;
|
|
188
298
|
private recognizing;
|
|
189
299
|
private toType;
|
|
190
300
|
}
|
|
@@ -202,7 +312,7 @@ type ListenableOptions<Type extends ListenableSupportedType, RecognizeableMetada
|
|
|
202
312
|
recognizeable?: RecognizeableOptions<Type, RecognizeableMetadata>;
|
|
203
313
|
};
|
|
204
314
|
type ListenEffect<Type extends ListenableSupportedType> = Type extends 'intersect' ? (entries: ListenEffectParam<Type>) => any : Type extends 'mutate' ? (records: ListenEffectParam<Type>) => any : Type extends 'resize' ? (entries: ListenEffectParam<Type>) => any : Type extends 'idle' ? (deadline: ListenEffectParam<Type>) => any : Type extends ('message' | 'messageerror') ? (event: MessageEvent) => any : Type extends ListenableMediaQuery ? (event: ListenEffectParam<Type>) => any : Type extends (ListenableLeftClick | ListenableRightClick) ? (event: ListenEffectParam<Type>) => any : Type extends (ListenablePointer) ? (event: ListenEffectParam<Type>) => any : Type extends ('keydown' | 'keyup') ? (event: ListenEffectParam<Type>) => any : Type extends keyof Omit<HTMLElementEventMap, 'resize'> ? (event: ListenEffectParam<Type>) => any : Type extends keyof Omit<DocumentEventMap, 'resize'> ? (event: ListenEffectParam<Type>) => any : never;
|
|
205
|
-
type ListenEffectParam<Type extends ListenableSupportedType> = Type extends 'intersect' ? IntersectionObserverEntry[] : Type extends 'mutate' ? MutationRecord[] : Type extends 'resize' ? ResizeObserverEntry[] : Type extends 'idle' ? IdleDeadline : Type extends ListenableMediaQuery ? MediaQueryListEvent : Type extends ListenableRightClick ? MouseEvent : Type extends keyof Omit<HTMLElementEventMap, 'resize'> ? HTMLElementEventMap[Type] : Type extends keyof Omit<DocumentEventMap, 'resize'> ? DocumentEventMap[Type] : never;
|
|
315
|
+
type ListenEffectParam<Type extends ListenableSupportedType> = Type extends 'intersect' ? IntersectionObserverEntry[] : Type extends 'mutate' ? MutationRecord[] : Type extends 'resize' ? ResizeObserverEntry[] : Type extends 'idle' ? IdleDeadline : Type extends ('message' | 'messageerror') ? MessageEvent : Type extends ListenableMediaQuery ? MediaQueryListEvent : Type extends ListenableRightClick ? MouseEvent : Type extends keyof Omit<HTMLElementEventMap, 'resize'> ? HTMLElementEventMap[Type] : Type extends keyof Omit<DocumentEventMap, 'resize'> ? DocumentEventMap[Type] : never;
|
|
206
316
|
type ListenOptions<Type extends ListenableSupportedType> = Type extends 'intersect' ? {
|
|
207
317
|
observer?: IntersectionObserverInit;
|
|
208
318
|
} & ObservationListenOptions : Type extends 'mutate' ? {
|
|
@@ -256,6 +366,9 @@ type ListenableActiveEventId<Type extends ListenableSupportedEventType> = [
|
|
|
256
366
|
optionsOrUseCapture: AddEventListenerOptions | boolean
|
|
257
367
|
];
|
|
258
368
|
type ListenableStatus = 'ready' | 'listening' | 'stopped';
|
|
369
|
+
/**
|
|
370
|
+
* [Docs](https://baleada.dev/docs/logic/classes/listenable)
|
|
371
|
+
*/
|
|
259
372
|
declare class Listenable<Type extends ListenableSupportedType, RecognizeableMetadata extends Record<any, any> = Record<any, any>> {
|
|
260
373
|
private computedRecognizeable;
|
|
261
374
|
private recognizeableEffectsKeys;
|
|
@@ -263,36 +376,529 @@ declare class Listenable<Type extends ListenableSupportedType, RecognizeableMeta
|
|
|
263
376
|
constructor(type: Type, options?: ListenableOptions<Type, RecognizeableMetadata>);
|
|
264
377
|
private computedStatus;
|
|
265
378
|
private ready;
|
|
266
|
-
get type(): string;
|
|
267
|
-
set type(type: string);
|
|
268
|
-
get status(): ListenableStatus;
|
|
269
|
-
get active(): Set<ListenableActive<Type, RecognizeableMetadata>>;
|
|
270
|
-
get recognizeable(): Recognizeable<Type, RecognizeableMetadata>;
|
|
271
|
-
private computedType;
|
|
272
|
-
private implementation;
|
|
273
|
-
setType(type: string): this;
|
|
274
|
-
listen(effect: ListenEffect<Type>, options?: ListenOptions<Type>): this;
|
|
275
|
-
private intersectionListen;
|
|
276
|
-
private mutationListen;
|
|
277
|
-
private resizeListen;
|
|
278
|
-
private mediaQueryListen;
|
|
279
|
-
private idleListen;
|
|
280
|
-
private messageListen;
|
|
281
|
-
private recognizeableListen;
|
|
282
|
-
private documentEventListen;
|
|
283
|
-
private eventListen;
|
|
284
|
-
private addEventListeners;
|
|
285
|
-
private listening;
|
|
286
|
-
stop(options?: {
|
|
287
|
-
target?: Element | Document | (Window & typeof globalThis);
|
|
288
|
-
}): this;
|
|
379
|
+
get type(): string;
|
|
380
|
+
set type(type: string);
|
|
381
|
+
get status(): ListenableStatus;
|
|
382
|
+
get active(): Set<ListenableActive<Type, RecognizeableMetadata>>;
|
|
383
|
+
get recognizeable(): Recognizeable<Type, RecognizeableMetadata>;
|
|
384
|
+
private computedType;
|
|
385
|
+
private implementation;
|
|
386
|
+
setType(type: string): this;
|
|
387
|
+
listen(effect: ListenEffect<Type>, options?: ListenOptions<Type>): this;
|
|
388
|
+
private intersectionListen;
|
|
389
|
+
private mutationListen;
|
|
390
|
+
private resizeListen;
|
|
391
|
+
private mediaQueryListen;
|
|
392
|
+
private idleListen;
|
|
393
|
+
private messageListen;
|
|
394
|
+
private recognizeableListen;
|
|
395
|
+
private documentEventListen;
|
|
396
|
+
private eventListen;
|
|
397
|
+
private addEventListeners;
|
|
398
|
+
private listening;
|
|
399
|
+
stop(options?: {
|
|
400
|
+
target?: Element | Document | (Window & typeof globalThis);
|
|
401
|
+
}): this;
|
|
402
|
+
private stopped;
|
|
403
|
+
private getDefaultListenOptions;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
type AssociativeArrayTransform<Key, Value, Transformed> = (associativeArray: AssociativeArray<Key, Value>) => Transformed;
|
|
407
|
+
type WithPredicateKey = {
|
|
408
|
+
predicateKey?: (candidate: any) => boolean;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/associative-array-value)
|
|
412
|
+
*/
|
|
413
|
+
declare function createValue$1<Key extends any, Value extends any>(key: Key, options?: WithPredicateKey): AssociativeArrayTransform<Key, Value, Value | undefined>;
|
|
414
|
+
/**
|
|
415
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/associative-array-has)
|
|
416
|
+
*/
|
|
417
|
+
declare function createHas$1<Key extends any>(key: Key, options?: WithPredicateKey): AssociativeArrayTransform<Key, any, boolean>;
|
|
418
|
+
/**
|
|
419
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/associative-array-keys)
|
|
420
|
+
*/
|
|
421
|
+
declare function createKeys$1<Key extends any>(): AssociativeArrayTransform<Key, any, Key[]>;
|
|
422
|
+
/**
|
|
423
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/associative-array-values)
|
|
424
|
+
*/
|
|
425
|
+
declare function createValues<Value extends any>(): AssociativeArrayTransform<any, Value, Value[]>;
|
|
426
|
+
|
|
427
|
+
type ManyTransform<Parameter, Transformed> = (...params: Parameter[]) => Transformed;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/list)
|
|
431
|
+
*/
|
|
432
|
+
declare function createList(): ManyTransform<ClassValue, string>;
|
|
433
|
+
|
|
434
|
+
type MixColorTransform<Transformed> = (mixColor: MixColor) => Transformed;
|
|
435
|
+
type ColorInterpolationMethod = RectangularColorSpace | PolarColorSpace | `${PolarColorSpace} ${HueInterpolationMethod}`;
|
|
436
|
+
type RectangularColorSpace = 'srgb' | 'srgb-linear' | 'lab' | 'oklab' | 'xyz' | 'xyz-d50' | 'xyz-d65';
|
|
437
|
+
type PolarColorSpace = 'hsl' | 'hwb' | 'lch' | 'oklch';
|
|
438
|
+
type HueInterpolationMethod = 'shorter' | 'longer' | 'increasing' | 'decreasing';
|
|
439
|
+
type CreateMixOptions = {
|
|
440
|
+
method?: ColorInterpolationMethod;
|
|
441
|
+
tag?: string;
|
|
442
|
+
getParent?: () => HTMLElement;
|
|
443
|
+
};
|
|
444
|
+
type MixColor = `${string} ${number}%` | string;
|
|
445
|
+
/**
|
|
446
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/mix)
|
|
447
|
+
*/
|
|
448
|
+
declare function createMix(color2: MixColor, options?: CreateMixOptions): MixColorTransform<string>;
|
|
449
|
+
|
|
450
|
+
type GraphStateTransform<Id extends string, Metadata, Transformed> = (state: GraphState<Id, Metadata>) => Transformed;
|
|
451
|
+
|
|
452
|
+
type GeneratorTransform<Parameter, Yielded> = (param: Parameter) => Generator<Yielded>;
|
|
453
|
+
|
|
454
|
+
type GraphNodeTransform<Id extends string, Transformed> = (node: GraphNode<Id>) => Transformed;
|
|
455
|
+
type GraphNodeGeneratorTransform<Id extends string, Yielded> = GeneratorTransform<GraphNode<Id>, Yielded>;
|
|
456
|
+
type GraphNodeTupleTransform<Id extends string, Transformed> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => Transformed;
|
|
457
|
+
type GraphNodeTupleGeneratorTransform<Id extends string, Yielded> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => Generator<Yielded>;
|
|
458
|
+
/**
|
|
459
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/root)
|
|
460
|
+
*/
|
|
461
|
+
declare function createRoot<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeTransform<Id, boolean>;
|
|
462
|
+
/**
|
|
463
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/terminal)
|
|
464
|
+
*/
|
|
465
|
+
declare function createTerminal<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeTransform<Id, boolean>;
|
|
466
|
+
/**
|
|
467
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/children)
|
|
468
|
+
*/
|
|
469
|
+
declare function createChildren<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeGeneratorTransform<GraphNode<Id>, GraphNode<Id>>;
|
|
470
|
+
/**
|
|
471
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/indegree)
|
|
472
|
+
*/
|
|
473
|
+
declare function createIndegree<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeTransform<Id, number>;
|
|
474
|
+
/**
|
|
475
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/outdegree)
|
|
476
|
+
*/
|
|
477
|
+
declare function createOutdegree<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeTransform<Id, number>;
|
|
478
|
+
/**
|
|
479
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/incoming)
|
|
480
|
+
*/
|
|
481
|
+
declare function createIncoming<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeGeneratorTransform<GraphNode<Id>, GraphType extends GraphAsync<Id, Metadata> ? GraphAsyncEdge<Id, Metadata> : GraphEdge<Id, Metadata>>;
|
|
482
|
+
/**
|
|
483
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/outgoing)
|
|
484
|
+
*/
|
|
485
|
+
declare function createOutgoing<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeGeneratorTransform<GraphNode<Id>, GraphType extends GraphAsync<Id, Metadata> ? GraphAsyncEdge<Id, Metadata> : GraphEdge<Id, Metadata>>;
|
|
486
|
+
declare function createOnlyChild<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeTransform<Id, boolean>;
|
|
487
|
+
/**
|
|
488
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/total-siblings)
|
|
489
|
+
*/
|
|
490
|
+
declare function createTotalSiblings<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeTransform<Id, number>;
|
|
491
|
+
/**
|
|
492
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/siblings)
|
|
493
|
+
*/
|
|
494
|
+
declare function createSiblings<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | GraphAsync<Id, Metadata>>(graph: GraphType): GraphNodeGeneratorTransform<GraphNode<Id>, GraphNode<Id>>;
|
|
495
|
+
|
|
496
|
+
type GraphTransform<Id extends string, Metadata, Transformed> = (graph: Graph<Id, Metadata>) => Transformed;
|
|
497
|
+
type GraphGeneratorTransform<Id extends string, Metadata, Yielded> = GeneratorTransform<Graph<Id, Metadata>, Yielded>;
|
|
498
|
+
|
|
499
|
+
type GeneratorAsyncTransform<Parameter, Yielded> = (param: Parameter) => AsyncGenerator<Yielded>;
|
|
500
|
+
|
|
501
|
+
type GraphAsyncTransform<Id extends string, Metadata, Transformed> = (graph: GraphAsync<Id, Metadata>) => Promise<Transformed>;
|
|
502
|
+
type GraphAsyncGeneratorTransform<Id extends string, Metadata, Yielded> = GeneratorTransform<GraphAsync<Id, Metadata>, Yielded>;
|
|
503
|
+
type GraphAsyncGeneratorAsyncTransform<Id extends string, Metadata, Yielded> = GeneratorAsyncTransform<GraphAsync<Id, Metadata>, Yielded>;
|
|
504
|
+
|
|
505
|
+
type CreatePathConfig<Id extends string, Metadata> = {
|
|
506
|
+
predicatePathable: (node: GraphNode<Id>) => boolean;
|
|
507
|
+
toTraversalCandidates: (path: GraphPath<Id>) => Iterable<GraphEdge<Id, Metadata>>;
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-path)
|
|
511
|
+
*/
|
|
512
|
+
declare function createPath$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>, config: CreatePathConfig<Id, Metadata>): GraphStateTransform<Id, Metadata, GraphPath<Id>>;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-layers)
|
|
516
|
+
*/
|
|
517
|
+
declare function createLayers$1<Id extends string>(options?: {
|
|
518
|
+
createDepthFirstSteps?: CreateStepsOptions$1<Id>;
|
|
519
|
+
}): GraphGeneratorTransform<Id, any, GraphNode<Id>[]>;
|
|
520
|
+
/**
|
|
521
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-tree)
|
|
522
|
+
*/
|
|
523
|
+
declare function createTree$2<Id extends string>(options?: {
|
|
524
|
+
createDepthFirstSteps?: CreateStepsOptions$1<Id>;
|
|
525
|
+
}): GraphTransform<Id, any, GraphTree<Id>>;
|
|
526
|
+
type CreateDepthFirstStepsOptions<Id extends string, StateValue = number> = CreateStepsOptions$1<Id> & {
|
|
527
|
+
getSetStateValue?: (api: {
|
|
528
|
+
node: GraphNode<Id>;
|
|
529
|
+
totalChildrenDiscovered: number;
|
|
530
|
+
}) => StateValue;
|
|
531
|
+
};
|
|
532
|
+
/**
|
|
533
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-depth-first-steps)
|
|
534
|
+
*/
|
|
535
|
+
declare function createDepthFirstSteps$2<Id extends string, StateValue = number>(options?: CreateDepthFirstStepsOptions<Id, StateValue>): GraphGeneratorTransform<Id, StateValue, GraphStep<Id, StateValue>>;
|
|
536
|
+
type CreateStepsOptions$1<Id extends string> = {
|
|
537
|
+
kind?: 'directed acyclic' | 'arborescence';
|
|
538
|
+
root?: GraphNode<Id>;
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-roots)
|
|
542
|
+
*/
|
|
543
|
+
declare function createRoots<Id extends string, StateValue, GraphType extends Graph<Id, StateValue> | GraphAsync<Id, StateValue> = Graph<Id, StateValue>>(options?: {
|
|
544
|
+
kind?: 'directed acyclic' | 'arborescence';
|
|
545
|
+
}): (GraphType extends GraphAsync<Id, StateValue> ? GraphAsyncGeneratorTransform<Id, StateValue, GraphNode<Id>> : GraphGeneratorTransform<Id, StateValue, GraphNode<Id>>);
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-common-ancestors)
|
|
549
|
+
*/
|
|
550
|
+
declare function createCommonAncestors$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>): GraphNodeTupleGeneratorTransform<Id, GraphCommonAncestor<Id>>;
|
|
551
|
+
/**
|
|
552
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-ancestor)
|
|
553
|
+
*/
|
|
554
|
+
declare function createAncestor$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>): GraphNodeTupleTransform<Id, boolean>;
|
|
555
|
+
/**
|
|
556
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-node-depth-first-steps)
|
|
557
|
+
*/
|
|
558
|
+
declare function createNodeDepthFirstSteps$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>, options?: {
|
|
559
|
+
createDepthFirstSteps?: CreateDepthFirstStepsOptions<Id, Metadata>;
|
|
560
|
+
}): GraphNodeGeneratorTransform<Id, GraphStep<Id, Metadata>>;
|
|
561
|
+
|
|
562
|
+
type CreateStepsOptions<Id extends string> = Pick<CreateStepsOptions$1<Id>, 'kind'> & {
|
|
563
|
+
priorityBranch?: boolean;
|
|
564
|
+
};
|
|
565
|
+
type DecisionTree<Id extends string> = Graph<Id, DecisionTreeStateValue>;
|
|
566
|
+
type DecisionTreeStateValue = boolean;
|
|
567
|
+
declare function createTree$1<Id extends string>(options?: {
|
|
568
|
+
createDepthFirstSteps?: CreateStepsOptions<Id>;
|
|
569
|
+
}): GraphTransform<Id, any, GraphTree<Id>>;
|
|
570
|
+
declare function createCommonAncestors$1<Id extends string>(...params: Parameters<typeof createCommonAncestors$2<Id, DecisionTreeStateValue>>): GraphNodeTupleGeneratorTransform<Id, GraphCommonAncestor<Id>>;
|
|
571
|
+
declare function createAncestor$1<Id extends string>(...params: Parameters<typeof createAncestor$2<Id, DecisionTreeStateValue>>): GraphNodeTupleTransform<Id, boolean>;
|
|
572
|
+
declare function createNodeDepthFirstSteps$1<Id extends string>(decisionTree: DecisionTree<Id>, options?: {
|
|
573
|
+
createDepthFirstSteps?: CreateStepsOptions<Id>;
|
|
574
|
+
}): GraphNodeGeneratorTransform<Id, GraphStep<Id, boolean>>;
|
|
575
|
+
declare function createDepthFirstSteps$1<Id extends string>(options: CreateStepsOptions<Id>): GraphGeneratorTransform<Id, boolean, GraphStep<Id, boolean>>;
|
|
576
|
+
declare function createPath$1<Id extends string>(...params: Parameters<typeof createPath$2<Id, DecisionTreeStateValue>>): GraphStateTransform<Id, boolean, GraphPath<Id>>;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-async-layers)
|
|
580
|
+
*/
|
|
581
|
+
declare function createLayers<Id extends string>(options?: {
|
|
582
|
+
createDepthFirstSteps?: CreateStepsOptions$1<Id>;
|
|
583
|
+
}): GraphAsyncTransform<Id, any, GraphNode<Id>[][]>;
|
|
584
|
+
/**
|
|
585
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-async-tree)
|
|
586
|
+
*/
|
|
587
|
+
declare function createTree<Id extends string>(options?: {
|
|
588
|
+
createDepthFirstSteps?: CreateStepsOptions$1<Id>;
|
|
589
|
+
}): GraphAsyncTransform<Id, any, GraphTree<Id>>;
|
|
590
|
+
/**
|
|
591
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-async-depth-first-steps)
|
|
592
|
+
*/
|
|
593
|
+
declare function createDepthFirstSteps<Id extends string, StateValue = number>(options?: CreateDepthFirstStepsOptions<Id, StateValue>): GraphAsyncGeneratorAsyncTransform<Id, StateValue, GraphStep<Id, StateValue>>;
|
|
594
|
+
|
|
595
|
+
type GraphAsyncNodeGeneratorAsyncTransform<Id extends string, Yielded> = GeneratorAsyncTransform<GraphNode<Id>, Yielded>;
|
|
596
|
+
type GraphAsyncNodeTupleTransform<Id extends string, Transformed> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => Promise<Transformed>;
|
|
597
|
+
type GraphNodeTupleGeneratorAsyncTransform<Id extends string, Yielded> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => AsyncGenerator<Yielded>;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-common-ancestors)
|
|
601
|
+
*/
|
|
602
|
+
declare function createCommonAncestors<Id extends string, Metadata>(directedAcyclicAsync: GraphAsync<Id, Metadata>): GraphNodeTupleGeneratorAsyncTransform<Id, GraphCommonAncestor<Id>>;
|
|
603
|
+
/**
|
|
604
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/Ancestor)
|
|
605
|
+
*/
|
|
606
|
+
declare function createAncestor<Id extends string, Metadata>(directedAcyclicAsync: GraphAsync<Id, Metadata>): GraphAsyncNodeTupleTransform<Id, boolean>;
|
|
607
|
+
/**
|
|
608
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/NodeDepthFirstSteps)
|
|
609
|
+
*/
|
|
610
|
+
declare function createNodeDepthFirstSteps<Id extends string, Metadata>(directedAcyclicAsync: GraphAsync<Id, Metadata>, options?: {
|
|
611
|
+
createDepthFirstSteps?: CreateDepthFirstStepsOptions<Id, Metadata>;
|
|
612
|
+
}): GraphAsyncNodeGeneratorAsyncTransform<Id, GraphStep<Id, Metadata>>;
|
|
613
|
+
|
|
614
|
+
type GraphAsyncStateTransform<Id extends string, Metadata, Transformed> = (state: GraphState<Id, Metadata>) => Promise<Transformed>;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/directed-acyclic-async-path)
|
|
618
|
+
*/
|
|
619
|
+
declare function createPath<Id extends string, Metadata>(directedAcyclicAsync: GraphAsync<Id, Metadata>, config: CreatePathConfig<Id, Metadata>): GraphAsyncStateTransform<Id, Metadata, GraphPath<Id>>;
|
|
620
|
+
|
|
621
|
+
type ElementTransform<El extends HTMLElement, Transformed> = (element: El) => Transformed;
|
|
622
|
+
type CreateFocusableOptions = {
|
|
623
|
+
predicatesElement?: boolean;
|
|
624
|
+
tabbableSelector?: string;
|
|
625
|
+
};
|
|
626
|
+
/**
|
|
627
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/focusable)
|
|
628
|
+
*/
|
|
629
|
+
declare function createFocusable(order: 'first' | 'last', options?: CreateFocusableOptions): ElementTransform<HTMLElement, HTMLElement | undefined>;
|
|
630
|
+
/**
|
|
631
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/computed-style)
|
|
632
|
+
*/
|
|
633
|
+
declare function createComputedStyle(pseudoElement?: string): ElementTransform<HTMLElement, CSSStyleDeclaration>;
|
|
634
|
+
|
|
635
|
+
type GraphTreeTransform<Id extends string, Transformed> = (tree: GraphTree<Id>) => Transformed;
|
|
636
|
+
/**
|
|
637
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/find)
|
|
638
|
+
*/
|
|
639
|
+
declare function createFind<Id extends string>(node: GraphNode<Id>): GraphTreeTransform<Id, GraphTreeNode<Id>>;
|
|
640
|
+
|
|
641
|
+
type KeyboardEventTransform<Transformed> = (keyboardEvent: KeyboardEvent) => Transformed;
|
|
642
|
+
type CreateKeycomboMatchOptions = Omit<CreateKeycomboMatchOptions$1, 'toAliases'> & {
|
|
643
|
+
toAliases?: (descriptor: KeyboardEventDescriptor) => string[];
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/keycombo-match)
|
|
647
|
+
*/
|
|
648
|
+
declare const createKeycomboMatch: (keycombo: string, options?: CreateKeycomboMatchOptions) => KeyboardEventTransform<boolean>;
|
|
649
|
+
|
|
650
|
+
type NumberTransform<Transformed> = (number: number) => Transformed;
|
|
651
|
+
/**
|
|
652
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/clamp)
|
|
653
|
+
*/
|
|
654
|
+
declare function createClamp(min: number, max: number): NumberTransform<number>;
|
|
655
|
+
type Potentiality<Outcome> = {
|
|
656
|
+
outcome: Outcome;
|
|
657
|
+
probability: number;
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/determine)
|
|
661
|
+
*/
|
|
662
|
+
declare function createDetermine<Outcome>(potentialities: Potentiality<Outcome>[]): NumberTransform<Outcome>;
|
|
663
|
+
/**
|
|
664
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/greater)
|
|
665
|
+
*/
|
|
666
|
+
declare function createGreater(threshold: number): NumberTransform<boolean>;
|
|
667
|
+
/**
|
|
668
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/greater-or-equal)
|
|
669
|
+
*/
|
|
670
|
+
declare function createGreaterOrEqual(threshold: number): NumberTransform<boolean>;
|
|
671
|
+
/**
|
|
672
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/less-or-equal)
|
|
673
|
+
*/
|
|
674
|
+
declare function createLessOrEqual(threshold: number): NumberTransform<boolean>;
|
|
675
|
+
/**
|
|
676
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/less)
|
|
677
|
+
*/
|
|
678
|
+
declare function createLess(threshold: number): NumberTransform<boolean>;
|
|
679
|
+
|
|
680
|
+
type ObjectTransform<Type extends Record<any, any>, Transformed> = (transform: Type) => Transformed;
|
|
681
|
+
type ValueOf<Type> = Type[keyof Type];
|
|
682
|
+
/**
|
|
683
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/value)
|
|
684
|
+
*/
|
|
685
|
+
declare function createValue<Type extends Record<any, any>>(key: keyof Type): ObjectTransform<Type, ValueOf<Type>>;
|
|
686
|
+
/**
|
|
687
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/has)
|
|
688
|
+
*/
|
|
689
|
+
declare function createHas<Type extends Record<any, any>>(key: keyof Type): ObjectTransform<Type, boolean>;
|
|
690
|
+
/**
|
|
691
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/keys)
|
|
692
|
+
*/
|
|
693
|
+
declare function createKeys<Type extends Record<any, any>>(): ObjectTransform<Type, (keyof Type)[]>;
|
|
694
|
+
/**
|
|
695
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/entries)
|
|
696
|
+
*/
|
|
697
|
+
declare function createEntries<Type extends Record<any, any>>(): ObjectTransform<Type, [keyof Type, ValueOf<Type>][]>;
|
|
698
|
+
/**
|
|
699
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/every)
|
|
700
|
+
*/
|
|
701
|
+
declare function createEvery<Type extends Record<any, any>>(predicate: (key: keyof Type, value: ValueOf<Type>) => unknown): ObjectTransform<Type, boolean>;
|
|
702
|
+
/**
|
|
703
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/some)
|
|
704
|
+
*/
|
|
705
|
+
declare function createSome<Type extends Record<any, any>>(predicate: (key: keyof Type, value: ValueOf<Type>) => unknown): ObjectTransform<Type, boolean>;
|
|
706
|
+
/**
|
|
707
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/deep-merge)
|
|
708
|
+
*/
|
|
709
|
+
declare function createDeepMerge<Type extends Record<any, any>>(override?: Type): ObjectTransform<Type, Type>;
|
|
710
|
+
|
|
711
|
+
type StringTransform<Transformed> = (string: string) => Transformed;
|
|
712
|
+
/**
|
|
713
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/clip)
|
|
714
|
+
*/
|
|
715
|
+
declare function createClip(content: string | RegExp): StringTransform<string>;
|
|
716
|
+
/**
|
|
717
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/slug)
|
|
718
|
+
*/
|
|
719
|
+
declare function createSlug(options?: Options): StringTransform<string>;
|
|
720
|
+
/**
|
|
721
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/sanitize)
|
|
722
|
+
*/
|
|
723
|
+
declare function createSanitize(options?: Config): StringTransform<string>;
|
|
724
|
+
/**
|
|
725
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/number)
|
|
726
|
+
*/
|
|
727
|
+
declare function createNumber(options?: {
|
|
728
|
+
radix?: number;
|
|
729
|
+
}): StringTransform<number>;
|
|
730
|
+
type CreateResultsOptions<Candidate extends string | object, MatchData extends boolean> = Omit<FullOptions<Candidate>, 'returnMatchData'> & {
|
|
731
|
+
returnMatchData?: MatchData;
|
|
732
|
+
};
|
|
733
|
+
declare function createResults<Candidate extends string | object, MatchData extends boolean = false>(candidates: Candidate[], options?: (CreateResultsOptions<Candidate, MatchData> | ((api: {
|
|
734
|
+
sortKind: typeof sortKind;
|
|
735
|
+
}) => CreateResultsOptions<Candidate, MatchData>))): StringTransform<MatchData extends true ? MatchData<Candidate>[] : Candidate[]>;
|
|
736
|
+
|
|
737
|
+
type ToGraphYielded = {
|
|
738
|
+
node: GraphNode<string>;
|
|
739
|
+
edge: PartialGraphEdge | undefined;
|
|
740
|
+
};
|
|
741
|
+
type PartialGraphEdge = Omit<GraphEdge<string, unknown>, 'predicateShouldTraverse'>;
|
|
742
|
+
type CreateGraphOptions<TreeNode> = {
|
|
743
|
+
toId?: (node: TreeNode) => string;
|
|
744
|
+
toChildren?: (node: TreeNode) => TreeNode[];
|
|
745
|
+
};
|
|
746
|
+
/**
|
|
747
|
+
* [Docs](https://baleada.dev/docs/logic/pipes/graph)
|
|
748
|
+
*/
|
|
749
|
+
declare function createGraph<TreeNode>(options?: CreateGraphOptions<TreeNode>): GeneratorTransform<TreeNode[], ToGraphYielded>;
|
|
750
|
+
|
|
751
|
+
type AnimateableKeyframe<Value extends string | number | any[]> = {
|
|
752
|
+
progress: number;
|
|
753
|
+
properties: {
|
|
754
|
+
[key: string]: AnimateableValue<Value>;
|
|
755
|
+
};
|
|
756
|
+
timing?: AnimateableTiming;
|
|
757
|
+
};
|
|
758
|
+
type AnimateableValue<Value extends string | number | any[]> = Value extends `${string} ${number}%` ? never : (Value | number | any[]);
|
|
759
|
+
type AnimateableOptions = {
|
|
760
|
+
duration?: number;
|
|
761
|
+
timing?: AnimateableTiming;
|
|
762
|
+
iterations?: number | true;
|
|
763
|
+
alternates?: boolean;
|
|
764
|
+
};
|
|
765
|
+
type AnimateableTiming = [number, number, number, number];
|
|
766
|
+
type AnimateFrameEffect = (frame?: AnimateFrame) => any;
|
|
767
|
+
type AnimateFrame = {
|
|
768
|
+
properties: {
|
|
769
|
+
[key: string]: {
|
|
770
|
+
progress: {
|
|
771
|
+
time: number;
|
|
772
|
+
animation: number;
|
|
773
|
+
};
|
|
774
|
+
interpolated: number | string | any[];
|
|
775
|
+
};
|
|
776
|
+
};
|
|
777
|
+
timestamp: number;
|
|
778
|
+
};
|
|
779
|
+
type AnimateOptions = {
|
|
780
|
+
interpolate?: {
|
|
781
|
+
color?: CreateMixOptions;
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
type AnimateableStatus = 'ready' | 'playing' | 'played' | 'reversing' | 'reversed' | 'paused' | 'sought' | 'stopped';
|
|
785
|
+
/**
|
|
786
|
+
* [Docs](https://baleada.dev/docs/logic/classes/animateable)
|
|
787
|
+
*/
|
|
788
|
+
declare class Animateable<Value extends string | number | any[]> {
|
|
789
|
+
private initialDuration;
|
|
790
|
+
private iterationLimit;
|
|
791
|
+
private alternates;
|
|
792
|
+
private controlPoints;
|
|
793
|
+
private reversedControlPoints;
|
|
794
|
+
private toAnimationProgress;
|
|
795
|
+
private reversedToAnimationProgress;
|
|
796
|
+
private playCache;
|
|
797
|
+
private reverseCache;
|
|
798
|
+
private pauseCache;
|
|
799
|
+
private seekCache;
|
|
800
|
+
private alternateCache;
|
|
801
|
+
private visibilitychange;
|
|
802
|
+
private getEaseables;
|
|
803
|
+
private getReversedEaseables;
|
|
804
|
+
constructor(keyframes: AnimateableKeyframe<Value>[], options?: AnimateableOptions);
|
|
805
|
+
private computedStatus;
|
|
806
|
+
private ready;
|
|
807
|
+
private computedTime;
|
|
808
|
+
private resetTime;
|
|
809
|
+
private computedProgress;
|
|
810
|
+
private resetProgress;
|
|
811
|
+
private computedIterations;
|
|
812
|
+
private resetIterations;
|
|
813
|
+
get keyframes(): AnimateableKeyframe<Value>[];
|
|
814
|
+
set keyframes(keyframes: AnimateableKeyframe<Value>[]);
|
|
815
|
+
get playbackRate(): number;
|
|
816
|
+
set playbackRate(playbackRate: number);
|
|
817
|
+
get status(): AnimateableStatus;
|
|
818
|
+
get iterations(): number;
|
|
819
|
+
get request(): number;
|
|
820
|
+
get time(): {
|
|
821
|
+
elapsed: number;
|
|
822
|
+
remaining: number;
|
|
823
|
+
};
|
|
824
|
+
get progress(): {
|
|
825
|
+
time: number;
|
|
826
|
+
animation: number;
|
|
827
|
+
};
|
|
828
|
+
private computedKeyframes;
|
|
829
|
+
private reversedKeyframes;
|
|
830
|
+
private properties;
|
|
831
|
+
private easeables;
|
|
832
|
+
private reversedEaseables;
|
|
833
|
+
setKeyframes(keyframes: AnimateableKeyframe<Value>[]): this;
|
|
834
|
+
private computedPlaybackRate;
|
|
835
|
+
private duration;
|
|
836
|
+
private totalTimeInvisible;
|
|
837
|
+
setPlaybackRate(playbackRate: number): this;
|
|
838
|
+
play(effect: AnimateFrameEffect, options?: AnimateOptions): this;
|
|
839
|
+
private playing;
|
|
840
|
+
private played;
|
|
841
|
+
reverse(effect: AnimateFrameEffect, options?: AnimateOptions): this;
|
|
842
|
+
private reversing;
|
|
843
|
+
private reversed;
|
|
844
|
+
private invisibleAt;
|
|
845
|
+
private listenForVisibilitychange;
|
|
846
|
+
private computedRequest;
|
|
847
|
+
private createAnimate;
|
|
848
|
+
private startTime;
|
|
849
|
+
private setStartTimeAndStatus;
|
|
850
|
+
private getToAnimationProgress;
|
|
851
|
+
private getFrame;
|
|
852
|
+
private recurse;
|
|
853
|
+
pause(): this;
|
|
854
|
+
private paused;
|
|
855
|
+
private cancelAnimate;
|
|
856
|
+
seek(timeProgress: number, options?: {
|
|
857
|
+
effect?: AnimateFrameEffect;
|
|
858
|
+
} & AnimateOptions): this;
|
|
859
|
+
private sought;
|
|
860
|
+
restart(): this;
|
|
861
|
+
stop(): this;
|
|
289
862
|
private stopped;
|
|
290
863
|
}
|
|
864
|
+
declare const linear: AnimateableKeyframe<any>['timing'];
|
|
865
|
+
declare const materialStandard: AnimateableKeyframe<any>['timing'];
|
|
866
|
+
declare const materialDecelerated: AnimateableKeyframe<any>['timing'];
|
|
867
|
+
declare const materialAccelerated: AnimateableKeyframe<any>['timing'];
|
|
868
|
+
declare const verouEase: AnimateableKeyframe<any>['timing'];
|
|
869
|
+
declare const verouEaseIn: AnimateableKeyframe<any>['timing'];
|
|
870
|
+
declare const verouEaseOut: AnimateableKeyframe<any>['timing'];
|
|
871
|
+
declare const verouEaseInOut: AnimateableKeyframe<any>['timing'];
|
|
872
|
+
declare const easingsNetInSine: AnimateableKeyframe<any>['timing'];
|
|
873
|
+
declare const easingsNetOutSine: AnimateableKeyframe<any>['timing'];
|
|
874
|
+
declare const easingsNetInOutSine: AnimateableKeyframe<any>['timing'];
|
|
875
|
+
declare const easingsNetInQuad: AnimateableKeyframe<any>['timing'];
|
|
876
|
+
declare const easingsNetOutQuad: AnimateableKeyframe<any>['timing'];
|
|
877
|
+
declare const easingsNetInOutQuad: AnimateableKeyframe<any>['timing'];
|
|
878
|
+
declare const easingsNetInCubic: AnimateableKeyframe<any>['timing'];
|
|
879
|
+
declare const easingsNetOutCubic: AnimateableKeyframe<any>['timing'];
|
|
880
|
+
declare const easingsNetInOutCubic: AnimateableKeyframe<any>['timing'];
|
|
881
|
+
declare const easingsNetInQuart: AnimateableKeyframe<any>['timing'];
|
|
882
|
+
declare const easingsNetInQuint: AnimateableKeyframe<any>['timing'];
|
|
883
|
+
declare const easingsNetOutQuint: AnimateableKeyframe<any>['timing'];
|
|
884
|
+
declare const easingsNetInOutQuint: AnimateableKeyframe<any>['timing'];
|
|
885
|
+
declare const easingsNetInExpo: AnimateableKeyframe<any>['timing'];
|
|
886
|
+
declare const easingsNetOutExpo: AnimateableKeyframe<any>['timing'];
|
|
887
|
+
declare const easingsNetInOutExpo: AnimateableKeyframe<any>['timing'];
|
|
888
|
+
declare const easingsNetInCirc: AnimateableKeyframe<any>['timing'];
|
|
889
|
+
declare const easingsNetOutCirc: AnimateableKeyframe<any>['timing'];
|
|
890
|
+
declare const easingsNetInOutCirc: AnimateableKeyframe<any>['timing'];
|
|
891
|
+
declare const easingsNetInBack: AnimateableKeyframe<any>['timing'];
|
|
892
|
+
declare const easingsNetOutBack: AnimateableKeyframe<any>['timing'];
|
|
893
|
+
declare const easingsNetInOutBack: AnimateableKeyframe<any>['timing'];
|
|
291
894
|
|
|
292
895
|
type BroadcastableOptions = {
|
|
293
896
|
name?: string;
|
|
294
897
|
};
|
|
295
898
|
type BroadcastableStatus = 'ready' | 'broadcasting' | 'broadcasted' | 'errored' | 'stopped';
|
|
899
|
+
/**
|
|
900
|
+
* [Docs](https://baleada.dev/docs/logic/classes/broadcastable)
|
|
901
|
+
*/
|
|
296
902
|
declare class Broadcastable<State> {
|
|
297
903
|
private name;
|
|
298
904
|
constructor(state: State, options?: BroadcastableOptions);
|
|
@@ -359,6 +965,9 @@ type CompleteOptions = {
|
|
|
359
965
|
after: string;
|
|
360
966
|
}) => Completeable['selection']);
|
|
361
967
|
};
|
|
968
|
+
/**
|
|
969
|
+
* [Docs](https://baleada.dev/docs/logic/classes/completeable)
|
|
970
|
+
*/
|
|
362
971
|
declare class Completeable {
|
|
363
972
|
private segmentFrom;
|
|
364
973
|
private segmentTo;
|
|
@@ -408,6 +1017,9 @@ declare class Completeable {
|
|
|
408
1017
|
|
|
409
1018
|
type CopyableOptions = Record<never, never>;
|
|
410
1019
|
type CopyableStatus = 'ready' | 'copying' | 'copied' | 'errored';
|
|
1020
|
+
/**
|
|
1021
|
+
* [Docs](https://baleada.dev/docs/logic/classes/copyable)
|
|
1022
|
+
*/
|
|
411
1023
|
declare class Copyable {
|
|
412
1024
|
private computedIsClipboardText;
|
|
413
1025
|
private copyListenable;
|
|
@@ -442,6 +1054,9 @@ type DelayableOptions = {
|
|
|
442
1054
|
};
|
|
443
1055
|
type DelayableEffect = (timestamp: number) => any;
|
|
444
1056
|
type DelayableStatus = 'ready' | 'delaying' | 'delayed' | 'paused' | 'sought' | 'stopped';
|
|
1057
|
+
/**
|
|
1058
|
+
* [Docs](https://baleada.dev/docs/logic/classes/delayable)
|
|
1059
|
+
*/
|
|
445
1060
|
declare class Delayable {
|
|
446
1061
|
private animateable;
|
|
447
1062
|
constructor(effect: DelayableEffect, options?: DelayableOptions);
|
|
@@ -472,15 +1087,18 @@ declare class Delayable {
|
|
|
472
1087
|
private stopped;
|
|
473
1088
|
}
|
|
474
1089
|
|
|
475
|
-
type
|
|
1090
|
+
type DrawableStroke = ReturnType<typeof getStroke>;
|
|
476
1091
|
type DrawableOptions = {
|
|
477
|
-
toD?: (stroke:
|
|
1092
|
+
toD?: (stroke: DrawableStroke) => string;
|
|
478
1093
|
};
|
|
479
1094
|
type DrawableStatus = 'ready' | 'drawing' | 'drawn';
|
|
1095
|
+
/**
|
|
1096
|
+
* [Docs](https://baleada.dev/docs/logic/classes/drawable)
|
|
1097
|
+
*/
|
|
480
1098
|
declare class Drawable {
|
|
481
1099
|
private computedD;
|
|
482
1100
|
private toD;
|
|
483
|
-
constructor(stroke:
|
|
1101
|
+
constructor(stroke: DrawableStroke, options?: DrawableOptions);
|
|
484
1102
|
computedStatus: DrawableStatus;
|
|
485
1103
|
private ready;
|
|
486
1104
|
get stroke(): number[][];
|
|
@@ -488,7 +1106,7 @@ declare class Drawable {
|
|
|
488
1106
|
get status(): DrawableStatus;
|
|
489
1107
|
get d(): string;
|
|
490
1108
|
private computedStroke;
|
|
491
|
-
setStroke(stroke:
|
|
1109
|
+
setStroke(stroke: DrawableStroke): this;
|
|
492
1110
|
draw(points: Parameters<typeof getStroke>[0], options?: StrokeOptions): this;
|
|
493
1111
|
private drawing;
|
|
494
1112
|
private drawn;
|
|
@@ -497,32 +1115,41 @@ declare function toD(stroke: number[][]): string;
|
|
|
497
1115
|
declare function toFlattenedD(stroke: number[][]): string;
|
|
498
1116
|
|
|
499
1117
|
type ResolveableOptions = Record<never, never>;
|
|
500
|
-
type ResolveableGetPromise<Value> = (...args: any[]) => (Promise<Value> | Promise<Value>[]);
|
|
501
1118
|
type ResolveableStatus = 'ready' | 'resolving' | 'resolved' | 'errored';
|
|
1119
|
+
/**
|
|
1120
|
+
* [Docs](https://baleada.dev/docs/logic/classes/resolveable)
|
|
1121
|
+
*/
|
|
502
1122
|
declare class Resolveable<Value> {
|
|
503
|
-
constructor(getPromise:
|
|
1123
|
+
constructor(getPromise: () => Promise<Value>, options?: ResolveableOptions);
|
|
504
1124
|
private computedStatus;
|
|
505
1125
|
private ready;
|
|
506
|
-
get getPromise(): (
|
|
507
|
-
set getPromise(getPromise: (
|
|
1126
|
+
get getPromise(): () => Promise<Value>;
|
|
1127
|
+
set getPromise(getPromise: () => Promise<Value>);
|
|
508
1128
|
get status(): ResolveableStatus;
|
|
509
|
-
get value():
|
|
1129
|
+
get value(): Value;
|
|
1130
|
+
get error(): Error;
|
|
510
1131
|
private computedGetPromise;
|
|
511
|
-
setGetPromise(getPromise: (
|
|
1132
|
+
setGetPromise(getPromise: () => Promise<Value>): this;
|
|
512
1133
|
private computedValue;
|
|
513
|
-
|
|
1134
|
+
private computedError;
|
|
1135
|
+
resolve(): Promise<this>;
|
|
514
1136
|
private resolving;
|
|
515
1137
|
private resolved;
|
|
516
1138
|
private errored;
|
|
517
1139
|
}
|
|
518
1140
|
|
|
519
1141
|
type FetchableOptions = {
|
|
520
|
-
ky?: Options | ((api: ToKyOptionsApi) => Options);
|
|
1142
|
+
ky?: Options$1 | ((api: ToKyOptionsApi) => Options$1);
|
|
521
1143
|
};
|
|
522
1144
|
type ToKyOptionsApi = {
|
|
523
1145
|
stop: typeof ky['stop'];
|
|
524
1146
|
};
|
|
525
1147
|
type FetchableStatus = 'ready' | 'fetching' | 'fetched' | 'retrying' | 'aborted' | 'errored';
|
|
1148
|
+
type FetchOptions = Omit<Options$1, 'signal'>;
|
|
1149
|
+
type FetchMethodOptions = Omit<FetchOptions, 'method'>;
|
|
1150
|
+
/**
|
|
1151
|
+
* [Docs](https://baleada.dev/docs/logic/classes/fetchable)
|
|
1152
|
+
*/
|
|
526
1153
|
declare class Fetchable {
|
|
527
1154
|
private computedArrayBuffer;
|
|
528
1155
|
private computedBlob;
|
|
@@ -534,14 +1161,14 @@ declare class Fetchable {
|
|
|
534
1161
|
private ready;
|
|
535
1162
|
get resource(): string;
|
|
536
1163
|
set resource(resource: string);
|
|
1164
|
+
get status(): FetchableStatus;
|
|
537
1165
|
private computedKy;
|
|
538
1166
|
get ky(): ky_distribution_types_ky.KyInstance;
|
|
539
1167
|
private computedAbortController;
|
|
540
1168
|
get abortController(): AbortController;
|
|
541
|
-
get status(): FetchableStatus;
|
|
542
|
-
get response(): Response;
|
|
543
1169
|
private computedRetryCount;
|
|
544
1170
|
get retryCount(): number;
|
|
1171
|
+
get response(): Response;
|
|
545
1172
|
get error(): Error;
|
|
546
1173
|
get arrayBuffer(): Resolveable<ArrayBuffer>;
|
|
547
1174
|
get blob(): Resolveable<Blob>;
|
|
@@ -552,24 +1179,27 @@ declare class Fetchable {
|
|
|
552
1179
|
setResource(resource: string): this;
|
|
553
1180
|
private computedResponse;
|
|
554
1181
|
private computedError;
|
|
555
|
-
fetch(options?:
|
|
1182
|
+
fetch(options?: FetchOptions): Promise<this>;
|
|
556
1183
|
private fetching;
|
|
557
1184
|
private retrying;
|
|
558
1185
|
private fetched;
|
|
559
1186
|
private aborted;
|
|
560
1187
|
private errored;
|
|
561
|
-
get(options?:
|
|
562
|
-
patch(options?:
|
|
563
|
-
post(options?:
|
|
564
|
-
put(options?:
|
|
565
|
-
delete(options?:
|
|
566
|
-
head(options?:
|
|
1188
|
+
get(options?: FetchMethodOptions): Promise<this>;
|
|
1189
|
+
patch(options?: FetchMethodOptions): Promise<this>;
|
|
1190
|
+
post(options?: FetchMethodOptions): Promise<this>;
|
|
1191
|
+
put(options?: FetchMethodOptions): Promise<this>;
|
|
1192
|
+
delete(options?: FetchMethodOptions): Promise<this>;
|
|
1193
|
+
head(options?: FetchMethodOptions): Promise<this>;
|
|
567
1194
|
abort(): this;
|
|
568
1195
|
}
|
|
569
1196
|
|
|
570
1197
|
type FullscreenableOptions = Record<never, never>;
|
|
571
1198
|
type FullscreenableGetElement<ElementType> = ((...args: any[]) => ElementType);
|
|
572
1199
|
type FullscreenableStatus = 'ready' | 'fullscreened' | 'errored' | 'exited';
|
|
1200
|
+
/**
|
|
1201
|
+
* [Docs](https://baleada.dev/docs/logic/classes/fullscreenable)
|
|
1202
|
+
*/
|
|
573
1203
|
declare class Fullscreenable<ElementType extends Element> {
|
|
574
1204
|
constructor(getElement: FullscreenableGetElement<ElementType>, options?: FullscreenableOptions);
|
|
575
1205
|
private computedStatus;
|
|
@@ -591,21 +1221,26 @@ declare class Fullscreenable<ElementType extends Element> {
|
|
|
591
1221
|
}
|
|
592
1222
|
|
|
593
1223
|
type GrantableOptions = Record<never, never>;
|
|
594
|
-
type GrantableStatus = 'ready' | '
|
|
595
|
-
|
|
596
|
-
|
|
1224
|
+
type GrantableStatus = 'ready' | 'granting' | 'granted' | 'errored';
|
|
1225
|
+
/**
|
|
1226
|
+
* [Docs](https://baleada.dev/docs/logic/classes/grantable)
|
|
1227
|
+
*/
|
|
1228
|
+
declare class Grantable {
|
|
1229
|
+
constructor(descriptor: PermissionDescriptor, options?: GrantableOptions);
|
|
597
1230
|
private computedStatus;
|
|
598
1231
|
private ready;
|
|
599
|
-
get descriptor():
|
|
600
|
-
set descriptor(descriptor:
|
|
601
|
-
get permission():
|
|
1232
|
+
get descriptor(): PermissionDescriptor;
|
|
1233
|
+
set descriptor(descriptor: PermissionDescriptor);
|
|
1234
|
+
get permission(): PermissionStatus;
|
|
1235
|
+
get error(): Error;
|
|
602
1236
|
get status(): GrantableStatus;
|
|
603
1237
|
private computedDescriptor;
|
|
604
|
-
setDescriptor(descriptor:
|
|
1238
|
+
setDescriptor(descriptor: PermissionDescriptor): this;
|
|
605
1239
|
private computedPermission;
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
private
|
|
1240
|
+
private computedError;
|
|
1241
|
+
grant(): Promise<this>;
|
|
1242
|
+
private granting;
|
|
1243
|
+
private granted;
|
|
609
1244
|
private errored;
|
|
610
1245
|
}
|
|
611
1246
|
|
|
@@ -620,6 +1255,9 @@ type NextAndPreviousOptions = {
|
|
|
620
1255
|
distance?: number;
|
|
621
1256
|
loops?: boolean;
|
|
622
1257
|
};
|
|
1258
|
+
/**
|
|
1259
|
+
* [Docs](https://baleada.dev/docs/logic/classes/navigateable)
|
|
1260
|
+
*/
|
|
623
1261
|
declare class Navigateable<Item> {
|
|
624
1262
|
constructor(array: Item[], options?: NavigateableOptions);
|
|
625
1263
|
private computedStatus;
|
|
@@ -657,6 +1295,9 @@ type PickOptions = {
|
|
|
657
1295
|
replace?: 'none' | 'all' | 'fifo' | 'lifo';
|
|
658
1296
|
allowsDuplicates?: boolean;
|
|
659
1297
|
};
|
|
1298
|
+
/**
|
|
1299
|
+
* [Docs](https://baleada.dev/docs/logic/classes/pickable)
|
|
1300
|
+
*/
|
|
660
1301
|
declare class Pickable<Item> {
|
|
661
1302
|
constructor(array: Item[], options?: PickableOptions);
|
|
662
1303
|
private computedStatus;
|
|
@@ -673,11 +1314,11 @@ declare class Pickable<Item> {
|
|
|
673
1314
|
get last(): number;
|
|
674
1315
|
get oldest(): number;
|
|
675
1316
|
get newest(): number;
|
|
676
|
-
get status(): PickableStatus;
|
|
677
1317
|
get items(): Item[];
|
|
678
1318
|
private toItems;
|
|
679
1319
|
computedMultiple: boolean;
|
|
680
1320
|
get multiple(): boolean;
|
|
1321
|
+
get status(): PickableStatus;
|
|
681
1322
|
private toPossiblePicks;
|
|
682
1323
|
setArray(array: Item[]): this;
|
|
683
1324
|
setPicks(indexOrIndices: number | number[]): this;
|
|
@@ -689,59 +1330,24 @@ declare class Pickable<Item> {
|
|
|
689
1330
|
private omitted;
|
|
690
1331
|
}
|
|
691
1332
|
|
|
692
|
-
type SanitizeableOptions = Config;
|
|
693
|
-
type SanitizeableStatus = 'ready' | 'sanitized';
|
|
694
|
-
declare class Sanitizeable {
|
|
695
|
-
private domPurifyConfig;
|
|
696
|
-
constructor(html: string, options?: Config);
|
|
697
|
-
private computedDompurify;
|
|
698
|
-
private computedStatus;
|
|
699
|
-
private ready;
|
|
700
|
-
get html(): string;
|
|
701
|
-
set html(html: string);
|
|
702
|
-
get dompurify(): DOMPurifyI;
|
|
703
|
-
get status(): SanitizeableStatus;
|
|
704
|
-
private computedHtml;
|
|
705
|
-
setHtml(html: string): this;
|
|
706
|
-
sanitize(): this;
|
|
707
|
-
private sanitized;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
type SearchableOptions<Item> = FullOptions<Item>;
|
|
711
|
-
type SearchableStatus = 'ready' | 'searched';
|
|
712
|
-
declare class Searchable<Item extends string | object> {
|
|
713
|
-
private searcherOptions;
|
|
714
|
-
private computedResults;
|
|
715
|
-
constructor(candidates: Item[], options?: FullOptions<Item>);
|
|
716
|
-
private computedStatus;
|
|
717
|
-
private ready;
|
|
718
|
-
private computedCandidates;
|
|
719
|
-
get candidates(): Item[];
|
|
720
|
-
set candidates(candidates: Item[]);
|
|
721
|
-
get results(): MatchData<Item>[] | Item[];
|
|
722
|
-
get searcher(): Searcher<Item, FullOptions<Item>>;
|
|
723
|
-
get status(): SearchableStatus;
|
|
724
|
-
private computedSearcher;
|
|
725
|
-
setCandidates(candidates: Item[]): this;
|
|
726
|
-
search(query: string, options?: FullOptions<Item>): this;
|
|
727
|
-
private searched;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
1333
|
type ShareableOptions = Record<never, never>;
|
|
731
1334
|
type ShareableStatus = 'ready' | 'sharing' | 'shared' | 'errored';
|
|
1335
|
+
/**
|
|
1336
|
+
* [Docs](https://baleada.dev/docs/logic/classes/shareable)
|
|
1337
|
+
*/
|
|
732
1338
|
declare class Shareable {
|
|
733
|
-
constructor(
|
|
1339
|
+
constructor(shareData: ShareData, options?: ShareableOptions);
|
|
734
1340
|
private computedStatus;
|
|
735
1341
|
private ready;
|
|
736
|
-
get
|
|
737
|
-
set
|
|
1342
|
+
get shareData(): ShareData;
|
|
1343
|
+
set shareData(shareData: ShareData);
|
|
738
1344
|
get status(): ShareableStatus;
|
|
739
1345
|
private computedCan;
|
|
740
1346
|
get can(): Resolveable<boolean>;
|
|
741
1347
|
private computedError;
|
|
742
1348
|
get error(): Error;
|
|
743
1349
|
private computedState;
|
|
744
|
-
|
|
1350
|
+
setShareData(shareData: ShareData): this;
|
|
745
1351
|
share(): Promise<this>;
|
|
746
1352
|
private sharing;
|
|
747
1353
|
private shared;
|
|
@@ -753,6 +1359,9 @@ type StoreableOptions = {
|
|
|
753
1359
|
statusKeySuffix?: string;
|
|
754
1360
|
};
|
|
755
1361
|
type StoreableStatus = 'ready' | 'constructing' | 'stored' | 'errored' | 'removed';
|
|
1362
|
+
/**
|
|
1363
|
+
* [Docs](https://baleada.dev/docs/logic/classes/storeable)
|
|
1364
|
+
*/
|
|
756
1365
|
declare class Storeable<String extends string> {
|
|
757
1366
|
private kind;
|
|
758
1367
|
private statusKeySuffix;
|
|
@@ -780,101 +1389,37 @@ declare class Storeable<String extends string> {
|
|
|
780
1389
|
removeStatus(): this;
|
|
781
1390
|
}
|
|
782
1391
|
|
|
783
|
-
type
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
declare function createConcat<Item>(...arrays: Item[][]): ArrayFn<Item, Item[]>;
|
|
789
|
-
declare function createFilter<Item>(predicate: (item: Item, index: number) => boolean): ArrayFn<Item, Item[]>;
|
|
790
|
-
declare function createInsert<Item>(item: Item, index: number): ArrayFn<Item, Item[]>;
|
|
791
|
-
declare function createMap<Item, Transformed = Item>(transform: (item: Item, index: number) => Transformed): ArrayFn<Item, Transformed[]>;
|
|
792
|
-
declare function createReduce<Item, Accumulator>(accumulate: (accumulator: Accumulator, item: Item, index: number) => Accumulator, initialValue?: Accumulator): (array: Item[]) => Accumulator;
|
|
793
|
-
declare function createRemove<Item>(index: number): ArrayFn<Item, Item[]>;
|
|
794
|
-
declare function createReorder<Item>(from: {
|
|
795
|
-
start: number;
|
|
796
|
-
itemCount: number;
|
|
797
|
-
} | number, to: number): ArrayFn<Item, Item[]>;
|
|
798
|
-
declare function createReplace<Item>(index: number, replacement: Item): ArrayFn<Item, Item[]>;
|
|
799
|
-
declare function createReverse<Item>(): ArrayFn<Item, Item[]>;
|
|
800
|
-
declare function createSlice<Item>(from: number, to?: number): ArrayFn<Item, Item[]>;
|
|
801
|
-
declare function createSort<Item>(compare?: (itemA: Item, itemB: Item) => number): ArrayFn<Item, Item[]>;
|
|
802
|
-
declare function createSwap<Item>(indices: [number, number]): ArrayFn<Item, Item[]>;
|
|
803
|
-
declare function createUnique<Item>(): ArrayFn<Item, Item[]>;
|
|
804
|
-
|
|
805
|
-
type ArrayAsyncFn<Item, Returned> = (array: Item[]) => Promise<Returned>;
|
|
806
|
-
declare function createFilterAsync<Item>(predicate: (item: Item, index: number) => Promise<boolean>): ArrayAsyncFn<Item, Item[]>;
|
|
807
|
-
declare function createFindAsync<Item>(predicate: (item: Item, index: number) => Promise<boolean>): ArrayAsyncFn<Item, Item | undefined>;
|
|
808
|
-
declare function createFindIndexAsync<Item>(predicate: (item: Item, index: number) => Promise<boolean>): ArrayAsyncFn<Item, number>;
|
|
809
|
-
declare function createForEachAsync<Item>(forEach: (item: Item, index: number) => any): ArrayAsyncFn<Item, any>;
|
|
810
|
-
declare function createMapAsync<Item, Mapped>(transform: (item: Item, index: number) => Promise<Mapped>): ArrayAsyncFn<Item, Mapped[]>;
|
|
811
|
-
declare function createReduceAsync<Item, Accumulator>(accumulate: (accumulator: Accumulator, item: Item, index: number) => Promise<Accumulator>, initialValue?: Accumulator): (array: Item[]) => Promise<Accumulator>;
|
|
812
|
-
|
|
813
|
-
type StringFn<Returned> = (string: string) => Returned;
|
|
814
|
-
declare function createClip(required: string | RegExp): StringFn<string>;
|
|
815
|
-
declare function createSlug(options?: Options$1): StringFn<string>;
|
|
816
|
-
|
|
817
|
-
type NumberFn<Returned> = (number: number) => Returned;
|
|
818
|
-
declare function createClamp(min: number, max: number): NumberFn<number>;
|
|
819
|
-
type Potentiality<Outcome> = {
|
|
820
|
-
outcome: Outcome;
|
|
821
|
-
probability: number;
|
|
822
|
-
};
|
|
823
|
-
declare function createDetermine<Outcome>(potentialities: Potentiality<Outcome>[]): NumberFn<Outcome>;
|
|
824
|
-
|
|
825
|
-
type ObjectFn<Key extends string | number | symbol, Value, Returned> = (transform: Record<Key, Value>) => Returned;
|
|
826
|
-
declare function createEntries<Key extends string | number | symbol, Value>(): ObjectFn<Key, Value, [Key, Value][]>;
|
|
827
|
-
declare function createKeys<Key extends string | number | symbol>(): ObjectFn<Key, any, Key[]>;
|
|
828
|
-
declare function createEvery<Key extends string | number | symbol, Value>(predicate: (key: Key, value: Value) => unknown): ObjectFn<Key, Value, boolean>;
|
|
829
|
-
declare function createSome<Key extends string | number | symbol, Value>(predicate: (key: Key, value: Value) => unknown): ObjectFn<Key, Value, boolean>;
|
|
1392
|
+
type ArrayAsyncEffect<Item> = (array: Item[]) => Promise<Item[]>;
|
|
1393
|
+
/**
|
|
1394
|
+
* [Docs](https://baleada.dev/docs/logic/links/for-each-async)
|
|
1395
|
+
*/
|
|
1396
|
+
declare function createForEachAsync<Item>(effect: (item: Item, index: number) => any): ArrayAsyncEffect<Item>;
|
|
830
1397
|
|
|
831
|
-
type
|
|
832
|
-
|
|
1398
|
+
type ObjectEffect<Key extends string | number | symbol, Value> = (object: Record<Key, Value>) => Record<Key, Value>;
|
|
1399
|
+
/**
|
|
1400
|
+
* [Docs](https://baleada.dev/docs/logic/links/set)
|
|
1401
|
+
*/
|
|
1402
|
+
declare function createSet<Key extends string | number | symbol, Value extends any>(key: Key, value: Value): ObjectEffect<Key, Value>;
|
|
1403
|
+
/**
|
|
1404
|
+
* [Docs](https://baleada.dev/docs/logic/links/delete)
|
|
1405
|
+
*/
|
|
1406
|
+
declare function createDelete<Key extends string | number | symbol, Value extends any>(key: Key): ObjectEffect<Key, Value>;
|
|
1407
|
+
/**
|
|
1408
|
+
* [Docs](https://baleada.dev/docs/logic/links/clear)
|
|
1409
|
+
*/
|
|
1410
|
+
declare function createClear<Key extends string | number | symbol, Value extends any>(): ObjectEffect<Key, Value>;
|
|
833
1411
|
|
|
834
|
-
|
|
835
|
-
type CreateFocusableOptions = {
|
|
836
|
-
elementIsCandidate?: boolean;
|
|
837
|
-
tabbableSelector?: string;
|
|
838
|
-
};
|
|
839
|
-
declare function createFocusable(order: 'first' | 'last', options?: CreateFocusableOptions): ElementFn<HTMLElement, HTMLElement | undefined>;
|
|
840
|
-
|
|
841
|
-
type AssociativeArrayEntries<Key, Value> = [Key, Value][];
|
|
842
|
-
declare function defineAssociativeArrayEntries<Key, Value>(entries: AssociativeArrayEntries<Key, Value>): AssociativeArrayEntries<Key, Value>;
|
|
1412
|
+
declare function createDepthPathConfig<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata> | GraphAsync<Id, Metadata>): CreatePathConfig<Id, Metadata>;
|
|
843
1413
|
|
|
844
|
-
|
|
845
|
-
toValue: (key: Key) => Value | undefined;
|
|
846
|
-
set: (key: Key, value: Value) => void;
|
|
847
|
-
predicateHas: (key: Key) => boolean;
|
|
848
|
-
clear: () => void;
|
|
849
|
-
delete: (key: Key) => boolean;
|
|
850
|
-
toKeys: () => Key[];
|
|
851
|
-
toValues: () => Value[];
|
|
852
|
-
toEntries: () => AssociativeArrayEntries<Key, Value>;
|
|
853
|
-
};
|
|
854
|
-
type AssociativeArrayOptions<Key extends any> = {
|
|
855
|
-
initial?: AssociativeArrayEntries<Key, any>;
|
|
856
|
-
createPredicateKey?: (query: Key) => (candidate: Key) => boolean;
|
|
857
|
-
};
|
|
858
|
-
declare function createAssociativeArray<Key extends any, Value extends any>(options?: AssociativeArrayOptions<Key>): {
|
|
859
|
-
toValue: (key: Key) => Value;
|
|
860
|
-
set: (key: Key, value: Value) => void;
|
|
861
|
-
predicateHas: (key: Key) => boolean;
|
|
862
|
-
clear: () => void;
|
|
863
|
-
delete: (key: Key) => boolean;
|
|
864
|
-
toKeys: () => Key[];
|
|
865
|
-
toValues: () => Value[];
|
|
866
|
-
toEntries: () => AssociativeArrayEntries<Key, Value>;
|
|
867
|
-
};
|
|
1414
|
+
declare function createBreadthPathConfig<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata> | GraphAsync<Id, Metadata>): CreatePathConfig<Id, Metadata>;
|
|
868
1415
|
|
|
869
1416
|
type KeypressType = 'keydown' | 'keyup' | 'visibilitychange';
|
|
870
1417
|
type KeypressMetadata = {
|
|
871
|
-
|
|
1418
|
+
keycombo: string;
|
|
872
1419
|
} & KeyboardTimeMetadata;
|
|
873
|
-
type KeypressOptions = {
|
|
1420
|
+
type KeypressOptions = CreateKeycomboMatchOptions$1 & {
|
|
874
1421
|
minDuration?: number;
|
|
875
1422
|
preventsDefaultUnlessDenied?: boolean;
|
|
876
|
-
toDownKeys?: CreatePredicateKeycomboDownOptions['toDownKeys'];
|
|
877
|
-
toAliases?: CreatePredicateKeycomboMatchOptions$1['toAliases'];
|
|
878
1423
|
onDown?: KeypressHook;
|
|
879
1424
|
onUp?: KeypressHook;
|
|
880
1425
|
onVisibilitychange?: KeypressHook;
|
|
@@ -886,16 +1431,18 @@ declare function createKeypress(keycomboOrKeycombos: string | string[], options?
|
|
|
886
1431
|
keyup: RecognizeableEffect<"keyup", KeypressMetadata>;
|
|
887
1432
|
visibilitychange: RecognizeableEffect<"visibilitychange", KeypressMetadata>;
|
|
888
1433
|
};
|
|
1434
|
+
declare class Keypress extends Listenable<KeypressType, KeypressMetadata> {
|
|
1435
|
+
constructor(keycomboOrKeycombos: string | string[], options?: KeypressOptions);
|
|
1436
|
+
get metadata(): KeypressMetadata;
|
|
1437
|
+
}
|
|
889
1438
|
|
|
890
1439
|
type KeyreleaseType = 'keydown' | 'keyup' | 'visibilitychange';
|
|
891
1440
|
type KeyreleaseMetadata = {
|
|
892
|
-
|
|
1441
|
+
keycombo: string;
|
|
893
1442
|
} & KeyboardTimeMetadata;
|
|
894
|
-
type KeyreleaseOptions = {
|
|
1443
|
+
type KeyreleaseOptions = CreateKeycomboMatchOptions$1 & {
|
|
895
1444
|
minDuration?: number;
|
|
896
1445
|
preventsDefaultUnlessDenied?: boolean;
|
|
897
|
-
toDownKeys?: CreatePredicateKeycomboDownOptions['toDownKeys'];
|
|
898
|
-
toAliases?: CreatePredicateKeycomboMatchOptions$1['toAliases'];
|
|
899
1446
|
onDown?: KeyreleaseHook;
|
|
900
1447
|
onUp?: KeyreleaseHook;
|
|
901
1448
|
onVisibilitychange?: KeyreleaseHook;
|
|
@@ -907,44 +1454,57 @@ declare function createKeyrelease(keycomboOrKeycombos: string | string[], option
|
|
|
907
1454
|
keyup: RecognizeableEffect<"keyup", KeyreleaseMetadata>;
|
|
908
1455
|
visibilitychange: RecognizeableEffect<"visibilitychange", KeyreleaseMetadata>;
|
|
909
1456
|
};
|
|
1457
|
+
declare class Keyrelease extends Listenable<KeyreleaseType, KeyreleaseMetadata> {
|
|
1458
|
+
constructor(keycomboOrKeycombos: string | string[], options?: KeyreleaseOptions);
|
|
1459
|
+
get metadata(): KeyreleaseMetadata;
|
|
1460
|
+
}
|
|
910
1461
|
|
|
911
1462
|
type KeychordType = 'keydown' | 'keyup' | 'visibilitychange';
|
|
912
1463
|
type KeychordMetadata = {
|
|
913
1464
|
played: ({
|
|
914
|
-
|
|
1465
|
+
keycombo: string;
|
|
915
1466
|
} & KeyboardTimeMetadata)[];
|
|
916
1467
|
};
|
|
917
|
-
type KeychordOptions = {
|
|
1468
|
+
type KeychordOptions = CreateKeycomboMatchOptions$1 & {
|
|
918
1469
|
minDuration?: number;
|
|
919
1470
|
maxInterval?: number;
|
|
920
1471
|
preventsDefaultUnlessDenied?: boolean;
|
|
921
|
-
toDownKeys?: CreatePredicateKeycomboDownOptions['toDownKeys'];
|
|
922
|
-
toAliases?: CreatePredicateKeycomboMatchOptions$1['toAliases'];
|
|
923
1472
|
onDown?: KeychordHook;
|
|
924
1473
|
onUp?: KeychordHook;
|
|
925
1474
|
onVisibilitychange?: KeychordHook;
|
|
926
1475
|
};
|
|
927
1476
|
type KeychordHook = (api: KeychordHookApi) => any;
|
|
928
1477
|
type KeychordHookApi = HookApi<KeychordType, KeychordMetadata>;
|
|
929
|
-
declare function createKeychord(
|
|
1478
|
+
declare function createKeychord(keycombos: string, options?: KeychordOptions): {
|
|
930
1479
|
keydown: RecognizeableEffect<"keydown", KeychordMetadata>;
|
|
931
1480
|
keyup: RecognizeableEffect<"keyup", KeychordMetadata>;
|
|
932
1481
|
visibilitychange: RecognizeableEffect<"visibilitychange", KeychordMetadata>;
|
|
933
1482
|
};
|
|
1483
|
+
declare class Keychord extends Listenable<KeychordType, KeychordMetadata> {
|
|
1484
|
+
constructor(keycombos: string, options?: KeychordOptions);
|
|
1485
|
+
get metadata(): KeychordMetadata;
|
|
1486
|
+
}
|
|
934
1487
|
|
|
935
1488
|
type KonamiType = KeychordType;
|
|
936
1489
|
type KonamiMetadata = KeychordMetadata;
|
|
937
1490
|
type KonamiOptions = KeychordOptions;
|
|
938
1491
|
type KonamiHook = KeychordHook;
|
|
939
1492
|
type KonamiHookApi = KeychordHookApi;
|
|
940
|
-
declare function createKonami(options?: KonamiOptions):
|
|
1493
|
+
declare function createKonami(options?: KonamiOptions): {
|
|
1494
|
+
keydown: RecognizeableEffect<"keydown", KeychordMetadata>;
|
|
1495
|
+
keyup: RecognizeableEffect<"keyup", KeychordMetadata>;
|
|
1496
|
+
visibilitychange: RecognizeableEffect<"visibilitychange", KeychordMetadata>;
|
|
1497
|
+
};
|
|
1498
|
+
declare class Konami extends Listenable<KonamiType, KonamiMetadata> {
|
|
1499
|
+
constructor(options?: KonamiOptions);
|
|
1500
|
+
get metadata(): KeychordMetadata;
|
|
1501
|
+
}
|
|
941
1502
|
|
|
942
1503
|
type MousepressType = 'mousedown' | 'mouseleave' | 'mouseup';
|
|
943
1504
|
type MousepressMetadata = PointerStartMetadata & PointerMoveMetadata & PointerTimeMetadata;
|
|
944
1505
|
type MousepressOptions = {
|
|
945
1506
|
minDuration?: number;
|
|
946
1507
|
minDistance?: number;
|
|
947
|
-
getMousemoveTarget?: (event: MouseEvent) => HTMLElement;
|
|
948
1508
|
onDown?: MousepressHook;
|
|
949
1509
|
onMove?: MousepressHook;
|
|
950
1510
|
onLeave?: MousepressHook;
|
|
@@ -952,7 +1512,18 @@ type MousepressOptions = {
|
|
|
952
1512
|
};
|
|
953
1513
|
type MousepressHook = (api: MousepressHookApi) => any;
|
|
954
1514
|
type MousepressHookApi = HookApi<MousepressType, MousepressMetadata>;
|
|
955
|
-
|
|
1515
|
+
/**
|
|
1516
|
+
* [Docs](https://baleada.dev/docs/logic/factories/mousepress)
|
|
1517
|
+
*/
|
|
1518
|
+
declare function createMousepress(options?: MousepressOptions): {
|
|
1519
|
+
mousedown: RecognizeableEffect<"mousedown", MousepressMetadata>;
|
|
1520
|
+
mouseleave: RecognizeableEffect<"mouseleave", MousepressMetadata>;
|
|
1521
|
+
mouseup: RecognizeableEffect<"mouseup", MousepressMetadata>;
|
|
1522
|
+
};
|
|
1523
|
+
declare class Mousepress extends Listenable<MousepressType, MousepressMetadata> {
|
|
1524
|
+
constructor(options?: MousepressOptions);
|
|
1525
|
+
get metadata(): MousepressMetadata;
|
|
1526
|
+
}
|
|
956
1527
|
|
|
957
1528
|
type MousereleaseType = 'mousedown' | 'mouseleave' | 'mouseup';
|
|
958
1529
|
type MousereleaseMetadata = PointerStartMetadata & PointerMoveMetadata & PointerTimeMetadata;
|
|
@@ -960,7 +1531,6 @@ type MousereleaseOptions = {
|
|
|
960
1531
|
minDuration?: number;
|
|
961
1532
|
minDistance?: number;
|
|
962
1533
|
minVelocity?: number;
|
|
963
|
-
getMousemoveTarget?: (event: MouseEvent) => HTMLElement;
|
|
964
1534
|
onDown?: MousereleaseHook;
|
|
965
1535
|
onMove?: MousereleaseHook;
|
|
966
1536
|
onLeave?: MousereleaseHook;
|
|
@@ -968,7 +1538,18 @@ type MousereleaseOptions = {
|
|
|
968
1538
|
};
|
|
969
1539
|
type MousereleaseHook = (api: MousereleaseHookApi) => any;
|
|
970
1540
|
type MousereleaseHookApi = HookApi<MousereleaseType, MousereleaseMetadata>;
|
|
971
|
-
|
|
1541
|
+
/**
|
|
1542
|
+
* [Docs](https://baleada.dev/docs/logic/factories/mouserelease)
|
|
1543
|
+
*/
|
|
1544
|
+
declare function createMouserelease(options?: MousereleaseOptions): {
|
|
1545
|
+
mousedown: RecognizeableEffect<"mousedown", MousereleaseMetadata>;
|
|
1546
|
+
mouseleave: RecognizeableEffect<"mouseleave", MousereleaseMetadata>;
|
|
1547
|
+
mouseup: RecognizeableEffect<"mouseup", MousereleaseMetadata>;
|
|
1548
|
+
};
|
|
1549
|
+
declare class Mouserelease extends Listenable<MousereleaseType, MousereleaseMetadata> {
|
|
1550
|
+
constructor(options?: MousereleaseOptions);
|
|
1551
|
+
get metadata(): MousereleaseMetadata;
|
|
1552
|
+
}
|
|
972
1553
|
|
|
973
1554
|
type TouchpressType = 'touchstart' | 'touchmove' | 'touchcancel' | 'touchend';
|
|
974
1555
|
type TouchpressMetadata = PointerStartMetadata & PointerMoveMetadata & PointerTimeMetadata;
|
|
@@ -982,7 +1563,16 @@ type TouchpressOptions = {
|
|
|
982
1563
|
};
|
|
983
1564
|
type TouchpressHook = (api: TouchpressHookApi) => any;
|
|
984
1565
|
type TouchpressHookApi = HookApi<TouchpressType, TouchpressMetadata>;
|
|
985
|
-
declare function createTouchpress(options?: TouchpressOptions):
|
|
1566
|
+
declare function createTouchpress(options?: TouchpressOptions): {
|
|
1567
|
+
touchstart: RecognizeableEffect<"touchstart", TouchpressMetadata>;
|
|
1568
|
+
touchmove: RecognizeableEffect<"touchmove", TouchpressMetadata>;
|
|
1569
|
+
touchcancel: RecognizeableEffect<"touchcancel", TouchpressMetadata>;
|
|
1570
|
+
touchend: RecognizeableEffect<"touchend", TouchpressMetadata>;
|
|
1571
|
+
};
|
|
1572
|
+
declare class Touchpress extends Listenable<TouchpressType, TouchpressMetadata> {
|
|
1573
|
+
constructor(options?: TouchpressOptions);
|
|
1574
|
+
get metadata(): TouchpressMetadata;
|
|
1575
|
+
}
|
|
986
1576
|
|
|
987
1577
|
type TouchreleaseType = 'touchstart' | 'touchmove' | 'touchcancel' | 'touchend';
|
|
988
1578
|
type TouchreleaseMetadata = PointerStartMetadata & PointerMoveMetadata & PointerTimeMetadata;
|
|
@@ -997,256 +1587,15 @@ type TouchreleaseOptions = {
|
|
|
997
1587
|
};
|
|
998
1588
|
type TouchreleaseHook = (api: TouchreleaseHookApi) => any;
|
|
999
1589
|
type TouchreleaseHookApi = HookApi<TouchreleaseType, TouchreleaseMetadata>;
|
|
1000
|
-
declare function createTouchrelease(options?: TouchreleaseOptions):
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
};
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
type CreatePredicateKeycomboDownOptions = {
|
|
1012
|
-
toDownKeys?: (alias: string) => KeyStatusKey[];
|
|
1013
|
-
};
|
|
1014
|
-
|
|
1015
|
-
type CreatePredicateKeycomboMatchOptions$1 = CreatePredicateKeycomboDownOptions & {
|
|
1016
|
-
toAliases?: (key: KeyStatusKey) => string[];
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
type Direction = 'up' | 'upRight' | 'right' | 'downRight' | 'down' | 'downLeft' | 'left' | 'upLeft';
|
|
1020
|
-
|
|
1021
|
-
type HookApi<Type extends ListenableSupportedType, Metadata extends Record<any, any>> = {
|
|
1022
|
-
status: RecognizeableStatus;
|
|
1023
|
-
metadata: Metadata;
|
|
1024
|
-
sequence: ListenEffectParam<Type>[];
|
|
1025
|
-
};
|
|
1026
|
-
|
|
1027
|
-
type PolarCoordinates = {
|
|
1028
|
-
distance: number;
|
|
1029
|
-
angle: {
|
|
1030
|
-
radians: number;
|
|
1031
|
-
degrees: number;
|
|
1032
|
-
};
|
|
1033
|
-
};
|
|
1034
|
-
|
|
1035
|
-
type KeyboardTimeMetadata = {
|
|
1036
|
-
times: {
|
|
1037
|
-
start: number;
|
|
1038
|
-
end: number;
|
|
1039
|
-
};
|
|
1040
|
-
duration: number;
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
|
-
type PointerStartMetadata = {
|
|
1044
|
-
points: {
|
|
1045
|
-
start: {
|
|
1046
|
-
x: number;
|
|
1047
|
-
y: number;
|
|
1048
|
-
};
|
|
1049
|
-
end: {
|
|
1050
|
-
x: number;
|
|
1051
|
-
y: number;
|
|
1052
|
-
};
|
|
1053
|
-
};
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1056
|
-
type PointerTimeMetadata = {
|
|
1057
|
-
times: {
|
|
1058
|
-
start: number;
|
|
1059
|
-
end: number;
|
|
1060
|
-
};
|
|
1061
|
-
duration: number;
|
|
1062
|
-
velocity: number;
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
type PointerMoveMetadata = {
|
|
1066
|
-
distance: {
|
|
1067
|
-
straight: {
|
|
1068
|
-
fromStart: PolarCoordinates['distance'];
|
|
1069
|
-
fromPrevious: PolarCoordinates['distance'];
|
|
1070
|
-
};
|
|
1071
|
-
horizontal: {
|
|
1072
|
-
fromStart: PolarCoordinates['distance'];
|
|
1073
|
-
fromPrevious: PolarCoordinates['distance'];
|
|
1074
|
-
};
|
|
1075
|
-
vertical: {
|
|
1076
|
-
fromStart: PolarCoordinates['distance'];
|
|
1077
|
-
fromPrevious: PolarCoordinates['distance'];
|
|
1078
|
-
};
|
|
1079
|
-
};
|
|
1080
|
-
angle: {
|
|
1081
|
-
fromPrevious: PolarCoordinates['angle'];
|
|
1082
|
-
fromStart: PolarCoordinates['angle'];
|
|
1083
|
-
};
|
|
1084
|
-
direction: {
|
|
1085
|
-
fromPrevious: Direction;
|
|
1086
|
-
fromStart: Direction;
|
|
1087
|
-
};
|
|
1088
|
-
};
|
|
1089
|
-
|
|
1090
|
-
type Graph<Id extends string, Metadata> = {
|
|
1091
|
-
nodes: GraphNode<Id>[];
|
|
1092
|
-
edges: GraphEdge<Id, Metadata>[];
|
|
1093
|
-
};
|
|
1094
|
-
type GraphNode<Id extends string> = Id;
|
|
1095
|
-
type GraphEdge<Id extends string, Metadata> = {
|
|
1096
|
-
from: Id;
|
|
1097
|
-
to: Id;
|
|
1098
|
-
predicateTraversable: (state: GraphState<Id, Metadata>) => boolean;
|
|
1099
|
-
};
|
|
1100
|
-
type GraphState<Id extends string, Metadata> = Record<Id, {
|
|
1101
|
-
status: 'set' | 'unset';
|
|
1102
|
-
metadata: Metadata;
|
|
1103
|
-
}>;
|
|
1104
|
-
type GraphStep<Id extends string, Metadata> = {
|
|
1105
|
-
path: GraphNode<Id>[];
|
|
1106
|
-
state: GraphState<Id, Metadata>;
|
|
1107
|
-
};
|
|
1108
|
-
type GraphCommonAncestor<Id extends string> = {
|
|
1109
|
-
node: GraphNode<Id>;
|
|
1110
|
-
distances: Record<GraphNode<Id>, number>;
|
|
1111
|
-
};
|
|
1112
|
-
type GraphTreeNode<Id extends string> = {
|
|
1113
|
-
node: GraphNode<Id>;
|
|
1114
|
-
children: GraphTreeNode<Id>[];
|
|
1115
|
-
};
|
|
1116
|
-
declare function defineGraph<Id extends string, Metadata>(nodes: GraphNode<Id>[], edges: GraphEdge<Id, Metadata>[]): {
|
|
1117
|
-
nodes: Id[];
|
|
1118
|
-
edges: GraphEdge<Id, Metadata>[];
|
|
1119
|
-
};
|
|
1120
|
-
declare function defineGraphNodes<Id extends string>(nodes: GraphNode<Id>[]): Id[];
|
|
1121
|
-
declare function defineGraphEdges<Id extends string, Metadata>(edges: GraphEdge<Id, Metadata>[]): GraphEdge<Id, Metadata>[];
|
|
1122
|
-
declare function defineGraphNode<Id extends string>(node: GraphNode<Id>): Id;
|
|
1123
|
-
declare function defineGraphEdge<Id extends string, Metadata>(from: GraphNode<Id>, to: GraphNode<Id>, predicateTraversable: (state: GraphState<Id, Metadata>) => boolean): {
|
|
1124
|
-
from: Id;
|
|
1125
|
-
to: Id;
|
|
1126
|
-
predicateTraversable: (state: GraphState<Id, Metadata>) => boolean;
|
|
1127
|
-
};
|
|
1128
|
-
type AsyncGraph<Id extends string, Metadata> = {
|
|
1129
|
-
nodes: GraphNode<Id>[];
|
|
1130
|
-
edges: AsyncGraphEdge<Id, Metadata>[];
|
|
1131
|
-
};
|
|
1132
|
-
type AsyncGraphEdge<Id extends string, Metadata> = {
|
|
1133
|
-
from: Id;
|
|
1134
|
-
to: Id;
|
|
1135
|
-
predicateTraversable: (metadata: GraphState<Id, Metadata>) => Promise<boolean>;
|
|
1136
|
-
};
|
|
1137
|
-
declare function defineAsyncGraph<Id extends string, Metadata>(nodes: GraphNode<Id>[], edges: AsyncGraphEdge<Id, Metadata>[]): {
|
|
1138
|
-
nodes: Id[];
|
|
1139
|
-
edges: AsyncGraphEdge<Id, Metadata>[];
|
|
1140
|
-
};
|
|
1141
|
-
declare function defineAsyncGraphEdges<Id extends string, Metadata>(edges: AsyncGraphEdge<Id, Metadata>[]): AsyncGraphEdge<Id, Metadata>[];
|
|
1142
|
-
declare function defineAsyncGraphEdge<Id extends string, Metadata>(from: GraphNode<Id>, to: GraphNode<Id>, predicateTraversable: (metadata: GraphState<Id, Metadata>) => Promise<boolean>): {
|
|
1143
|
-
from: Id;
|
|
1144
|
-
to: Id;
|
|
1145
|
-
predicateTraversable: (metadata: GraphState<Id, Metadata>) => Promise<boolean>;
|
|
1146
|
-
};
|
|
1147
|
-
|
|
1148
|
-
type GeneratorFn<Parameter, Yielded> = (param: Parameter) => Generator<Yielded>;
|
|
1149
|
-
|
|
1150
|
-
type GraphFn<Id extends string, Metadata, Returned> = (graph: Graph<Id, Metadata>) => Returned;
|
|
1151
|
-
type GraphGeneratorFn<Id extends string, Metadata, Yielded> = GeneratorFn<Graph<Id, Metadata>, Yielded>;
|
|
1152
|
-
type GraphNodeFn<Id extends string, Returned> = (node: GraphNode<Id>) => Returned;
|
|
1153
|
-
type GraphNodeGeneratorFn<Id extends string, Yielded> = GeneratorFn<GraphNode<Id>, Yielded>;
|
|
1154
|
-
type GraphNodeTupleFn<Id extends string, Returned> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => Returned;
|
|
1155
|
-
type GraphNodeTupleGeneratorFn<Id extends string, Yielded> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => Generator<Yielded>;
|
|
1156
|
-
type GraphStateFn<Id extends string, Metadata, Returned> = (state: GraphState<Id, Metadata>) => Returned;
|
|
1157
|
-
declare function createToIndegree<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | AsyncGraph<Id, Metadata>>(graph: GraphType): GraphNodeFn<Id, number>;
|
|
1158
|
-
declare function createToOutdegree<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | AsyncGraph<Id, Metadata>>(graph: GraphType): GraphNodeFn<Id, number>;
|
|
1159
|
-
declare function createToIncoming<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | AsyncGraph<Id, Metadata>>(graph: GraphType): GraphNodeGeneratorFn<Id, GraphType extends AsyncGraph<Id, Metadata> ? AsyncGraphEdge<Id, Metadata> : GraphEdge<Id, Metadata>>;
|
|
1160
|
-
declare function createToOutgoing<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | AsyncGraph<Id, Metadata>>(graph: GraphType): GraphNodeGeneratorFn<Id, GraphType extends AsyncGraph<Id, Metadata> ? AsyncGraphEdge<Id, Metadata> : GraphEdge<Id, Metadata>>;
|
|
1161
|
-
declare function createPredicateRoot<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | AsyncGraph<Id, Metadata>>(graph: GraphType): GraphNodeFn<Id, boolean>;
|
|
1162
|
-
|
|
1163
|
-
type AsyncGeneratorFn<Parameter, Yielded> = (param: Parameter) => AsyncGenerator<Yielded>;
|
|
1164
|
-
|
|
1165
|
-
type AsyncGraphFn<Id extends string, Metadata, Returned> = (graph: AsyncGraph<Id, Metadata>) => Promise<Returned>;
|
|
1166
|
-
type AsyncGraphGeneratorFn<Id extends string, Metadata, Yielded> = GeneratorFn<AsyncGraph<Id, Metadata>, Yielded>;
|
|
1167
|
-
type AsyncGraphAsyncGeneratorFn<Id extends string, Metadata, Yielded> = AsyncGeneratorFn<AsyncGraph<Id, Metadata>, Yielded>;
|
|
1168
|
-
type GraphNodeAsyncGeneratorFn<Id extends string, Yielded> = AsyncGeneratorFn<GraphNode<Id>, Yielded>;
|
|
1169
|
-
type GraphNodeTupleAsyncFn<Id extends string, Returned> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => Promise<Returned>;
|
|
1170
|
-
type GraphNodeTupleAsyncGeneratorFn<Id extends string, Yielded> = (...nodes: [GraphNode<Id>, GraphNode<Id>]) => AsyncGenerator<Yielded>;
|
|
1171
|
-
type GraphStateAsyncFn<Id extends string, Metadata, Returned> = (state: GraphState<Id, Metadata>) => Promise<Returned>;
|
|
1172
|
-
|
|
1173
|
-
declare function createToLayers$1<Id extends string, Metadata>(options?: {
|
|
1174
|
-
createToSteps?: CreateToStepsOptions$2<Id, Metadata>;
|
|
1175
|
-
}): GraphFn<Id, Metadata, GraphNode<Id>[][]>;
|
|
1176
|
-
declare function createToTree$2<Id extends string, Metadata>(options?: {
|
|
1177
|
-
createToSteps?: CreateToStepsOptions$2<Id, Metadata>;
|
|
1178
|
-
}): GraphFn<Id, Metadata, GraphTreeNode<Id>[]>;
|
|
1179
|
-
declare function createToCommonAncestors$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>): GraphNodeTupleGeneratorFn<Id, GraphCommonAncestor<Id>>;
|
|
1180
|
-
declare function createPredicateAncestor$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>): GraphNodeTupleFn<Id, boolean>;
|
|
1181
|
-
declare function createToNodeSteps$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>, options?: {
|
|
1182
|
-
createToSteps?: CreateToStepsOptions$2<Id, Metadata>;
|
|
1183
|
-
}): GraphNodeGeneratorFn<Id, GraphStep<Id, Metadata>>;
|
|
1184
|
-
type CreateToStepsOptions$2<Id extends string, Metadata> = {
|
|
1185
|
-
root?: GraphNode<Id>;
|
|
1186
|
-
toMockMetadata?: (node: GraphNode<Id>, totalConnectionsFollowed: number) => Metadata;
|
|
1187
|
-
toUnsetMetadata?: (node: GraphNode<Id>) => Metadata;
|
|
1188
|
-
kind?: 'directed acyclic' | 'arborescence';
|
|
1189
|
-
};
|
|
1190
|
-
declare function createToSteps$2<Id extends string, Metadata>(options?: CreateToStepsOptions$2<Id, Metadata>): GraphGeneratorFn<Id, Metadata, GraphStep<Id, Metadata>>;
|
|
1191
|
-
declare function createToPath$2<Id extends string, Metadata>(directedAcyclic: Graph<Id, Metadata>): GraphStateFn<Id, Metadata, GraphNode<Id>[]>;
|
|
1192
|
-
declare function createToRoots<Id extends string, Metadata, GraphType extends Graph<Id, Metadata> | AsyncGraph<Id, Metadata> = Graph<Id, Metadata>>(options?: {
|
|
1193
|
-
kind?: 'directed acyclic' | 'arborescence';
|
|
1194
|
-
}): (GraphType extends AsyncGraph<Id, Metadata> ? AsyncGraphGeneratorFn<Id, Metadata, GraphNode<Id>> : GraphGeneratorFn<Id, Metadata, GraphNode<Id>>);
|
|
1195
|
-
|
|
1196
|
-
declare function createToLayers<Id extends string, Metadata>(options?: {
|
|
1197
|
-
createToSteps?: CreateToStepsOptions$2<Id, Metadata>;
|
|
1198
|
-
}): AsyncGraphFn<Id, Metadata, GraphNode<Id>[][]>;
|
|
1199
|
-
declare function createToTree$1<Id extends string, Metadata>(options?: {
|
|
1200
|
-
createToSteps?: CreateToStepsOptions$1<Id, Metadata>;
|
|
1201
|
-
}): AsyncGraphFn<Id, Metadata, GraphTreeNode<Id>[]>;
|
|
1202
|
-
declare function createToCommonAncestors$1<Id extends string, Metadata>(directedAcyclic: AsyncGraph<Id, Metadata>): GraphNodeTupleAsyncGeneratorFn<Id, GraphCommonAncestor<Id>>;
|
|
1203
|
-
declare function createPredicateAncestor$1<Id extends string, Metadata>(directedAcyclic: AsyncGraph<Id, Metadata>): GraphNodeTupleAsyncFn<Id, boolean>;
|
|
1204
|
-
declare function createToNodeSteps$1<Id extends string, Metadata>(directedAcyclic: AsyncGraph<Id, Metadata>, options?: {
|
|
1205
|
-
createToSteps?: CreateToStepsOptions$1<Id, Metadata>;
|
|
1206
|
-
}): GraphNodeAsyncGeneratorFn<Id, GraphStep<Id, Metadata>>;
|
|
1207
|
-
type CreateToStepsOptions$1<Id extends string, Metadata> = CreateToStepsOptions$2<Id, Metadata>;
|
|
1208
|
-
declare function createToSteps$1<Id extends string, Metadata>(options?: CreateToStepsOptions$1<Id, Metadata>): AsyncGraphAsyncGeneratorFn<Id, Metadata, GraphStep<Id, Metadata>>;
|
|
1209
|
-
declare function createToPath$1<Id extends string, Metadata>(directedAcyclic: AsyncGraph<Id, Metadata>): GraphStateAsyncFn<Id, Metadata, GraphNode<Id>[]>;
|
|
1210
|
-
|
|
1211
|
-
type CreateToStepsOptions<Id extends string> = Expand<Pick<CreateToStepsOptions$2<Id, DecisionTreeMetadata>, 'kind'> & {
|
|
1212
|
-
priorityBranch?: boolean;
|
|
1213
|
-
}>;
|
|
1214
|
-
type DecisionTree<Id extends string> = Graph<Id, DecisionTreeMetadata>;
|
|
1215
|
-
type DecisionTreeMetadata = boolean;
|
|
1216
|
-
declare function createToTree<Id extends string>(options?: {
|
|
1217
|
-
createToSteps?: CreateToStepsOptions<Id>;
|
|
1218
|
-
}): GraphFn<Id, boolean, GraphTreeNode<Id>[]>;
|
|
1219
|
-
declare function createToCommonAncestors<Id extends string>(...params: Parameters<typeof createToCommonAncestors$2<Id, DecisionTreeMetadata>>): GraphNodeTupleGeneratorFn<Id, GraphCommonAncestor<Id>>;
|
|
1220
|
-
declare function createPredicateAncestor<Id extends string>(...params: Parameters<typeof createPredicateAncestor$2<Id, DecisionTreeMetadata>>): GraphNodeTupleFn<Id, boolean>;
|
|
1221
|
-
declare function createToNodeSteps<Id extends string>(decisionTree: DecisionTree<Id>, options?: {
|
|
1222
|
-
createToSteps?: CreateToStepsOptions<Id>;
|
|
1223
|
-
}): GraphNodeGeneratorFn<Id, GraphStep<Id, boolean>>;
|
|
1224
|
-
declare function createToSteps<Id extends string>(options?: CreateToStepsOptions<Id>): GraphGeneratorFn<Id, boolean, GraphStep<Id, boolean>>;
|
|
1225
|
-
declare function createToPath<Id extends string>(...params: Parameters<typeof createToPath$2<Id, DecisionTreeMetadata>>): GraphStateFn<Id, boolean, Id[]>;
|
|
1226
|
-
|
|
1227
|
-
type GraphTreeFn<Id extends string, Returned> = (tree: GraphTreeNode<Id>[]) => Returned;
|
|
1228
|
-
declare function createFind<Id extends string>(node: GraphNode<Id>): GraphTreeFn<Id, GraphTreeNode<Id>>;
|
|
1229
|
-
|
|
1230
|
-
type ManyFn<Parameter, Returned> = (...params: Parameter[]) => Returned;
|
|
1231
|
-
|
|
1232
|
-
declare function createList(): ManyFn<ClassValue, string>;
|
|
1233
|
-
|
|
1234
|
-
type ToGraphYielded = {
|
|
1235
|
-
node: GraphNode<string>;
|
|
1236
|
-
edge: PartialGraphEdge | undefined;
|
|
1237
|
-
};
|
|
1238
|
-
type PartialGraphEdge = Omit<GraphEdge<string, unknown>, 'predicateTraversable'>;
|
|
1239
|
-
type CreateToGraphOptions<TreeNode> = {
|
|
1240
|
-
toId?: (node: TreeNode) => string;
|
|
1241
|
-
toChildren?: (node: TreeNode) => TreeNode[];
|
|
1242
|
-
};
|
|
1243
|
-
declare function createToGraph<TreeNode>(options?: CreateToGraphOptions<TreeNode>): GeneratorFn<TreeNode[], ToGraphYielded>;
|
|
1244
|
-
|
|
1245
|
-
type KeyboardEventFn<Returned> = (keyboardEvent: KeyboardEvent) => Returned;
|
|
1246
|
-
type CreatePredicateKeycomboMatchOptions = {
|
|
1247
|
-
toDownKeys?: (alias: string) => KeyStatusKey[];
|
|
1248
|
-
toAliases?: (event: KeyboardEvent) => string[];
|
|
1249
|
-
};
|
|
1250
|
-
declare const createPredicateKeycomboMatch: (keycombo: string, options?: CreatePredicateKeycomboMatchOptions) => KeyboardEventFn<boolean>;
|
|
1590
|
+
declare function createTouchrelease(options?: TouchreleaseOptions): {
|
|
1591
|
+
touchstart: RecognizeableEffect<"touchstart", TouchreleaseMetadata>;
|
|
1592
|
+
touchmove: RecognizeableEffect<"touchmove", TouchreleaseMetadata>;
|
|
1593
|
+
touchcancel: RecognizeableEffect<"touchcancel", TouchreleaseMetadata>;
|
|
1594
|
+
touchend: RecognizeableEffect<"touchend", TouchreleaseMetadata>;
|
|
1595
|
+
};
|
|
1596
|
+
declare class Touchrelease extends Listenable<TouchreleaseType, TouchreleaseMetadata> {
|
|
1597
|
+
constructor(options?: TouchreleaseOptions);
|
|
1598
|
+
get metadata(): TouchreleaseMetadata;
|
|
1599
|
+
}
|
|
1251
1600
|
|
|
1252
|
-
export { AnimateFrame, AnimateFrameEffect, AnimateOptions, Animateable, AnimateableKeyframe, AnimateableOptions, AnimateableStatus,
|
|
1601
|
+
export { AnimateFrame, AnimateFrameEffect, AnimateOptions, Animateable, AnimateableKeyframe, AnimateableOptions, AnimateableStatus, Broadcastable, BroadcastableOptions, BroadcastableStatus, ColorInterpolationMethod, Compareable, CompareableOptions, CompareableStatus, CompleteOptions, Completeable, CompleteableOptions, CompleteableStatus, Copyable, CopyableOptions, CopyableStatus, CreateStepsOptions$1 as CreateDirectedAcyclicStepsOptions, CreateFocusableOptions, CreateGraphOptions, CreateKeycomboMatchOptions, CreateMixOptions, CreatePathConfig, CreateResultsOptions, Delayable, DelayableEffect, DelayableOptions, DelayableStatus, Drawable, DrawableOptions, DrawableStatus, DrawableStroke, Fetchable, FetchableOptions, FetchableStatus, Fullscreenable, FullscreenableGetElement, FullscreenableOptions, FullscreenableStatus, Grantable, GrantableOptions, GrantableStatus, Keychord, KeychordHook, KeychordHookApi, KeychordMetadata, KeychordOptions, KeychordType, Keypress, KeypressHook, KeypressHookApi, KeypressMetadata, KeypressOptions, KeypressType, Keyrelease, KeyreleaseHook, KeyreleaseHookApi, KeyreleaseMetadata, KeyreleaseOptions, KeyreleaseType, Konami, KonamiHook, KonamiHookApi, KonamiMetadata, KonamiOptions, KonamiType, ListenEffect, ListenEffectParam, ListenOptions, Listenable, ListenableActive, ListenableKeycombo, ListenableMousecombo, ListenableOptions, ListenablePointercombo, ListenableStatus, ListenableSupportedEventType, ListenableSupportedType, MixColor, Mousepress, MousepressHook, MousepressHookApi, MousepressMetadata, MousepressOptions, MousepressType, Mouserelease, MousereleaseHook, MousereleaseHookApi, MousereleaseMetadata, MousereleaseOptions, MousereleaseType, Navigateable, NavigateableOptions, NavigateableStatus, Pickable, PickableOptions, PickableStatus, Potentiality, RecognizeOptions, Recognizeable, RecognizeableEffect, RecognizeableOptions, RecognizeableStatus, Resolveable, ResolveableOptions, ResolveableStatus, Shareable, ShareableOptions, ShareableStatus, Storeable, StoreableOptions, StoreableStatus, ToGraphYielded, Touchpress, TouchpressHook, TouchpressHookApi, TouchpressMetadata, TouchpressOptions, TouchpressType, Touchrelease, TouchreleaseHook, TouchreleaseHookApi, TouchreleaseMetadata, TouchreleaseOptions, TouchreleaseType, createClear$1 as createAssociativeArrayClear, createDelete$1 as createAssociativeArrayDelete, createHas$1 as createAssociativeArrayHas, createKeys$1 as createAssociativeArrayKeys, createSet$1 as createAssociativeArraySet, createValue$1 as createAssociativeArrayValue, createValues as createAssociativeArrayValues, createBreadthPathConfig, createChildren, createClamp, createClear, createClip, createClone, createComputedStyle, createConcat, createAncestor$1 as createDecisionTreeAncestor, createCommonAncestors$1 as createDecisionTreeCommonAncestors, createNodeDepthFirstSteps$1 as createDecisionTreeNodeDepthFirstSteps, createPath$1 as createDecisionTreePath, createDepthFirstSteps$1 as createDecisionTreeSteps, createTree$1 as createDecisionTreeTree, createDeepEqual, createDeepMerge, createDelete, createDepthPathConfig, createDetermine, createAncestor$2 as createDirectedAcyclicAncestor, createAncestor as createDirectedAcyclicAsyncAncestor, createCommonAncestors as createDirectedAcyclicAsyncCommonAncestors, createDepthFirstSteps as createDirectedAcyclicAsyncDepthFirstSteps, createLayers as createDirectedAcyclicAsyncLayers, createNodeDepthFirstSteps as createDirectedAcyclicAsyncNodeDepthFirstSteps, createPath as createDirectedAcyclicAsyncPath, createTree as createDirectedAcyclicAsyncTree, createCommonAncestors$2 as createDirectedAcyclicCommonAncestors, createDepthFirstSteps$2 as createDirectedAcyclicDepthFirstSteps, createLayers$1 as createDirectedAcyclicLayers, createNodeDepthFirstSteps$2 as createDirectedAcyclicNodeDepthFirstSteps, createPath$2 as createDirectedAcyclicPath, createRoots as createDirectedAcyclicRoots, createTree$2 as createDirectedAcyclicTree, createEntries, createEqual, createEvery, createFilter, createFilterAsync, createFindAsync, createFindIndexAsync, createFocusable, createForEachAsync, createGraph, createGreater, createGreaterOrEqual, createHas, createIncoming, createIndegree, createInsert, createKeychord, createKeycomboMatch, createKeypress, createKeyrelease, createKeys, createKonami, createLess, createLessOrEqual, createList, createMap, createMapAsync, createMix, createMousepress, createMouserelease, createNumber, createOnlyChild, createOutdegree, createOutgoing, createReduce, createReduceAsync, createRemove, createReorder, createReplace, createResults, createReverse, createRoot, createSanitize, createSet, createShuffle, createSiblings, createSlice, createSlug, createSome, createSort, createSwap, createTerminal, createTotalSiblings, createTouchpress, createTouchrelease, createFind as createTreeFind, createUnique, createValue, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, toMessageListenParams, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|