mutts 1.0.9 → 1.0.10
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/README.md +58 -33
- package/dist/browser.cjs +1371 -1206
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +2 -1392
- package/dist/browser.dev.cjs +110 -0
- package/dist/browser.dev.cjs.map +1 -0
- package/dist/browser.dev.d.ts +2 -0
- package/dist/browser.dev.esm.js +5 -0
- package/dist/browser.dev.esm.js.map +1 -0
- package/dist/browser.esm.js +6 -87
- package/dist/browser.esm.js.map +1 -1
- package/dist/chunks/{async-browser-lvzLOCgk.cjs → async-browser-BU_IfxYD.cjs} +4 -85
- package/dist/chunks/async-browser-BU_IfxYD.cjs.map +1 -0
- package/dist/chunks/{async-node-C3DeIb0y.cjs → async-node-3PrbVAbB.cjs} +3 -1
- package/dist/chunks/async-node-3PrbVAbB.cjs.map +1 -0
- package/dist/chunks/{index-2vea86wD.esm.js → index-CaaQQlPJ.esm.js} +1116 -953
- package/dist/chunks/index-CaaQQlPJ.esm.js.map +1 -0
- package/dist/chunks/node-nKJBk8iJ.esm.js +96 -0
- package/dist/chunks/node-nKJBk8iJ.esm.js.map +1 -0
- package/dist/chunks/{index-VTO-b2vR.cjs → proxy-Dtg-bJ3T.cjs} +2285 -2983
- package/dist/chunks/proxy-Dtg-bJ3T.cjs.map +1 -0
- package/dist/chunks/{index-CtA2AWl3.esm.js → proxy-r7lARftl.esm.js} +2273 -2948
- package/dist/chunks/proxy-r7lARftl.esm.js.map +1 -0
- package/dist/debug.cjs +973 -28
- package/dist/debug.cjs.map +1 -1
- package/dist/debug.d.ts +36 -37
- package/dist/debug.esm.js +949 -1
- package/dist/debug.esm.js.map +1 -1
- package/dist/devtools/manifest.json +1 -1
- package/dist/devtools/panel.html +1 -1
- package/dist/devtools/panel.js +107 -94
- package/dist/devtools/panel.js.map +1 -1
- package/dist/index.d.ts +1447 -1
- package/dist/mutts.umd.js +7167 -1
- package/dist/mutts.umd.js.map +1 -1
- package/dist/mutts.umd.min.js +1 -1
- package/dist/mutts.umd.min.js.map +1 -1
- package/dist/node.cjs +62 -60
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.dev.cjs +110 -0
- package/dist/node.dev.cjs.map +1 -0
- package/dist/node.dev.d.ts +2 -0
- package/dist/node.dev.esm.js +6 -0
- package/dist/node.dev.esm.js.map +1 -0
- package/dist/node.esm.js +4 -97
- package/dist/node.esm.js.map +1 -1
- package/dist/{types-DaHFfhlN.d.ts → types-W5vD6m2n.d.ts} +99 -44
- package/docs/ai/api-reference.md +11 -18
- package/docs/ai/manual.md +308 -230
- package/docs/reactive/advanced.md +312 -2
- package/docs/reactive/attend.md +1 -2
- package/docs/reactive/collections.md +21 -39
- package/docs/reactive/core.md +7 -37
- package/docs/reactive/debugging.md +117 -10
- package/docs/reactive/error-handling.md +10 -10
- package/docs/reactive/resource.md +125 -0
- package/docs/reactive/scan.md +32 -1
- package/docs/reactive.md +3 -2
- package/docs/utils.md +70 -0
- package/package.json +59 -30
- package/dist/chunks/async-browser-lvzLOCgk.cjs.map +0 -1
- package/dist/chunks/async-node-C3DeIb0y.cjs.map +0 -1
- package/dist/chunks/index-2vea86wD.esm.js.map +0 -1
- package/dist/chunks/index-CtA2AWl3.esm.js.map +0 -1
- package/dist/chunks/index-VTO-b2vR.cjs.map +0 -1
- package/dist/debug/debug.d.ts +0 -122
- package/dist/debug/debug.d.ts.map +0 -1
- package/dist/debug/index.d.ts +0 -4
- package/dist/debug/index.d.ts.map +0 -1
- package/dist/debug/lineage-panel.d.ts +0 -5
- package/dist/debug/lineage-panel.d.ts.map +0 -1
- package/dist/debug/lineage.d.ts +0 -79
- package/dist/debug/lineage.d.ts.map +0 -1
- package/dist/src/async/browser.d.ts +0 -2
- package/dist/src/async/browser.d.ts.map +0 -1
- package/dist/src/async/index.d.ts +0 -19
- package/dist/src/async/index.d.ts.map +0 -1
- package/dist/src/async/node.d.ts +0 -2
- package/dist/src/async/node.d.ts.map +0 -1
- package/dist/src/decorator.d.ts +0 -106
- package/dist/src/decorator.d.ts.map +0 -1
- package/dist/src/destroyable.d.ts +0 -87
- package/dist/src/destroyable.d.ts.map +0 -1
- package/dist/src/entry-browser.d.ts +0 -3
- package/dist/src/entry-browser.d.ts.map +0 -1
- package/dist/src/entry-node.d.ts +0 -3
- package/dist/src/entry-node.d.ts.map +0 -1
- package/dist/src/eventful.d.ts +0 -20
- package/dist/src/eventful.d.ts.map +0 -1
- package/dist/src/flavored.d.ts +0 -33
- package/dist/src/flavored.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -14
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/indexable.d.ts +0 -243
- package/dist/src/indexable.d.ts.map +0 -1
- package/dist/src/introspection.d.ts +0 -27
- package/dist/src/introspection.d.ts.map +0 -1
- package/dist/src/iterableWeak.d.ts +0 -53
- package/dist/src/iterableWeak.d.ts.map +0 -1
- package/dist/src/mixins.d.ts +0 -25
- package/dist/src/mixins.d.ts.map +0 -1
- package/dist/src/promiseChain.d.ts +0 -20
- package/dist/src/promiseChain.d.ts.map +0 -1
- package/dist/src/reactive/array.d.ts +0 -48
- package/dist/src/reactive/array.d.ts.map +0 -1
- package/dist/src/reactive/buffer.d.ts +0 -120
- package/dist/src/reactive/buffer.d.ts.map +0 -1
- package/dist/src/reactive/change.d.ts +0 -29
- package/dist/src/reactive/change.d.ts.map +0 -1
- package/dist/src/reactive/deep-touch.d.ts +0 -28
- package/dist/src/reactive/deep-touch.d.ts.map +0 -1
- package/dist/src/reactive/deep-watch-state.d.ts +0 -25
- package/dist/src/reactive/deep-watch-state.d.ts.map +0 -1
- package/dist/src/reactive/deep-watch.d.ts +0 -20
- package/dist/src/reactive/deep-watch.d.ts.map +0 -1
- package/dist/src/reactive/describe.d.ts +0 -12
- package/dist/src/reactive/describe.d.ts.map +0 -1
- package/dist/src/reactive/effect-context.d.ts +0 -34
- package/dist/src/reactive/effect-context.d.ts.map +0 -1
- package/dist/src/reactive/effects.d.ts +0 -164
- package/dist/src/reactive/effects.d.ts.map +0 -1
- package/dist/src/reactive/index.d.ts +0 -19
- package/dist/src/reactive/index.d.ts.map +0 -1
- package/dist/src/reactive/map.d.ts +0 -28
- package/dist/src/reactive/map.d.ts.map +0 -1
- package/dist/src/reactive/memoize.d.ts +0 -28
- package/dist/src/reactive/memoize.d.ts.map +0 -1
- package/dist/src/reactive/non-reactive-state.d.ts +0 -9
- package/dist/src/reactive/non-reactive-state.d.ts.map +0 -1
- package/dist/src/reactive/non-reactive.d.ts +0 -11
- package/dist/src/reactive/non-reactive.d.ts.map +0 -1
- package/dist/src/reactive/project.d.ts +0 -40
- package/dist/src/reactive/project.d.ts.map +0 -1
- package/dist/src/reactive/proxy-state.d.ts +0 -8
- package/dist/src/reactive/proxy-state.d.ts.map +0 -1
- package/dist/src/reactive/proxy.d.ts +0 -23
- package/dist/src/reactive/proxy.d.ts.map +0 -1
- package/dist/src/reactive/record.d.ts +0 -115
- package/dist/src/reactive/record.d.ts.map +0 -1
- package/dist/src/reactive/register.d.ts +0 -125
- package/dist/src/reactive/register.d.ts.map +0 -1
- package/dist/src/reactive/registry.d.ts +0 -21
- package/dist/src/reactive/registry.d.ts.map +0 -1
- package/dist/src/reactive/set.d.ts +0 -26
- package/dist/src/reactive/set.d.ts.map +0 -1
- package/dist/src/reactive/tracking.d.ts +0 -7
- package/dist/src/reactive/tracking.d.ts.map +0 -1
- package/dist/src/reactive/types.d.ts +0 -424
- package/dist/src/reactive/types.d.ts.map +0 -1
- package/dist/src/reactive/watch.d.ts +0 -48
- package/dist/src/reactive/watch.d.ts.map +0 -1
- package/dist/src/std-decorators.d.ts +0 -45
- package/dist/src/std-decorators.d.ts.map +0 -1
- package/dist/src/utils.d.ts +0 -49
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/zone.d.ts +0 -40
- package/dist/src/zone.d.ts.map +0 -1
- package/docs/reactive/describe.md +0 -85
- package/docs/reactive/project.md +0 -93
- package/src/async/browser.ts +0 -323
- package/src/async/index.ts +0 -27
- package/src/async/node.ts +0 -92
- package/src/decorator.ts +0 -272
- package/src/destroyable.ts +0 -199
- package/src/entry-browser.ts +0 -5
- package/src/entry-node.ts +0 -5
- package/src/eventful.ts +0 -110
- package/src/flavored.ts +0 -106
- package/src/index.d.ts +0 -12
- package/src/index.ts +0 -64
- package/src/indexable.ts +0 -526
- package/src/introspection.ts +0 -59
- package/src/iterableWeak.ts +0 -233
- package/src/mixins.ts +0 -123
- package/src/promiseChain.ts +0 -110
- package/src/reactive/array.ts +0 -500
- package/src/reactive/buffer.ts +0 -328
- package/src/reactive/change.ts +0 -131
- package/src/reactive/deep-touch.ts +0 -273
- package/src/reactive/deep-watch-state.ts +0 -82
- package/src/reactive/deep-watch.ts +0 -171
- package/src/reactive/describe.ts +0 -39
- package/src/reactive/effect-context.ts +0 -83
- package/src/reactive/effects.ts +0 -1434
- package/src/reactive/index.ts +0 -72
- package/src/reactive/map.ts +0 -142
- package/src/reactive/memoize.ts +0 -186
- package/src/reactive/non-reactive-state.ts +0 -49
- package/src/reactive/non-reactive.ts +0 -43
- package/src/reactive/project.md +0 -107
- package/src/reactive/project.ts +0 -430
- package/src/reactive/proxy-state.ts +0 -27
- package/src/reactive/proxy.ts +0 -282
- package/src/reactive/record.ts +0 -181
- package/src/reactive/register.ts +0 -538
- package/src/reactive/registry.ts +0 -72
- package/src/reactive/set.ts +0 -117
- package/src/reactive/tracking.ts +0 -41
- package/src/reactive/types.ts +0 -520
- package/src/reactive/watch.ts +0 -180
- package/src/std-decorators.ts +0 -256
- package/src/utils.ts +0 -300
- package/src/zone.ts +0 -142
package/dist/debug/debug.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug utilities for the reactivity system
|
|
3
|
-
* - Captures effect metadata (names, parent relationships)
|
|
4
|
-
* - Records cause → consequence edges with object/prop labels
|
|
5
|
-
* - Provides graph data for tooling (DevTools panel, etc.)
|
|
6
|
-
*/
|
|
7
|
-
import { type EffectCleanup, type EffectTrigger, type Evolution } from '../src/reactive/types';
|
|
8
|
-
/**
|
|
9
|
-
* Log an error with detailed context if error logging is enabled
|
|
10
|
-
*/
|
|
11
|
-
export declare function logError(error: Error, context: 'throw' | 'catch', effect?: any): void;
|
|
12
|
-
export declare const debugOptions: {
|
|
13
|
-
/**
|
|
14
|
-
* Whether DevTools are enabled
|
|
15
|
-
*/
|
|
16
|
-
readonly enabled: boolean;
|
|
17
|
-
logErrors: boolean;
|
|
18
|
-
};
|
|
19
|
-
export type NodeKind = 'effect' | 'external' | 'state';
|
|
20
|
-
export type EdgeKind = 'cause' | 'dependency' | 'trigger';
|
|
21
|
-
export interface EffectNode {
|
|
22
|
-
id: string;
|
|
23
|
-
label: string;
|
|
24
|
-
type: NodeKind;
|
|
25
|
-
depth: number;
|
|
26
|
-
parentId?: string;
|
|
27
|
-
debugName?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface ObjectNode {
|
|
30
|
-
id: string;
|
|
31
|
-
label: string;
|
|
32
|
-
type: NodeKind;
|
|
33
|
-
debugName?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface GraphEdge {
|
|
36
|
-
id: string;
|
|
37
|
-
source: string;
|
|
38
|
-
target: string;
|
|
39
|
-
type: EdgeKind;
|
|
40
|
-
label: string;
|
|
41
|
-
count?: number;
|
|
42
|
-
}
|
|
43
|
-
export interface ReactivityGraph {
|
|
44
|
-
nodes: Array<EffectNode | ObjectNode>;
|
|
45
|
-
edges: GraphEdge[];
|
|
46
|
-
meta: {
|
|
47
|
-
generatedAt: number;
|
|
48
|
-
devtoolsEnabled: boolean;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Assign a debug-friendly name to an effect (shown in DevTools)
|
|
53
|
-
*/
|
|
54
|
-
export declare function setEffectName(effect: EffectTrigger | EffectCleanup, name: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Assign a debug-friendly name to a reactive object
|
|
57
|
-
*/
|
|
58
|
-
export declare function setObjectName(obj: object, name: string): void;
|
|
59
|
-
/**
|
|
60
|
-
* Register an effect so it appears in the DevTools graph
|
|
61
|
-
*/
|
|
62
|
-
export declare function registerEffectForDebug(effect: EffectTrigger): void;
|
|
63
|
-
/**
|
|
64
|
-
* Register a reactive object so it appears in the DevTools graph
|
|
65
|
-
*/
|
|
66
|
-
export declare function registerObjectForDebug(obj: object): void;
|
|
67
|
-
/**
|
|
68
|
-
* Records a cause → consequence relationship between effects.
|
|
69
|
-
* @param source - The effect performing the write (undefined if external/user input)
|
|
70
|
-
* @param target - The effect that re-ran because of the write
|
|
71
|
-
* @param obj - The reactive object that changed
|
|
72
|
-
* @param prop - The property that changed
|
|
73
|
-
* @param evolution - The type of change (set/add/del/bunch)
|
|
74
|
-
*/
|
|
75
|
-
export declare function recordTriggerLink(source: EffectTrigger | undefined, target: EffectTrigger, obj: object, prop: any, evolution: Evolution): void;
|
|
76
|
-
/**
|
|
77
|
-
* Traces back the chain of triggers that led to a specific effect
|
|
78
|
-
* @param effect The effect to trace back
|
|
79
|
-
* @param limit Max depth
|
|
80
|
-
*/
|
|
81
|
-
export declare function getTriggerChain(effect: EffectTrigger, limit?: number): string[];
|
|
82
|
-
/**
|
|
83
|
-
* Builds a graph representing current reactive state (effects, objects, and trigger edges)
|
|
84
|
-
*/
|
|
85
|
-
export declare function buildReactivityGraph(): ReactivityGraph;
|
|
86
|
-
/**
|
|
87
|
-
* Enables the DevTools bridge and exposes the debug API on window/global.
|
|
88
|
-
* Call as early as possible in development builds.
|
|
89
|
-
*/
|
|
90
|
-
export declare function enableDevTools(): void;
|
|
91
|
-
export declare function forceEnableGraphTracking(): void;
|
|
92
|
-
export declare function isDevtoolsEnabled(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Returns the raw dependency graph data structure.
|
|
95
|
-
* This is useful for programmatic analysis of the reactive system.
|
|
96
|
-
*/
|
|
97
|
-
export declare function getDependencyGraph(): {
|
|
98
|
-
nodes: (EffectNode | ObjectNode)[];
|
|
99
|
-
edges: GraphEdge[];
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Returns a list of effects that depend on the given object.
|
|
103
|
-
*/
|
|
104
|
-
export declare function getDependents(obj: object): EffectTrigger[];
|
|
105
|
-
/**
|
|
106
|
-
* Returns a list of objects that the given effect depends on.
|
|
107
|
-
*/
|
|
108
|
-
export declare function getDependencies(effect: EffectTrigger): object[];
|
|
109
|
-
export interface MutationRecord {
|
|
110
|
-
id: number;
|
|
111
|
-
timestamp: number;
|
|
112
|
-
source: string;
|
|
113
|
-
target: string;
|
|
114
|
-
objectName: string;
|
|
115
|
-
prop: string;
|
|
116
|
-
type: string;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Get the recent mutation history
|
|
120
|
-
*/
|
|
121
|
-
export declare function getMutationHistory(): MutationRecord[];
|
|
122
|
-
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../debug/debug.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAW,MAAM,uBAAuB,CAAA;AAIjH;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,MAAM,CAAC,EAAE,GAAG,QAc9E;AAoBD,eAAO,MAAM,YAAY;IACxB;;OAEG;;;CAKH,CAAA;AAcD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAA;AACtD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAA;AAEzD,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;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AAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,SAAI,GAAG,MAAM,EAAE,CAwC1E;AA6CD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CA0EtD;AAED;;;GAGG;AACH,wBAAgB,cAAc,SA8C7B;AAED,wBAAgB,wBAAwB,SAEvC;AAED,wBAAgB,iBAAiB,YAEhC;AAID;;;GAGG;AACH,wBAAgB,kBAAkB;;;EAKjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,EAAE,CAkB1D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAG/D;AAID,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACZ;AA4BD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAErD"}
|
package/dist/debug/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../debug/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-panel.d.ts","sourceRoot":"","sources":["../../debug/lineage-panel.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,gBAAgB,SA8J/B"}
|
package/dist/debug/lineage.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { type EffectTrigger } from '../src/reactive/types';
|
|
2
|
-
export declare const effectMarker: {
|
|
3
|
-
enter: string;
|
|
4
|
-
leave: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Structured stack frame
|
|
8
|
-
*/
|
|
9
|
-
export interface StackFrame {
|
|
10
|
-
functionName: string;
|
|
11
|
-
fileName: string;
|
|
12
|
-
lineNumber: number;
|
|
13
|
-
columnNumber: number;
|
|
14
|
-
raw: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Parses a single stack line into a structured frame.
|
|
18
|
-
* @param line - A line from Error.stack
|
|
19
|
-
*/
|
|
20
|
-
export declare function parseStackLine(line: string): StackFrame | null;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the current call stack
|
|
23
|
-
* @param skipFrames - Number of frames to skip
|
|
24
|
-
* @param error - Optional error to use as source of stack
|
|
25
|
-
*/
|
|
26
|
-
export declare function getStackFrame(error?: Error): StackFrame[];
|
|
27
|
-
/**
|
|
28
|
-
* Represents a segment in the effect lineage
|
|
29
|
-
*/
|
|
30
|
-
export interface LineageSegment {
|
|
31
|
-
effectName: string;
|
|
32
|
-
stack: StackFrame[];
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Traces the lineage of the current execution through nested effects
|
|
36
|
-
* @param effect - Starting effect (defaults to active effect)
|
|
37
|
-
*/
|
|
38
|
-
export declare function getLineage(effect?: EffectTrigger): LineageSegment[];
|
|
39
|
-
/**
|
|
40
|
-
* Formats lineage segments into a single stack-like string
|
|
41
|
-
* @param segments - Lineage segments
|
|
42
|
-
*/
|
|
43
|
-
export declare function formatLineage(segments: LineageSegment[]): string;
|
|
44
|
-
/**
|
|
45
|
-
* Logs lineage segments to console with grouping
|
|
46
|
-
* @param segments - Lineage segments
|
|
47
|
-
*/
|
|
48
|
-
export declare function nodeLineage(segments: LineageSegment[]): void;
|
|
49
|
-
/**
|
|
50
|
-
* Legacy version of nodeLineage that returns a formatted string (useful for comparison or logs)
|
|
51
|
-
* @param segments - Lineage segments
|
|
52
|
-
* @deprecated TODO: remove me and all the code running around
|
|
53
|
-
*/
|
|
54
|
-
export declare function nodeLineageLegacy(segments: LineageSegment[]): string;
|
|
55
|
-
/**
|
|
56
|
-
* Captures and logs lineage to console
|
|
57
|
-
*/
|
|
58
|
-
export declare function captureNodeLineage(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Custom formatter for Chrome DevTools to render lineage data nicely.
|
|
61
|
-
*/
|
|
62
|
-
export declare const lineageFormatter: {
|
|
63
|
-
header: (obj: any) => (string | {
|
|
64
|
-
style: string;
|
|
65
|
-
})[];
|
|
66
|
-
hasBody: (obj: any) => any;
|
|
67
|
-
body: (obj: any) => (string | {}[] | {
|
|
68
|
-
style: string;
|
|
69
|
-
})[];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Wraps lineage data in a way that the Chrome Formatter can recognize.
|
|
73
|
-
*/
|
|
74
|
-
export declare function wrapLineageForDebug(segments: LineageSegment[]): {
|
|
75
|
-
__isLineage__: boolean;
|
|
76
|
-
segments: LineageSegment[];
|
|
77
|
-
toString: () => string;
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../debug/lineage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D,eAAO,MAAM,YAAY;;;CAGxB,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;CACX;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAqB9D;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,QAAc,GAAG,UAAU,EAAE,CA8C/D;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,UAAU,EAAE,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,EAAE,CA8CnE;AAoCD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAYhE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAqC5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CA2CpE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;kBACd,GAAG;;;mBAeF,GAAG;gBACN,GAAG;;;CAsCf,CAAA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE;;;;EAM7D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/async/browser.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type Restorer = () => () => void;
|
|
2
|
-
export type Hook = () => Restorer;
|
|
3
|
-
export declare const hooks: Set<Hook>;
|
|
4
|
-
export declare const asyncHooks: {
|
|
5
|
-
addHook(hook: Hook): () => void;
|
|
6
|
-
/**
|
|
7
|
-
* [Hack] Sanitize a promise (or value) to prevent context leaks.
|
|
8
|
-
* Default: Identity function.
|
|
9
|
-
* Browser: Uses Macrotask wrapping to break microtask chains.
|
|
10
|
-
*/
|
|
11
|
-
sanitizePromise(p: any): any;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Register a hook that will be called whenever an asynchronous operation is initiated.
|
|
15
|
-
* The hook should return a restorer function which will be called just before the async callback runs.
|
|
16
|
-
* That restorer should in turn return an undoer function which will be called just after the async callback finishes.
|
|
17
|
-
*/
|
|
18
|
-
export declare const asyncHook: (hook: Hook) => () => void;
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/async/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,MAAM,IAAI,CAAA;AACvC,MAAM,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAA;AAGjC,eAAO,MAAM,KAAK,WAAkB,CAAA;AAEpC,eAAO,MAAM,UAAU;kBACR,IAAI,GAAG,MAAM,IAAI;IAI/B;;;;OAIG;uBACgB,GAAG,GAAG,GAAG;CAG5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,WAnBR,IAmBqC,CAAA"}
|
package/dist/src/async/node.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/async/node.ts"],"names":[],"mappings":""}
|
package/dist/src/decorator.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when decorator operations fail
|
|
3
|
-
*/
|
|
4
|
-
export declare class DecoratorError extends Error {
|
|
5
|
-
constructor(message: string);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Legacy property decorator type for methods, getters, and setters
|
|
9
|
-
*/
|
|
10
|
-
export type LegacyPropertyDecorator<T> = (target: T, name: string | symbol, descriptor: PropertyDescriptor) => any;
|
|
11
|
-
/**
|
|
12
|
-
* Legacy class decorator type
|
|
13
|
-
*/
|
|
14
|
-
export type LegacyClassDecorator<T> = (target: T) => any;
|
|
15
|
-
/**
|
|
16
|
-
* Modern method decorator type
|
|
17
|
-
*/
|
|
18
|
-
export type ModernMethodDecorator<T> = (target: T, context: ClassMethodDecoratorContext) => any;
|
|
19
|
-
/**
|
|
20
|
-
* Modern getter decorator type
|
|
21
|
-
*/
|
|
22
|
-
export type ModernGetterDecorator<T> = (target: T, context: ClassGetterDecoratorContext) => any;
|
|
23
|
-
/**
|
|
24
|
-
* Modern setter decorator type
|
|
25
|
-
*/
|
|
26
|
-
export type ModernSetterDecorator<T> = (target: T, context: ClassSetterDecoratorContext) => any;
|
|
27
|
-
/**
|
|
28
|
-
* Modern accessor decorator type
|
|
29
|
-
*/
|
|
30
|
-
export type ModernAccessorDecorator<T> = (target: T, context: ClassAccessorDecoratorContext) => any;
|
|
31
|
-
/**
|
|
32
|
-
* Modern class decorator type
|
|
33
|
-
*/
|
|
34
|
-
export type ModernClassDecorator<T> = (target: T, context: ClassDecoratorContext) => any;
|
|
35
|
-
type DDMethod<T> = (original: (this: T, ...args: any[]) => any, target: any, name: PropertyKey) => ((this: T, ...args: any[]) => any) | void;
|
|
36
|
-
type DDGetter<T> = (original: (this: T) => any, target: any, name: PropertyKey) => ((this: T) => any) | void;
|
|
37
|
-
type DDSetter<T> = (original: (this: T, value: any) => void, target: any, name: PropertyKey) => ((this: T, value: any) => void) | void;
|
|
38
|
-
type DDClass<T> = <Ctor extends new (...args: any[]) => T = new (...args: any[]) => T>(target: Ctor) => Ctor | void;
|
|
39
|
-
/**
|
|
40
|
-
* Description object for creating decorators that work with both Legacy and Modern decorator proposals
|
|
41
|
-
*/
|
|
42
|
-
export interface DecoratorDescription<T> {
|
|
43
|
-
/** Handler for method decorators */
|
|
44
|
-
method?: DDMethod<T>;
|
|
45
|
-
/** Handler for class decorators */
|
|
46
|
-
class?: DDClass<T>;
|
|
47
|
-
/** Handler for getter decorators */
|
|
48
|
-
getter?: DDGetter<T>;
|
|
49
|
-
/** Handler for setter decorators */
|
|
50
|
-
setter?: DDSetter<T>;
|
|
51
|
-
/** Default handler for any decorator type not explicitly defined */
|
|
52
|
-
default?: (...args: any[]) => any;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Type for decorators that work with both Legacy and Modern decorator proposals
|
|
56
|
-
* Automatically infers the correct decorator type based on the description
|
|
57
|
-
*/
|
|
58
|
-
export type Decorator<T, Description extends DecoratorDescription<T>> = (Description extends {
|
|
59
|
-
method: DDMethod<T>;
|
|
60
|
-
} ? LegacyPropertyDecorator<T> & ModernMethodDecorator<T> : unknown) & (Description extends {
|
|
61
|
-
class: DDClass<new (...args: any[]) => T>;
|
|
62
|
-
} ? LegacyClassDecorator<new (...args: any[]) => T> & ModernClassDecorator<new (...args: any[]) => T> : unknown) & (Description extends {
|
|
63
|
-
getter: DDGetter<T>;
|
|
64
|
-
} ? LegacyPropertyDecorator<T> & ModernGetterDecorator<T> & ModernAccessorDecorator<T> : unknown) & (Description extends {
|
|
65
|
-
setter: DDSetter<T>;
|
|
66
|
-
} ? LegacyPropertyDecorator<T> & ModernSetterDecorator<T> & ModernAccessorDecorator<T> : unknown) & (Description extends {
|
|
67
|
-
default: infer Signature;
|
|
68
|
-
} ? Signature : unknown);
|
|
69
|
-
/**
|
|
70
|
-
* Factory type for creating decorators that work with both Legacy and Modern decorator proposals
|
|
71
|
-
*/
|
|
72
|
-
export type DecoratorFactory<T> = <Description extends DecoratorDescription<T>>(description: Description) => (Description extends {
|
|
73
|
-
method: DDMethod<T>;
|
|
74
|
-
} ? LegacyPropertyDecorator<T> & ModernMethodDecorator<T> : unknown) & (Description extends {
|
|
75
|
-
class: DDClass<new (...args: any[]) => T>;
|
|
76
|
-
} ? LegacyClassDecorator<new (...args: any[]) => T> & ModernClassDecorator<new (...args: any[]) => T> : unknown) & (Description extends {
|
|
77
|
-
getter: DDGetter<T>;
|
|
78
|
-
} ? LegacyPropertyDecorator<T> & ModernGetterDecorator<T> & ModernAccessorDecorator<T> : unknown) & (Description extends {
|
|
79
|
-
setter: DDSetter<T>;
|
|
80
|
-
} ? LegacyPropertyDecorator<T> & ModernSetterDecorator<T> & ModernAccessorDecorator<T> : unknown) & (Description extends {
|
|
81
|
-
default: infer Signature;
|
|
82
|
-
} ? Signature : unknown);
|
|
83
|
-
/**
|
|
84
|
-
* Creates a decorator that works with Legacy decorator proposals
|
|
85
|
-
* @param description - The decorator description object
|
|
86
|
-
* @returns A decorator function compatible with Legacy decorators
|
|
87
|
-
*/
|
|
88
|
-
export declare function legacyDecorator<T = any>(description: DecoratorDescription<T>): any;
|
|
89
|
-
/**
|
|
90
|
-
* Creates a decorator that works with Modern decorator proposals
|
|
91
|
-
* @param description - The decorator description object
|
|
92
|
-
* @returns A decorator function compatible with Modern decorators
|
|
93
|
-
*/
|
|
94
|
-
export declare function modernDecorator<T = any>(description: DecoratorDescription<T>): any;
|
|
95
|
-
/**
|
|
96
|
-
* Main decorator factory that automatically detects and works with both Legacy and Modern decorator proposals
|
|
97
|
-
* @param description - The decorator description object
|
|
98
|
-
* @returns A decorator that works in both Legacy and Modern environments
|
|
99
|
-
*/
|
|
100
|
-
export declare const decorator: DecoratorFactory<any>;
|
|
101
|
-
/**
|
|
102
|
-
* Generic class decorator type that works with both Legacy and Modern decorator proposals
|
|
103
|
-
*/
|
|
104
|
-
export type GenericClassDecorator<T> = LegacyClassDecorator<abstract new (...args: any[]) => T> & ModernClassDecorator<abstract new (...args: any[]) => T>;
|
|
105
|
-
export {};
|
|
106
|
-
//# sourceMappingURL=decorator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.d.ts","sourceRoot":"","sources":["../../src/decorator.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI3B;AAID;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,CACxC,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,UAAU,EAAE,kBAAkB,KAC1B,GAAG,CAAA;AAER;;GAEG;AACH,MAAM,MAAM,oBAAoB,CA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C,GACX,CAAC,WAAW,SAAS;IAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;CAAE,GACzC,uBAAuB,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAClF,OAAO,CAAC,GACX,CAAC,WAAW,SAAS;IAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;CAAE,GACzC,uBAAuB,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAClF,OAAO,CAAC,GACX,CAAC,WAAW,SAAS;IAAE,OAAO,EAAE,MAAM,SAAS,CAAA;CAAE,GAAG,SAAS,GAAG,OAAO,CAAC,CAAA;AAEzE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,GAAG,CAwClF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,GAAG,CAwClF;AAuBD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,GAAG,CAS3C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,oBAAoB,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,GAC9F,oBAAoB,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Symbol for marking destructor methods
|
|
3
|
-
*/
|
|
4
|
-
export declare const destructor: unique symbol;
|
|
5
|
-
/**
|
|
6
|
-
* Symbol for accessing allocated values in destroyable objects
|
|
7
|
-
*/
|
|
8
|
-
export declare const allocatedValues: unique symbol;
|
|
9
|
-
/**
|
|
10
|
-
* Error thrown when attempting to access a destroyed object
|
|
11
|
-
*/
|
|
12
|
-
export declare class DestructionError extends Error {
|
|
13
|
-
static throw<_T = void>(msg: string): () => never;
|
|
14
|
-
constructor(msg: string);
|
|
15
|
-
}
|
|
16
|
-
declare abstract class AbstractDestroyable<Allocated> {
|
|
17
|
-
abstract [destructor](allocated: Allocated): void;
|
|
18
|
-
[Symbol.dispose](): void;
|
|
19
|
-
}
|
|
20
|
-
interface Destructor<Allocated> {
|
|
21
|
-
destructor(allocated: Allocated): void;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Creates a destroyable class with a base class and destructor object
|
|
25
|
-
* @param base - The base class to extend
|
|
26
|
-
* @param destructorObj - Object containing the destructor method
|
|
27
|
-
* @returns A destroyable class with static destroy and isDestroyable methods
|
|
28
|
-
*/
|
|
29
|
-
export declare function Destroyable<T extends new (...args: any[]) => any, Allocated extends Partial<InstanceType<T>>>(base: T, destructorObj: Destructor<Allocated>): (new (...args: ConstructorParameters<T>) => InstanceType<T> & {
|
|
30
|
-
[allocatedValues]: Allocated;
|
|
31
|
-
}) & {
|
|
32
|
-
destroy(obj: InstanceType<T>): boolean;
|
|
33
|
-
isDestroyable(obj: InstanceType<T>): boolean;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Creates a destroyable class with only a destructor object (no base class)
|
|
37
|
-
* @param destructorObj - Object containing the destructor method
|
|
38
|
-
* @returns A destroyable class with static destroy and isDestroyable methods
|
|
39
|
-
*/
|
|
40
|
-
export declare function Destroyable<Allocated extends Record<PropertyKey, any> = Record<PropertyKey, any>>(destructorObj: Destructor<Allocated>): (new () => {
|
|
41
|
-
[allocatedValues]: Allocated;
|
|
42
|
-
}) & {
|
|
43
|
-
destroy(obj: any): boolean;
|
|
44
|
-
isDestroyable(obj: any): boolean;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Creates a destroyable class with a base class (requires [destructor] method)
|
|
48
|
-
* @param base - The base class to extend
|
|
49
|
-
* @returns A destroyable class with static destroy and isDestroyable methods
|
|
50
|
-
*/
|
|
51
|
-
export declare function Destroyable<T extends new (...args: any[]) => any, Allocated extends Record<PropertyKey, any> = Record<PropertyKey, any>>(base: T): (new (...args: ConstructorParameters<T>) => AbstractDestroyable<Allocated> & InstanceType<T> & {
|
|
52
|
-
[allocatedValues]: Allocated;
|
|
53
|
-
}) & {
|
|
54
|
-
destroy(obj: InstanceType<T>): boolean;
|
|
55
|
-
isDestroyable(obj: InstanceType<T>): boolean;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* Creates an abstract destroyable base class
|
|
59
|
-
* @returns An abstract destroyable class with static destroy and isDestroyable methods
|
|
60
|
-
*/
|
|
61
|
-
export declare function Destroyable<Allocated extends Record<PropertyKey, any> = Record<PropertyKey, any>>(): abstract new () => (AbstractDestroyable<Allocated> & {
|
|
62
|
-
[allocatedValues]: Allocated;
|
|
63
|
-
}) & {
|
|
64
|
-
destroy(obj: any): boolean;
|
|
65
|
-
isDestroyable(obj: any): boolean;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Decorator that marks properties to be stored in the allocated object and passed to the destructor
|
|
69
|
-
* Use with accessor properties or explicit get/set pairs
|
|
70
|
-
*/
|
|
71
|
-
export declare const allocated: import("./decorator").LegacyPropertyDecorator<any> & import("./decorator").ModernSetterDecorator<any> & import("./decorator").ModernAccessorDecorator<any>;
|
|
72
|
-
/**
|
|
73
|
-
* Registers a callback to be called when an object is garbage collected
|
|
74
|
-
* @param cb - The callback function to execute on garbage collection
|
|
75
|
-
* @returns The object whose reference can be collected
|
|
76
|
-
*/
|
|
77
|
-
export declare function callOnGC(cb: () => void): () => void;
|
|
78
|
-
/**
|
|
79
|
-
* Context Manager Protocol for `using` statement integration
|
|
80
|
-
* Provides automatic resource cleanup when used with the `using` statement
|
|
81
|
-
*/
|
|
82
|
-
export interface ContextManager<T = any> {
|
|
83
|
-
[Symbol.dispose](): void;
|
|
84
|
-
value?: T;
|
|
85
|
-
}
|
|
86
|
-
export {};
|
|
87
|
-
//# sourceMappingURL=destroyable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"destroyable.d.ts","sourceRoot":"","sources":["../../src/destroyable.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,UAAU,eAAuB,CAAA;AAC9C;;GAEG;AACH,eAAO,MAAM,eAAe,eAAsB,CAAA;AAClD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAC1C,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM;gBAKvB,GAAG,EAAE,MAAM;CAIvB;AAOD,uBAAe,mBAAmB,CAAC,SAAS;IAC3C,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IACjD,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGxB;AAED,UAAU,UAAU,CAAC,SAAS;IAC7B,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAA;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,CAAC,SAAS,KACT,GAAG,IAAI,EAAE,GAAG,EAAE,KACV,GAAG,EACR,SAAS,SAAS,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAE1C,IAAI,EAAE,CAAC,EACP,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,GAClC,CAAC,KACH,GAAG,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAC7B,YAAY,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,eAAe,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,GAAG;IAC1D,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;IACtC,aAAa,CAAC,GAAG,EAAE,YAAY,CA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G;IACJ,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAA;IAC1B,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAA;CAChC,CAAA;AAwDD;;;GAGG;AACH,eAAO,MAAM,SAAS,4JAOpB,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,cAStC;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG;IACtC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,CAAC,CAAA;CACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-browser.d.ts","sourceRoot":"","sources":["../../src/entry-browser.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAA;AAGxB,cAAc,SAAS,CAAA"}
|
package/dist/src/entry-node.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-node.d.ts","sourceRoot":"","sources":["../../src/entry-node.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAA;AAGrB,cAAc,SAAS,CAAA"}
|
package/dist/src/eventful.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base type for event maps - all event handlers must be functions
|
|
3
|
-
*/
|
|
4
|
-
export type EventsBase = Record<string, (...args: any[]) => void>;
|
|
5
|
-
declare const events: unique symbol;
|
|
6
|
-
declare const hooks: unique symbol;
|
|
7
|
-
/**
|
|
8
|
-
* A type-safe event system that provides a clean API for event handling
|
|
9
|
-
* @template Events - The event map defining event names and their handler signatures
|
|
10
|
-
*/
|
|
11
|
-
export declare class Eventful<Events extends EventsBase> {
|
|
12
|
-
private readonly [events];
|
|
13
|
-
private readonly [hooks];
|
|
14
|
-
hook(cb: <EventType extends keyof Events>(event: EventType, ...args: Parameters<Events[EventType]>) => void): () => void;
|
|
15
|
-
on: ((events: Partial<Events>) => void) & (<EventType extends keyof Events>(event: EventType, cb: Events[EventType]) => () => void) & { [event in keyof Events]: (cb: Events[event]) => () => void; };
|
|
16
|
-
off: ((events: Partial<Events>) => void) & (<EventType extends keyof Events>(event: EventType, cb?: Events[EventType]) => void) & { [event in keyof Events]: (cb?: Events[event]) => void; };
|
|
17
|
-
emit: (<EventType extends keyof Events>(event: EventType, ...args: Parameters<Events[EventType]>) => void) & Events;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=eventful.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventful.d.ts","sourceRoot":"","sources":["../../src/eventful.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC,CAAA;AAEjE,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,KAAK,eAAkB,CAAA;AAqE7B;;;GAGG;AACH,qBAAa,QAAQ,CAAC,MAAM,SAAS,UAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAyD;IAClF,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAsC;IAEvD,IAAI,CACV,EAAE,EAAE,CAAC,SAAS,SAAS,MAAM,MAAM,EAClC,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAClC,IAAI,GACP,MAAM,IAAI;IAON,EAAE,EAAuC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GAClF,CAAC,CAAC,SAAS,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,GAAG,GAC1F,KAAK,IAAI,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,IAAI,GAC1D,CAAA;IACK,GAAG,EAAwC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GACpF,CAAC,CAAC,SAAS,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,GAAG,GACrF,KAAK,IAAI,MAAM,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,GACrD,CAAA;IAEK,IAAI,EAAgD,CAAC,CAAC,SAAS,SAAS,MAAM,MAAM,EAC1F,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAClC,IAAI,CAAC,GACT,MAAM,CAAA;CACP"}
|
package/dist/src/flavored.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a flavored (extensible) version of a function with chainable property modifiers.
|
|
3
|
-
*/
|
|
4
|
-
export declare function flavored<T extends (...args: any[]) => any, F extends Record<string, any>>(fn: T, flavors: F): T & F;
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new flavored function that transforms arguments before calling the base.
|
|
7
|
-
*
|
|
8
|
-
* @param fn - The base flavored function
|
|
9
|
-
* @param transform - Function that receives the original arguments and returns transformed arguments
|
|
10
|
-
* @returns A new flavored function with the transformation applied
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* const loudGreet = createFlavor(greet, (name, opts) => [name, { ...opts, loud: true }])
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare function createFlavor<T extends (...args: any[]) => any>(fn: T, transform: (...args: Parameters<T>) => Parameters<T>, name?: string): T;
|
|
18
|
-
/**
|
|
19
|
-
* Creates a new flavored function that merges options objects.
|
|
20
|
-
* Useful when the last argument is an options object that should be merged.
|
|
21
|
-
*
|
|
22
|
-
* @param fn - The base flavored function
|
|
23
|
-
* @param defaultOptions - Options to merge with the provided options
|
|
24
|
-
* @returns A new flavored function with merged options
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* const opaqueEffect = flavorOptions(effect, { opaque: true })
|
|
29
|
-
* const namedEffect = flavorOptions(effect, { name: 'myEffect' })
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function flavorOptions<T extends (...args: any[]) => any>(fn: T, defaultOptions: Record<string, any>, name?: string): T;
|
|
33
|
-
//# sourceMappingURL=flavored.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flavored.d.ts","sourceRoot":"","sources":["../../src/flavored.ts"],"names":[],"mappings":"AA8BA;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACxF,EAAE,EAAE,CAAC,EACL,OAAO,EAAE,CAAC,GACR,CAAC,GAAG,CAAC,CAYP;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC7D,EAAE,EAAE,CAAC,EACL,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,EACpD,IAAI,CAAC,EAAE,MAAM,GACX,CAAC,CAOH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC9D,EAAE,EAAE,CAAC,EACL,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,IAAI,CAAC,EAAE,MAAM,GACX,CAAC,CAYH"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './async';
|
|
2
|
-
export * from './decorator';
|
|
3
|
-
export * from './destroyable';
|
|
4
|
-
export * from './eventful';
|
|
5
|
-
export * from './flavored';
|
|
6
|
-
export * from './indexable';
|
|
7
|
-
export * from './iterableWeak';
|
|
8
|
-
export * from './mixins';
|
|
9
|
-
export * from './promiseChain';
|
|
10
|
-
export * from './reactive';
|
|
11
|
-
export * from './std-decorators';
|
|
12
|
-
export * from './utils';
|
|
13
|
-
export * from './zone';
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
|