mutts 1.0.6 → 1.0.7

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.
Files changed (110) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.d.ts +2 -0
  3. package/dist/browser.esm.js +70 -0
  4. package/dist/browser.esm.js.map +1 -0
  5. package/dist/browser.js +161 -0
  6. package/dist/browser.js.map +1 -0
  7. package/dist/chunks/{index-CDCOjzTy.js → index-BFYK02LG.js} +5760 -4338
  8. package/dist/chunks/index-BFYK02LG.js.map +1 -0
  9. package/dist/chunks/{index-DiP0RXoZ.esm.js → index-CNR6QRUl.esm.js} +5440 -4054
  10. package/dist/chunks/index-CNR6QRUl.esm.js.map +1 -0
  11. package/dist/devtools/panel.js.map +1 -1
  12. package/dist/mutts.umd.js +1 -1
  13. package/dist/mutts.umd.js.map +1 -1
  14. package/dist/mutts.umd.min.js +1 -1
  15. package/dist/mutts.umd.min.js.map +1 -1
  16. package/dist/node.d.ts +2 -0
  17. package/dist/node.esm.js +45 -0
  18. package/dist/node.esm.js.map +1 -0
  19. package/dist/node.js +136 -0
  20. package/dist/node.js.map +1 -0
  21. package/docs/ai/api-reference.md +0 -2
  22. package/docs/reactive/advanced.md +2 -5
  23. package/docs/reactive/collections.md +0 -125
  24. package/docs/reactive/core.md +27 -24
  25. package/docs/reactive/debugging.md +12 -2
  26. package/docs/reactive/project.md +1 -1
  27. package/docs/reactive/scan.md +78 -0
  28. package/docs/reactive.md +2 -1
  29. package/docs/std-decorators.md +1 -0
  30. package/docs/zone.md +88 -0
  31. package/package.json +42 -10
  32. package/src/async/browser.ts +87 -0
  33. package/src/async/index.ts +8 -0
  34. package/src/async/node.ts +46 -0
  35. package/src/decorator.ts +5 -1
  36. package/src/destroyable.ts +1 -1
  37. package/src/index.ts +22 -14
  38. package/src/indexable.ts +42 -0
  39. package/src/mixins.ts +2 -2
  40. package/src/reactive/array.ts +149 -141
  41. package/src/reactive/buffer.ts +168 -0
  42. package/src/reactive/change.ts +2 -2
  43. package/src/reactive/effect-context.ts +15 -91
  44. package/src/reactive/effects.ts +119 -179
  45. package/src/reactive/index.ts +10 -13
  46. package/src/reactive/interface.ts +19 -33
  47. package/src/reactive/map.ts +48 -61
  48. package/src/reactive/memoize.ts +19 -9
  49. package/src/reactive/project.ts +43 -22
  50. package/src/reactive/proxy.ts +16 -41
  51. package/src/reactive/record.ts +3 -3
  52. package/src/reactive/register.ts +5 -7
  53. package/src/reactive/registry.ts +9 -17
  54. package/src/reactive/set.ts +42 -56
  55. package/src/reactive/tracking.ts +1 -29
  56. package/src/reactive/types.ts +46 -23
  57. package/src/utils.ts +80 -37
  58. package/src/zone.ts +127 -0
  59. package/dist/chunks/_tslib-BgjropY9.js +0 -81
  60. package/dist/chunks/_tslib-BgjropY9.js.map +0 -1
  61. package/dist/chunks/_tslib-MCKDzsSq.esm.js +0 -75
  62. package/dist/chunks/_tslib-MCKDzsSq.esm.js.map +0 -1
  63. package/dist/chunks/decorator-BGILvPtN.esm.js +0 -627
  64. package/dist/chunks/decorator-BGILvPtN.esm.js.map +0 -1
  65. package/dist/chunks/decorator-BQ2eBTCj.js +0 -651
  66. package/dist/chunks/decorator-BQ2eBTCj.js.map +0 -1
  67. package/dist/chunks/index-CDCOjzTy.js.map +0 -1
  68. package/dist/chunks/index-DiP0RXoZ.esm.js.map +0 -1
  69. package/dist/decorator.d.ts +0 -107
  70. package/dist/decorator.esm.js +0 -2
  71. package/dist/decorator.esm.js.map +0 -1
  72. package/dist/decorator.js +0 -11
  73. package/dist/decorator.js.map +0 -1
  74. package/dist/destroyable.d.ts +0 -90
  75. package/dist/destroyable.esm.js +0 -109
  76. package/dist/destroyable.esm.js.map +0 -1
  77. package/dist/destroyable.js +0 -116
  78. package/dist/destroyable.js.map +0 -1
  79. package/dist/eventful.d.ts +0 -20
  80. package/dist/eventful.esm.js +0 -66
  81. package/dist/eventful.esm.js.map +0 -1
  82. package/dist/eventful.js +0 -68
  83. package/dist/eventful.js.map +0 -1
  84. package/dist/index.d.ts +0 -19
  85. package/dist/index.esm.js +0 -53
  86. package/dist/index.esm.js.map +0 -1
  87. package/dist/index.js +0 -139
  88. package/dist/index.js.map +0 -1
  89. package/dist/indexable.d.ts +0 -243
  90. package/dist/indexable.esm.js +0 -285
  91. package/dist/indexable.esm.js.map +0 -1
  92. package/dist/indexable.js +0 -291
  93. package/dist/indexable.js.map +0 -1
  94. package/dist/promiseChain.d.ts +0 -21
  95. package/dist/promiseChain.esm.js +0 -78
  96. package/dist/promiseChain.esm.js.map +0 -1
  97. package/dist/promiseChain.js +0 -80
  98. package/dist/promiseChain.js.map +0 -1
  99. package/dist/reactive.d.ts +0 -910
  100. package/dist/reactive.esm.js +0 -5
  101. package/dist/reactive.esm.js.map +0 -1
  102. package/dist/reactive.js +0 -59
  103. package/dist/reactive.js.map +0 -1
  104. package/dist/std-decorators.d.ts +0 -52
  105. package/dist/std-decorators.esm.js +0 -196
  106. package/dist/std-decorators.esm.js.map +0 -1
  107. package/dist/std-decorators.js +0 -204
  108. package/dist/std-decorators.js.map +0 -1
  109. package/src/reactive/mapped.ts +0 -129
  110. package/src/reactive/zone.ts +0 -208
@@ -1,5 +0,0 @@
1
- export { R as ReactiveBase, b as ReadOnlyError, c as Register, d as addBatchCleanup, e as atomic, f as batch, g as biDi, h as buildReactivityGraph, i as cleanedBy, j as cleanup, k as deepWatch, l as defer, m as derived, n as effect, o as enableDevTools, p as getActivationLog, q as getActiveEffect, r as getActiveProjection, s as getState, t as immutables, u as isDevtoolsEnabled, v as isNonReactive, w as isReactive, x as isZoneEnabled, y as mapped, z as memoize, B as organize, C as organized, D as profileInfo, E as project, F as reactive, G as reduced, H as register, J as registerEffectForDebug, K as registerNativeReactivity, L as registerObjectForDebug, M as root, N as setEffectName, O as setObjectName, P as setZoneEnabled, Q as touched, S as touched1, T as trackEffect, U as unreactive, V as untracked, W as unwrap, X as watch } from './chunks/index-DiP0RXoZ.esm.js';
2
- export { R as ReactiveError, o as reactiveOptions } from './chunks/decorator-BGILvPtN.esm.js';
3
- import './indexable.esm.js';
4
- import './chunks/_tslib-MCKDzsSq.esm.js';
5
- //# sourceMappingURL=reactive.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactive.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
package/dist/reactive.js DELETED
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- var reactive = require('./chunks/index-CDCOjzTy.js');
4
- var decorator = require('./chunks/decorator-BQ2eBTCj.js');
5
- require('./indexable.js');
6
- require('./chunks/_tslib-BgjropY9.js');
7
-
8
-
9
-
10
- exports.ReactiveBase = reactive.ReactiveBase;
11
- exports.ReadOnlyError = reactive.ReadOnlyError;
12
- exports.Register = reactive.Register;
13
- exports.addBatchCleanup = reactive.addBatchCleanup;
14
- exports.atomic = reactive.atomic;
15
- exports.batch = reactive.batch;
16
- exports.biDi = reactive.biDi;
17
- exports.buildReactivityGraph = reactive.buildReactivityGraph;
18
- exports.cleanedBy = reactive.cleanedBy;
19
- exports.cleanup = reactive.cleanup;
20
- exports.deepWatch = reactive.deepWatch;
21
- exports.defer = reactive.defer;
22
- exports.derived = reactive.derived;
23
- exports.effect = reactive.effect;
24
- exports.enableDevTools = reactive.enableDevTools;
25
- exports.getActivationLog = reactive.getActivationLog;
26
- exports.getActiveEffect = reactive.getActiveEffect;
27
- exports.getActiveProjection = reactive.getActiveProjection;
28
- exports.getState = reactive.getState;
29
- exports.immutables = reactive.immutables;
30
- exports.isDevtoolsEnabled = reactive.isDevtoolsEnabled;
31
- exports.isNonReactive = reactive.isNonReactive;
32
- exports.isReactive = reactive.isReactive;
33
- exports.isZoneEnabled = reactive.isZoneEnabled;
34
- exports.mapped = reactive.mapped;
35
- exports.memoize = reactive.memoize;
36
- exports.organize = reactive.organize;
37
- exports.organized = reactive.organized;
38
- exports.profileInfo = reactive.profileInfo;
39
- exports.project = reactive.project;
40
- exports.reactive = reactive.reactive;
41
- exports.reduced = reactive.reduced;
42
- exports.register = reactive.register;
43
- exports.registerEffectForDebug = reactive.registerEffectForDebug;
44
- exports.registerNativeReactivity = reactive.registerNativeReactivity;
45
- exports.registerObjectForDebug = reactive.registerObjectForDebug;
46
- exports.root = reactive.root;
47
- exports.setEffectName = reactive.setEffectName;
48
- exports.setObjectName = reactive.setObjectName;
49
- exports.setZoneEnabled = reactive.setZoneEnabled;
50
- exports.touched = reactive.touched;
51
- exports.touched1 = reactive.touched1;
52
- exports.trackEffect = reactive.trackEffect;
53
- exports.unreactive = reactive.unreactive;
54
- exports.untracked = reactive.untracked;
55
- exports.unwrap = reactive.unwrap;
56
- exports.watch = reactive.watch;
57
- exports.ReactiveError = decorator.ReactiveError;
58
- exports.reactiveOptions = decorator.options;
59
- //# sourceMappingURL=reactive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactive.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,52 +0,0 @@
1
- import { LegacyPropertyDecorator, ModernGetterDecorator, ModernAccessorDecorator, ModernMethodDecorator, LegacyClassDecorator, ModernClassDecorator, ModernSetterDecorator, GenericClassDecorator } from './decorator.js';
2
-
3
- /**
4
- * Decorator that caches the result of a getter method and only recomputes when dependencies change
5
- * Prevents circular dependencies and provides automatic cache invalidation
6
- */
7
- declare const cached: LegacyPropertyDecorator<any> & ModernGetterDecorator<any> & ModernAccessorDecorator<any>;
8
- /**
9
- * Checks if a property is cached (has a cached value)
10
- * @param object - The object to check
11
- * @param propertyKey - The property key to check
12
- * @returns True if the property has a cached value
13
- */
14
- declare function isCached(object: Object, propertyKey: PropertyKey): boolean;
15
- /**
16
- * Caches a value for a property on an object
17
- * @param object - The object to cache the value on
18
- * @param propertyKey - The property key to cache
19
- * @param value - The value to cache
20
- */
21
- declare function cache(object: Object, propertyKey: PropertyKey, value: any): void;
22
- /**
23
- * Creates a decorator that modifies property descriptors for specified properties
24
- * @param descriptor - The descriptor properties to apply
25
- * @returns A class decorator that applies the descriptor to specified properties
26
- */
27
- declare function describe(descriptor: {
28
- enumerable?: boolean;
29
- configurable?: boolean;
30
- writable?: boolean;
31
- }): <T>(...properties: (keyof T)[]) => GenericClassDecorator<T>;
32
- /**
33
- * Decorator that marks methods, properties, or classes as deprecated
34
- * Provides warning messages when deprecated items are used
35
- */
36
- declare const deprecated: LegacyPropertyDecorator<any> & ModernMethodDecorator<any> & LegacyClassDecorator<new (...args: any[]) => any> & ModernClassDecorator<new (...args: any[]) => any> & ModernGetterDecorator<any> & ModernAccessorDecorator<any> & ModernSetterDecorator<any> & ((message: string) => LegacyPropertyDecorator<any> & ModernMethodDecorator<any> & LegacyClassDecorator<new (...args: any[]) => any> & ModernClassDecorator<new (...args: any[]) => any> & ModernGetterDecorator<any> & ModernAccessorDecorator<any> & ModernSetterDecorator<any>) & {
37
- warn: (target: any, propertyKey: PropertyKey, message?: string) => void;
38
- };
39
- /**
40
- * Creates a debounced method decorator that delays execution until after the delay period has passed
41
- * @param delay - The delay in milliseconds
42
- * @returns A method decorator that debounces method calls
43
- */
44
- declare function debounce(delay: number): LegacyPropertyDecorator<any> & ModernMethodDecorator<any>;
45
- /**
46
- * Creates a throttled method decorator that limits execution to once per delay period
47
- * @param delay - The delay in milliseconds
48
- * @returns A method decorator that throttles method calls
49
- */
50
- declare function throttle(delay: number): LegacyPropertyDecorator<any> & ModernMethodDecorator<any>;
51
-
52
- export { cache, cached, debounce, deprecated, describe, isCached, throttle };
@@ -1,196 +0,0 @@
1
- import { d as decorator } from './chunks/decorator-BGILvPtN.esm.js';
2
-
3
- // In order to avoid async re-entrance, we could use zone.js or something like that.
4
- const syncCalculating = [];
5
- /**
6
- * Decorator that caches the result of a getter method and only recomputes when dependencies change
7
- * Prevents circular dependencies and provides automatic cache invalidation
8
- */
9
- const cached = decorator({
10
- getter(original, _target, propertyKey) {
11
- return function () {
12
- const alreadyCalculating = syncCalculating.findIndex((c) => c.object === this && c.prop === propertyKey);
13
- if (alreadyCalculating > -1)
14
- throw new Error(`Circular dependency detected: ${syncCalculating
15
- .slice(alreadyCalculating)
16
- .map((c) => `${c.object.constructor.name}.${String(c.prop)}`)
17
- .join(' -> ')} -> again`);
18
- syncCalculating.push({ object: this, prop: propertyKey });
19
- try {
20
- const rv = original.call(this);
21
- cache(this, propertyKey, rv);
22
- return rv;
23
- }
24
- finally {
25
- syncCalculating.pop();
26
- }
27
- };
28
- },
29
- });
30
- /**
31
- * Checks if a property is cached (has a cached value)
32
- * @param object - The object to check
33
- * @param propertyKey - The property key to check
34
- * @returns True if the property has a cached value
35
- */
36
- function isCached(object, propertyKey) {
37
- return !!Object.getOwnPropertyDescriptor(object, propertyKey);
38
- }
39
- /**
40
- * Caches a value for a property on an object
41
- * @param object - The object to cache the value on
42
- * @param propertyKey - The property key to cache
43
- * @param value - The value to cache
44
- */
45
- function cache(object, propertyKey, value) {
46
- Object.defineProperty(object, propertyKey, { value });
47
- }
48
- /**
49
- * Creates a decorator that modifies property descriptors for specified properties
50
- * @param descriptor - The descriptor properties to apply
51
- * @returns A class decorator that applies the descriptor to specified properties
52
- */
53
- function describe(descriptor) {
54
- return (...properties) => (Base) => {
55
- return class extends Base {
56
- constructor(...args) {
57
- super(...args);
58
- for (const key of properties) {
59
- Object.defineProperty(this, key, {
60
- ...Object.getOwnPropertyDescriptor(this, key),
61
- ...descriptor,
62
- });
63
- }
64
- }
65
- };
66
- };
67
- }
68
- /**
69
- * Decorator that marks methods, properties, or classes as deprecated
70
- * Provides warning messages when deprecated items are used
71
- */
72
- const deprecated = Object.assign(decorator({
73
- method(original, _target, propertyKey) {
74
- return function (...args) {
75
- deprecated.warn(this, propertyKey);
76
- return original.apply(this, args);
77
- };
78
- },
79
- getter(original, _target, propertyKey) {
80
- return function () {
81
- deprecated.warn(this, propertyKey);
82
- return original.call(this);
83
- };
84
- },
85
- setter(original, _target, propertyKey) {
86
- return function (value) {
87
- deprecated.warn(this, propertyKey);
88
- return original.call(this, value);
89
- };
90
- },
91
- class(original) {
92
- return class extends original {
93
- constructor(...args) {
94
- super(...args);
95
- deprecated.warn(this, 'constructor');
96
- }
97
- };
98
- },
99
- default(message) {
100
- return decorator({
101
- method(original, _target, propertyKey) {
102
- return function (...args) {
103
- deprecated.warn(this, propertyKey, message);
104
- return original.apply(this, args);
105
- };
106
- },
107
- getter(original, _target, propertyKey) {
108
- return function () {
109
- deprecated.warn(this, propertyKey, message);
110
- return original.call(this);
111
- };
112
- },
113
- setter(original, _target, propertyKey) {
114
- return function (value) {
115
- deprecated.warn(this, propertyKey, message);
116
- return original.call(this, value);
117
- };
118
- },
119
- class(original) {
120
- return class extends original {
121
- constructor(...args) {
122
- super(...args);
123
- deprecated.warn(this, 'constructor', message);
124
- }
125
- };
126
- },
127
- });
128
- },
129
- }), {
130
- warn: (target, propertyKey, message) => {
131
- // biome-ignore lint/suspicious/noConsole: To be overridden
132
- console.warn(`${target.constructor.name}.${String(propertyKey)} is deprecated${message ? `: ${message}` : ''}`);
133
- },
134
- });
135
- /**
136
- * Creates a debounced method decorator that delays execution until after the delay period has passed
137
- * @param delay - The delay in milliseconds
138
- * @returns A method decorator that debounces method calls
139
- */
140
- function debounce(delay) {
141
- return decorator({
142
- method(original, _target, _propertyKey) {
143
- let timeoutId = null;
144
- return function (...args) {
145
- // Clear existing timeout
146
- if (timeoutId) {
147
- clearTimeout(timeoutId);
148
- }
149
- // Set new timeout
150
- timeoutId = setTimeout(() => {
151
- original.apply(this, args);
152
- timeoutId = null;
153
- }, delay);
154
- };
155
- },
156
- });
157
- }
158
- /**
159
- * Creates a throttled method decorator that limits execution to once per delay period
160
- * @param delay - The delay in milliseconds
161
- * @returns A method decorator that throttles method calls
162
- */
163
- function throttle(delay) {
164
- return decorator({
165
- method(original, _target, _propertyKey) {
166
- let lastCallTime = 0;
167
- let timeoutId = null;
168
- return function (...args) {
169
- const now = Date.now();
170
- // If enough time has passed since last call, execute immediately
171
- if (now - lastCallTime >= delay) {
172
- // Clear any pending timeout since we're executing now
173
- if (timeoutId) {
174
- clearTimeout(timeoutId);
175
- timeoutId = null;
176
- }
177
- lastCallTime = now;
178
- return original.apply(this, args);
179
- }
180
- // Otherwise, schedule execution for when the delay period ends
181
- if (!timeoutId) {
182
- const remainingTime = delay - (now - lastCallTime);
183
- const scheduledArgs = [...args]; // Capture args at scheduling time
184
- timeoutId = setTimeout(() => {
185
- lastCallTime = Date.now();
186
- original.apply(this, scheduledArgs);
187
- timeoutId = null;
188
- }, remainingTime);
189
- }
190
- };
191
- },
192
- });
193
- }
194
-
195
- export { cache, cached, debounce, deprecated, describe, isCached, throttle };
196
- //# sourceMappingURL=std-decorators.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"std-decorators.esm.js","sources":["../src/std-decorators.ts"],"sourcesContent":["import { decorator, type GenericClassDecorator } from './decorator'\n\n// In order to avoid async re-entrance, we could use zone.js or something like that.\nconst syncCalculating: { object: object; prop: PropertyKey }[] = []\n/**\n * Decorator that caches the result of a getter method and only recomputes when dependencies change\n * Prevents circular dependencies and provides automatic cache invalidation\n */\nexport const cached = decorator({\n\tgetter(original, _target, propertyKey) {\n\t\treturn function (this: any) {\n\t\t\tconst alreadyCalculating = syncCalculating.findIndex(\n\t\t\t\t(c) => c.object === this && c.prop === propertyKey\n\t\t\t)\n\t\t\tif (alreadyCalculating > -1)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Circular dependency detected: ${syncCalculating\n\t\t\t\t\t\t.slice(alreadyCalculating)\n\t\t\t\t\t\t.map((c) => `${c.object.constructor.name}.${String(c.prop)}`)\n\t\t\t\t\t\t.join(' -> ')} -> again`\n\t\t\t\t)\n\t\t\tsyncCalculating.push({ object: this, prop: propertyKey })\n\t\t\ttry {\n\t\t\t\tconst rv = original.call(this)\n\t\t\t\tcache(this, propertyKey, rv)\n\t\t\t\treturn rv\n\t\t\t} finally {\n\t\t\t\tsyncCalculating.pop()\n\t\t\t}\n\t\t}\n\t},\n})\n\n/**\n * Checks if a property is cached (has a cached value)\n * @param object - The object to check\n * @param propertyKey - The property key to check\n * @returns True if the property has a cached value\n */\nexport function isCached(object: Object, propertyKey: PropertyKey) {\n\treturn !!Object.getOwnPropertyDescriptor(object, propertyKey)\n}\n\n/**\n * Caches a value for a property on an object\n * @param object - The object to cache the value on\n * @param propertyKey - The property key to cache\n * @param value - The value to cache\n */\nexport function cache(object: Object, propertyKey: PropertyKey, value: any) {\n\tObject.defineProperty(object, propertyKey, { value })\n}\n\n/**\n * Creates a decorator that modifies property descriptors for specified properties\n * @param descriptor - The descriptor properties to apply\n * @returns A class decorator that applies the descriptor to specified properties\n */\nexport function describe(descriptor: {\n\tenumerable?: boolean\n\tconfigurable?: boolean // Not modifiable once the property has been defined ?\n\twritable?: boolean\n}) {\n\treturn <T>(...properties: (keyof T)[]): GenericClassDecorator<T> =>\n\t\t(Base) => {\n\t\t\treturn class extends Base {\n\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\tsuper(...args)\n\t\t\t\t\tfor (const key of properties) {\n\t\t\t\t\t\tObject.defineProperty(this, key, {\n\t\t\t\t\t\t\t...Object.getOwnPropertyDescriptor(this, key),\n\t\t\t\t\t\t\t...descriptor,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\n/**\n * Decorator that marks methods, properties, or classes as deprecated\n * Provides warning messages when deprecated items are used\n */\nexport const deprecated = Object.assign(\n\tdecorator({\n\t\tmethod(original, _target, propertyKey) {\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.apply(this, args)\n\t\t\t}\n\t\t},\n\t\tgetter(original, _target, propertyKey) {\n\t\t\treturn function (this: any) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.call(this)\n\t\t\t}\n\t\t},\n\t\tsetter(original, _target, propertyKey) {\n\t\t\treturn function (this: any, value: any) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.call(this, value)\n\t\t\t}\n\t\t},\n\t\tclass(original) {\n\t\t\treturn class extends original {\n\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\tsuper(...args)\n\t\t\t\t\tdeprecated.warn(this, 'constructor')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdefault(message: string) {\n\t\t\treturn decorator({\n\t\t\t\tmethod(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.apply(this, args)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetter(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.call(this)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetter(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any, value: any) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.call(this, value)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tclass(original) {\n\t\t\t\t\treturn class extends original {\n\t\t\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\t\t\tsuper(...args)\n\t\t\t\t\t\t\tdeprecated.warn(this, 'constructor', message)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t}),\n\t{\n\t\twarn: (target: any, propertyKey: PropertyKey, message?: string) => {\n\t\t\t// biome-ignore lint/suspicious/noConsole: To be overridden\n\t\t\tconsole.warn(\n\t\t\t\t`${target.constructor.name}.${String(propertyKey)} is deprecated${message ? `: ${message}` : ''}`\n\t\t\t)\n\t\t},\n\t}\n)\n\n/**\n * Creates a debounced method decorator that delays execution until after the delay period has passed\n * @param delay - The delay in milliseconds\n * @returns A method decorator that debounces method calls\n */\nexport function debounce(delay: number) {\n\treturn decorator({\n\t\tmethod(original, _target, _propertyKey) {\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null\n\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t// Clear existing timeout\n\t\t\t\tif (timeoutId) {\n\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t}\n\n\t\t\t\t// Set new timeout\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\toriginal.apply(this, args)\n\t\t\t\t\ttimeoutId = null\n\t\t\t\t}, delay)\n\t\t\t}\n\t\t},\n\t})\n}\n\n/**\n * Creates a throttled method decorator that limits execution to once per delay period\n * @param delay - The delay in milliseconds\n * @returns A method decorator that throttles method calls\n */\nexport function throttle(delay: number) {\n\treturn decorator({\n\t\tmethod(original, _target, _propertyKey) {\n\t\t\tlet lastCallTime = 0\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null\n\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\tconst now = Date.now()\n\n\t\t\t\t// If enough time has passed since last call, execute immediately\n\t\t\t\tif (now - lastCallTime >= delay) {\n\t\t\t\t\t// Clear any pending timeout since we're executing now\n\t\t\t\t\tif (timeoutId) {\n\t\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t\t\ttimeoutId = null\n\t\t\t\t\t}\n\t\t\t\t\tlastCallTime = now\n\t\t\t\t\treturn original.apply(this, args)\n\t\t\t\t}\n\n\t\t\t\t// Otherwise, schedule execution for when the delay period ends\n\t\t\t\tif (!timeoutId) {\n\t\t\t\t\tconst remainingTime = delay - (now - lastCallTime)\n\t\t\t\t\tconst scheduledArgs = [...args] // Capture args at scheduling time\n\t\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\t\tlastCallTime = Date.now()\n\t\t\t\t\t\toriginal.apply(this, scheduledArgs)\n\t\t\t\t\t\ttimeoutId = null\n\t\t\t\t\t}, remainingTime)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t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YAE1D,OAAO,UAAqB,GAAG,IAAW,EAAA;AACzC,gBAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;;AAGtB,gBAAA,IAAI,GAAG,GAAG,YAAY,IAAI,KAAK,EAAE;;oBAEhC,IAAI,SAAS,EAAE;wBACd,YAAY,CAAC,SAAS,CAAC;wBACvB,SAAS,GAAG,IAAI;oBACjB;oBACA,YAAY,GAAG,GAAG;oBAClB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;gBAClC;;gBAGA,IAAI,CAAC,SAAS,EAAE;oBACf,MAAM,aAAa,GAAG,KAAK,IAAI,GAAG,GAAG,YAAY,CAAC;oBAClD,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,CAAA;AAC/B,oBAAA,SAAS,GAAG,UAAU,CAAC,MAAK;AAC3B,wBAAA,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE;AACzB,wBAAA,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC;wBACnC,SAAS,GAAG,IAAI;oBACjB,CAAC,EAAE,aAAa,CAAC;gBAClB;AACD,YAAA,CAAC;QACF,CAAC;AACD,KAAA,CAAC;AACH;;;;"}
@@ -1,204 +0,0 @@
1
- 'use strict';
2
-
3
- var decorator = require('./chunks/decorator-BQ2eBTCj.js');
4
-
5
- // In order to avoid async re-entrance, we could use zone.js or something like that.
6
- const syncCalculating = [];
7
- /**
8
- * Decorator that caches the result of a getter method and only recomputes when dependencies change
9
- * Prevents circular dependencies and provides automatic cache invalidation
10
- */
11
- const cached = decorator.decorator({
12
- getter(original, _target, propertyKey) {
13
- return function () {
14
- const alreadyCalculating = syncCalculating.findIndex((c) => c.object === this && c.prop === propertyKey);
15
- if (alreadyCalculating > -1)
16
- throw new Error(`Circular dependency detected: ${syncCalculating
17
- .slice(alreadyCalculating)
18
- .map((c) => `${c.object.constructor.name}.${String(c.prop)}`)
19
- .join(' -> ')} -> again`);
20
- syncCalculating.push({ object: this, prop: propertyKey });
21
- try {
22
- const rv = original.call(this);
23
- cache(this, propertyKey, rv);
24
- return rv;
25
- }
26
- finally {
27
- syncCalculating.pop();
28
- }
29
- };
30
- },
31
- });
32
- /**
33
- * Checks if a property is cached (has a cached value)
34
- * @param object - The object to check
35
- * @param propertyKey - The property key to check
36
- * @returns True if the property has a cached value
37
- */
38
- function isCached(object, propertyKey) {
39
- return !!Object.getOwnPropertyDescriptor(object, propertyKey);
40
- }
41
- /**
42
- * Caches a value for a property on an object
43
- * @param object - The object to cache the value on
44
- * @param propertyKey - The property key to cache
45
- * @param value - The value to cache
46
- */
47
- function cache(object, propertyKey, value) {
48
- Object.defineProperty(object, propertyKey, { value });
49
- }
50
- /**
51
- * Creates a decorator that modifies property descriptors for specified properties
52
- * @param descriptor - The descriptor properties to apply
53
- * @returns A class decorator that applies the descriptor to specified properties
54
- */
55
- function describe(descriptor) {
56
- return (...properties) => (Base) => {
57
- return class extends Base {
58
- constructor(...args) {
59
- super(...args);
60
- for (const key of properties) {
61
- Object.defineProperty(this, key, {
62
- ...Object.getOwnPropertyDescriptor(this, key),
63
- ...descriptor,
64
- });
65
- }
66
- }
67
- };
68
- };
69
- }
70
- /**
71
- * Decorator that marks methods, properties, or classes as deprecated
72
- * Provides warning messages when deprecated items are used
73
- */
74
- const deprecated = Object.assign(decorator.decorator({
75
- method(original, _target, propertyKey) {
76
- return function (...args) {
77
- deprecated.warn(this, propertyKey);
78
- return original.apply(this, args);
79
- };
80
- },
81
- getter(original, _target, propertyKey) {
82
- return function () {
83
- deprecated.warn(this, propertyKey);
84
- return original.call(this);
85
- };
86
- },
87
- setter(original, _target, propertyKey) {
88
- return function (value) {
89
- deprecated.warn(this, propertyKey);
90
- return original.call(this, value);
91
- };
92
- },
93
- class(original) {
94
- return class extends original {
95
- constructor(...args) {
96
- super(...args);
97
- deprecated.warn(this, 'constructor');
98
- }
99
- };
100
- },
101
- default(message) {
102
- return decorator.decorator({
103
- method(original, _target, propertyKey) {
104
- return function (...args) {
105
- deprecated.warn(this, propertyKey, message);
106
- return original.apply(this, args);
107
- };
108
- },
109
- getter(original, _target, propertyKey) {
110
- return function () {
111
- deprecated.warn(this, propertyKey, message);
112
- return original.call(this);
113
- };
114
- },
115
- setter(original, _target, propertyKey) {
116
- return function (value) {
117
- deprecated.warn(this, propertyKey, message);
118
- return original.call(this, value);
119
- };
120
- },
121
- class(original) {
122
- return class extends original {
123
- constructor(...args) {
124
- super(...args);
125
- deprecated.warn(this, 'constructor', message);
126
- }
127
- };
128
- },
129
- });
130
- },
131
- }), {
132
- warn: (target, propertyKey, message) => {
133
- // biome-ignore lint/suspicious/noConsole: To be overridden
134
- console.warn(`${target.constructor.name}.${String(propertyKey)} is deprecated${message ? `: ${message}` : ''}`);
135
- },
136
- });
137
- /**
138
- * Creates a debounced method decorator that delays execution until after the delay period has passed
139
- * @param delay - The delay in milliseconds
140
- * @returns A method decorator that debounces method calls
141
- */
142
- function debounce(delay) {
143
- return decorator.decorator({
144
- method(original, _target, _propertyKey) {
145
- let timeoutId = null;
146
- return function (...args) {
147
- // Clear existing timeout
148
- if (timeoutId) {
149
- clearTimeout(timeoutId);
150
- }
151
- // Set new timeout
152
- timeoutId = setTimeout(() => {
153
- original.apply(this, args);
154
- timeoutId = null;
155
- }, delay);
156
- };
157
- },
158
- });
159
- }
160
- /**
161
- * Creates a throttled method decorator that limits execution to once per delay period
162
- * @param delay - The delay in milliseconds
163
- * @returns A method decorator that throttles method calls
164
- */
165
- function throttle(delay) {
166
- return decorator.decorator({
167
- method(original, _target, _propertyKey) {
168
- let lastCallTime = 0;
169
- let timeoutId = null;
170
- return function (...args) {
171
- const now = Date.now();
172
- // If enough time has passed since last call, execute immediately
173
- if (now - lastCallTime >= delay) {
174
- // Clear any pending timeout since we're executing now
175
- if (timeoutId) {
176
- clearTimeout(timeoutId);
177
- timeoutId = null;
178
- }
179
- lastCallTime = now;
180
- return original.apply(this, args);
181
- }
182
- // Otherwise, schedule execution for when the delay period ends
183
- if (!timeoutId) {
184
- const remainingTime = delay - (now - lastCallTime);
185
- const scheduledArgs = [...args]; // Capture args at scheduling time
186
- timeoutId = setTimeout(() => {
187
- lastCallTime = Date.now();
188
- original.apply(this, scheduledArgs);
189
- timeoutId = null;
190
- }, remainingTime);
191
- }
192
- };
193
- },
194
- });
195
- }
196
-
197
- exports.cache = cache;
198
- exports.cached = cached;
199
- exports.debounce = debounce;
200
- exports.deprecated = deprecated;
201
- exports.describe = describe;
202
- exports.isCached = isCached;
203
- exports.throttle = throttle;
204
- //# sourceMappingURL=std-decorators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"std-decorators.js","sources":["../src/std-decorators.ts"],"sourcesContent":["import { decorator, type GenericClassDecorator } from './decorator'\n\n// In order to avoid async re-entrance, we could use zone.js or something like that.\nconst syncCalculating: { object: object; prop: PropertyKey }[] = []\n/**\n * Decorator that caches the result of a getter method and only recomputes when dependencies change\n * Prevents circular dependencies and provides automatic cache invalidation\n */\nexport const cached = decorator({\n\tgetter(original, _target, propertyKey) {\n\t\treturn function (this: any) {\n\t\t\tconst alreadyCalculating = syncCalculating.findIndex(\n\t\t\t\t(c) => c.object === this && c.prop === propertyKey\n\t\t\t)\n\t\t\tif (alreadyCalculating > -1)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Circular dependency detected: ${syncCalculating\n\t\t\t\t\t\t.slice(alreadyCalculating)\n\t\t\t\t\t\t.map((c) => `${c.object.constructor.name}.${String(c.prop)}`)\n\t\t\t\t\t\t.join(' -> ')} -> again`\n\t\t\t\t)\n\t\t\tsyncCalculating.push({ object: this, prop: propertyKey })\n\t\t\ttry {\n\t\t\t\tconst rv = original.call(this)\n\t\t\t\tcache(this, propertyKey, rv)\n\t\t\t\treturn rv\n\t\t\t} finally {\n\t\t\t\tsyncCalculating.pop()\n\t\t\t}\n\t\t}\n\t},\n})\n\n/**\n * Checks if a property is cached (has a cached value)\n * @param object - The object to check\n * @param propertyKey - The property key to check\n * @returns True if the property has a cached value\n */\nexport function isCached(object: Object, propertyKey: PropertyKey) {\n\treturn !!Object.getOwnPropertyDescriptor(object, propertyKey)\n}\n\n/**\n * Caches a value for a property on an object\n * @param object - The object to cache the value on\n * @param propertyKey - The property key to cache\n * @param value - The value to cache\n */\nexport function cache(object: Object, propertyKey: PropertyKey, value: any) {\n\tObject.defineProperty(object, propertyKey, { value })\n}\n\n/**\n * Creates a decorator that modifies property descriptors for specified properties\n * @param descriptor - The descriptor properties to apply\n * @returns A class decorator that applies the descriptor to specified properties\n */\nexport function describe(descriptor: {\n\tenumerable?: boolean\n\tconfigurable?: boolean // Not modifiable once the property has been defined ?\n\twritable?: boolean\n}) {\n\treturn <T>(...properties: (keyof T)[]): GenericClassDecorator<T> =>\n\t\t(Base) => {\n\t\t\treturn class extends Base {\n\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\tsuper(...args)\n\t\t\t\t\tfor (const key of properties) {\n\t\t\t\t\t\tObject.defineProperty(this, key, {\n\t\t\t\t\t\t\t...Object.getOwnPropertyDescriptor(this, key),\n\t\t\t\t\t\t\t...descriptor,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\n/**\n * Decorator that marks methods, properties, or classes as deprecated\n * Provides warning messages when deprecated items are used\n */\nexport const deprecated = Object.assign(\n\tdecorator({\n\t\tmethod(original, _target, propertyKey) {\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.apply(this, args)\n\t\t\t}\n\t\t},\n\t\tgetter(original, _target, propertyKey) {\n\t\t\treturn function (this: any) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.call(this)\n\t\t\t}\n\t\t},\n\t\tsetter(original, _target, propertyKey) {\n\t\t\treturn function (this: any, value: any) {\n\t\t\t\tdeprecated.warn(this, propertyKey)\n\t\t\t\treturn original.call(this, value)\n\t\t\t}\n\t\t},\n\t\tclass(original) {\n\t\t\treturn class extends original {\n\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\tsuper(...args)\n\t\t\t\t\tdeprecated.warn(this, 'constructor')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdefault(message: string) {\n\t\t\treturn decorator({\n\t\t\t\tmethod(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.apply(this, args)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetter(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.call(this)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetter(original, _target, propertyKey) {\n\t\t\t\t\treturn function (this: any, value: any) {\n\t\t\t\t\t\tdeprecated.warn(this, propertyKey, message)\n\t\t\t\t\t\treturn original.call(this, value)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tclass(original) {\n\t\t\t\t\treturn class extends original {\n\t\t\t\t\t\tconstructor(...args: any[]) {\n\t\t\t\t\t\t\tsuper(...args)\n\t\t\t\t\t\t\tdeprecated.warn(this, 'constructor', message)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\t}),\n\t{\n\t\twarn: (target: any, propertyKey: PropertyKey, message?: string) => {\n\t\t\t// biome-ignore lint/suspicious/noConsole: To be overridden\n\t\t\tconsole.warn(\n\t\t\t\t`${target.constructor.name}.${String(propertyKey)} is deprecated${message ? `: ${message}` : ''}`\n\t\t\t)\n\t\t},\n\t}\n)\n\n/**\n * Creates a debounced method decorator that delays execution until after the delay period has passed\n * @param delay - The delay in milliseconds\n * @returns A method decorator that debounces method calls\n */\nexport function debounce(delay: number) {\n\treturn decorator({\n\t\tmethod(original, _target, _propertyKey) {\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null\n\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\t// Clear existing timeout\n\t\t\t\tif (timeoutId) {\n\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t}\n\n\t\t\t\t// Set new timeout\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\toriginal.apply(this, args)\n\t\t\t\t\ttimeoutId = null\n\t\t\t\t}, delay)\n\t\t\t}\n\t\t},\n\t})\n}\n\n/**\n * Creates a throttled method decorator that limits execution to once per delay period\n * @param delay - The delay in milliseconds\n * @returns A method decorator that throttles method calls\n */\nexport function throttle(delay: number) {\n\treturn decorator({\n\t\tmethod(original, _target, _propertyKey) {\n\t\t\tlet lastCallTime = 0\n\t\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null\n\n\t\t\treturn function (this: any, ...args: any[]) {\n\t\t\t\tconst now = Date.now()\n\n\t\t\t\t// If enough time has passed since last call, execute immediately\n\t\t\t\tif (now - lastCallTime >= delay) {\n\t\t\t\t\t// Clear any pending timeout since we're executing now\n\t\t\t\t\tif (timeoutId) {\n\t\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t\t\ttimeoutId = null\n\t\t\t\t\t}\n\t\t\t\t\tlastCallTime = now\n\t\t\t\t\treturn original.apply(this, args)\n\t\t\t\t}\n\n\t\t\t\t// Otherwise, schedule execution for when the delay period ends\n\t\t\t\tif (!timeoutId) {\n\t\t\t\t\tconst remainingTime = delay - (now - lastCallTime)\n\t\t\t\t\tconst scheduledArgs = [...args] // Capture args at scheduling time\n\t\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\t\tlastCallTime = Date.now()\n\t\t\t\t\t\toriginal.apply(this, scheduledArgs)\n\t\t\t\t\t\ttimeoutId = null\n\t\t\t\t\t}, remainingTime)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t})\n}\n"],"names":["decorator"],"mappings":";;;;AAEA;AACA,MAAM,eAAe,GAA4C,EAAE;AACnE;;;AA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