sveltekit-search-params
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "sveltekit-search-params", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "@sveltejs/adapter-auto": "next", |
import { type Writable } from 'svelte/store'; | ||
export declare type EncodeAndDecodeOptions<T = any> = { | ||
encode: (value: T) => string; | ||
decode: (value: string | null) => T; | ||
decode: (value: string | null) => T | null; | ||
}; | ||
declare type LooseAutocomplete<T> = { | ||
[K in keyof T]: any; | ||
[K in keyof T]: T[K]; | ||
} & { | ||
[K: string]: any; | ||
}; | ||
declare type Options = { | ||
[key: string]: EncodeAndDecodeOptions | boolean; | ||
declare type Options<T> = { | ||
[Key in keyof T]: EncodeAndDecodeOptions<T[Key]> | boolean; | ||
}; | ||
@@ -40,4 +40,4 @@ export declare const ssp: { | ||
}; | ||
export declare function queryParameters<T extends Options>(options?: T): Writable<LooseAutocomplete<T>>; | ||
export declare function queryParameters<T extends object>(options?: Options<T>): Writable<LooseAutocomplete<T>>; | ||
export declare function queryParam<T = string>(name: string, { encode: encode, decode: decode }?: EncodeAndDecodeOptions<T>): Writable<T | null>; | ||
export {}; |
17654