zustand-querystring 0.6.4 → 0.6.5
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/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -35,14 +35,13 @@ type QueryStringFormatFor<K extends string | false> = K extends false ? QueryStr
|
|
|
35
35
|
/**
|
|
36
36
|
* Bidirectional mapping between store state and URL state.
|
|
37
37
|
* `to` runs before serialization (store → URL), `from` after deserialization (URL → store).
|
|
38
|
-
* S is inferred from `select` via `ApplySelect` — only selected fields are visible.
|
|
39
38
|
* U is inferred from `to`'s return type and flows into `from`'s parameter.
|
|
40
39
|
*/
|
|
41
40
|
interface QueryStringMap<S, U extends object = Record<string, unknown>> {
|
|
42
41
|
to: (state: S, pathname: string) => U;
|
|
43
42
|
from: (urlState: U, pathname: string) => Partial<S>;
|
|
44
43
|
}
|
|
45
|
-
/** Helper to create a typed map — infers U
|
|
44
|
+
/** Helper to create a typed map — infers both S and U. Annotate `state` in `to` to provide S. */
|
|
46
45
|
declare function createMap<S, U extends object>(map: QueryStringMap<S, U>): QueryStringMap<S, U>;
|
|
47
46
|
interface QueryStringOptions<T, K extends string | false = string | false> {
|
|
48
47
|
url?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -35,14 +35,13 @@ type QueryStringFormatFor<K extends string | false> = K extends false ? QueryStr
|
|
|
35
35
|
/**
|
|
36
36
|
* Bidirectional mapping between store state and URL state.
|
|
37
37
|
* `to` runs before serialization (store → URL), `from` after deserialization (URL → store).
|
|
38
|
-
* S is inferred from `select` via `ApplySelect` — only selected fields are visible.
|
|
39
38
|
* U is inferred from `to`'s return type and flows into `from`'s parameter.
|
|
40
39
|
*/
|
|
41
40
|
interface QueryStringMap<S, U extends object = Record<string, unknown>> {
|
|
42
41
|
to: (state: S, pathname: string) => U;
|
|
43
42
|
from: (urlState: U, pathname: string) => Partial<S>;
|
|
44
43
|
}
|
|
45
|
-
/** Helper to create a typed map — infers U
|
|
44
|
+
/** Helper to create a typed map — infers both S and U. Annotate `state` in `to` to provide S. */
|
|
46
45
|
declare function createMap<S, U extends object>(map: QueryStringMap<S, U>): QueryStringMap<S, U>;
|
|
47
46
|
interface QueryStringOptions<T, K extends string | false = string | false> {
|
|
48
47
|
url?: string;
|