@but212/atom-effect-jquery 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/atom-effect-jquery.min.js +2 -2
- package/dist/atom-effect-jquery.min.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -64
- package/dist/index.mjs +484 -454
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { atom } from '@but212/atom-effect';
|
|
2
|
-
import { batch } from '@but212/atom-effect';
|
|
3
|
-
import { computed } from '@but212/atom-effect';
|
|
4
1
|
import { ComputedAtom } from '@but212/atom-effect';
|
|
5
2
|
import { default as default_2 } from 'jquery';
|
|
6
|
-
import { effect } from '@but212/atom-effect';
|
|
7
3
|
import { EffectObject } from '@but212/atom-effect';
|
|
8
|
-
import { isAtom } from '@but212/atom-effect';
|
|
9
|
-
import { isComputed } from '@but212/atom-effect';
|
|
10
4
|
import { ReadonlyAtom } from '@but212/atom-effect';
|
|
11
|
-
import { untracked } from '@but212/atom-effect';
|
|
12
5
|
import { WritableAtom } from '@but212/atom-effect';
|
|
13
6
|
|
|
14
7
|
/**
|
|
@@ -18,15 +11,6 @@ import { WritableAtom } from '@but212/atom-effect';
|
|
|
18
11
|
*/
|
|
19
12
|
declare type AsyncReactiveValue<T> = T | ReadonlyAtom<T | Promise<T>> | Promise<T> | (() => T | Promise<T>);
|
|
20
13
|
|
|
21
|
-
export { atom }
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Creates a two-way "lens" for a specific property path on an object-based atom.
|
|
25
|
-
*/
|
|
26
|
-
export declare function atomLens<T extends object, P extends Paths<T>>(atom: WritableAtom<T>, path: P): WritableAtom<PathValue<T, P>>;
|
|
27
|
-
|
|
28
|
-
export { batch }
|
|
29
|
-
|
|
30
14
|
export declare interface BindingOptions<T = unknown> {
|
|
31
15
|
text?: AsyncReactiveValue<unknown>;
|
|
32
16
|
html?: AsyncReactiveValue<string>;
|
|
@@ -88,13 +72,6 @@ declare class BindingRegistry {
|
|
|
88
72
|
|
|
89
73
|
export declare type ComponentFn<P = Record<string, unknown>> = ($el: JQuery, props: P) => EffectResult;
|
|
90
74
|
|
|
91
|
-
/**
|
|
92
|
-
* Composes an existing lens with a sub-path to create a deeper lens.
|
|
93
|
-
*/
|
|
94
|
-
export declare const composeLens: <T extends object, P extends Paths<T>>(lens: WritableAtom<T>, path: P) => WritableAtom<PathValue<T, P>>;
|
|
95
|
-
|
|
96
|
-
export { computed }
|
|
97
|
-
|
|
98
75
|
export { ComputedAtom }
|
|
99
76
|
|
|
100
77
|
export declare type CssBindings = Record<string, CssValue>;
|
|
@@ -114,8 +91,6 @@ export declare function disableAutoCleanup(): void;
|
|
|
114
91
|
*/
|
|
115
92
|
export declare function disablejQueryOverrides(): void;
|
|
116
93
|
|
|
117
|
-
export { effect }
|
|
118
|
-
|
|
119
94
|
export declare type EffectCleanup = () => void;
|
|
120
95
|
|
|
121
96
|
export declare type EffectResult = undefined | EffectCleanup;
|
|
@@ -146,10 +121,6 @@ export declare interface FetchOptions<T> {
|
|
|
146
121
|
eager?: boolean;
|
|
147
122
|
}
|
|
148
123
|
|
|
149
|
-
export { isAtom }
|
|
150
|
-
|
|
151
|
-
export { isComputed }
|
|
152
|
-
|
|
153
124
|
/** Checks if a given value is a reactive node (Atom or Computed). */
|
|
154
125
|
export declare const isReactive: (v: unknown) => v is ReadonlyAtom<unknown>;
|
|
155
126
|
|
|
@@ -157,11 +128,6 @@ declare type KeysOfType<T, V> = {
|
|
|
157
128
|
[K in keyof T]: T[K] extends V ? K : never;
|
|
158
129
|
}[keyof T];
|
|
159
130
|
|
|
160
|
-
/**
|
|
161
|
-
* Creates a lens factory bound to a specific atom.
|
|
162
|
-
*/
|
|
163
|
-
export declare const lensFor: <T extends object>(atom: WritableAtom<T>) => <P extends Paths<T>>(path: P) => WritableAtom<PathValue<T, P>>;
|
|
164
|
-
|
|
165
131
|
declare type ListKey = string | number;
|
|
166
132
|
|
|
167
133
|
declare type ListKeyFn<T> = (item: T, index: number) => ListKey;
|
|
@@ -180,34 +146,9 @@ export declare interface ListOptions<T> {
|
|
|
180
146
|
|
|
181
147
|
declare type ListRenderResult = string | Element | DocumentFragment | JQuery;
|
|
182
148
|
|
|
183
|
-
/** Max recursion depth for dot-paths. */
|
|
184
|
-
declare type MaxDepth = 8;
|
|
185
|
-
|
|
186
149
|
/** Resolves after microtask effects flush. Fast Promise-based scheduling. */
|
|
187
150
|
export declare const nextTick: () => Promise<void>;
|
|
188
151
|
|
|
189
|
-
/**
|
|
190
|
-
* Generates a union of all possible dot-separated paths for a given type T.
|
|
191
|
-
*
|
|
192
|
-
* Used for `atomLens` to provide IDE autocomplete and type safety when
|
|
193
|
-
* zooming into deeply nested reactive objects.
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* type User = { profile: { name: string } };
|
|
197
|
-
* type P = Paths<User>; // "profile" | "profile.name"
|
|
198
|
-
*/
|
|
199
|
-
export declare type Paths<T, D extends unknown[] = []> = D['length'] extends MaxDepth ? never : T extends object ? {
|
|
200
|
-
[K in keyof T & (string | number)]-?: `${K}` | (T[K] extends object ? `${K}.${Paths<T[K], [...D, 1]>}` : never);
|
|
201
|
-
}[keyof T & (string | number)] : never;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Resolves the type of a value at a specific dot-path P within type T.
|
|
205
|
-
*
|
|
206
|
-
* Works in tandem with `Paths<T>` to ensure that lensed atoms have
|
|
207
|
-
* the correct inferred type for the member they point to.
|
|
208
|
-
*/
|
|
209
|
-
export declare type PathValue<T, P extends string> = P extends `${infer K}.${infer Rest}` ? StringKeyToNumber<K> extends keyof T ? PathValue<T[StringKeyToNumber<K> & keyof T], Rest> : never : StringKeyToNumber<P> extends keyof T ? T[StringKeyToNumber<P> & keyof T] : never;
|
|
210
|
-
|
|
211
152
|
export declare type PrimitiveValue = string | number | boolean | null | undefined;
|
|
212
153
|
|
|
213
154
|
/**
|
|
@@ -254,17 +195,12 @@ export declare interface Router {
|
|
|
254
195
|
destroy: () => void;
|
|
255
196
|
}
|
|
256
197
|
|
|
257
|
-
/** Helper to convert numeric string to number for array indexing. */
|
|
258
|
-
declare type StringKeyToNumber<S extends string> = S extends `${infer N extends number}` ? N : S;
|
|
259
|
-
|
|
260
198
|
export declare interface TemplateRoute extends RouteLifecycle {
|
|
261
199
|
template: string;
|
|
262
200
|
render?: never;
|
|
263
201
|
onMount?: ($content: JQuery, onUnmount: (cleanupFn: () => void) => void, router: Router) => void;
|
|
264
202
|
}
|
|
265
203
|
|
|
266
|
-
export { untracked }
|
|
267
|
-
|
|
268
204
|
/**
|
|
269
205
|
* Options for `atomVal`, `atomChecked`, and `atomForm` bindings.
|
|
270
206
|
*/
|