Skip to content

Commit

Permalink
doc: Add overloads docs for serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Jan 28, 2024
1 parent 7711c4f commit bea9d02
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/nuqs/src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ type Values<Parsers extends Record<string, ParserBuilder<any>>> = Partial<{
export function createSerializer<
Parsers extends Record<string, ParserBuilder<any>>
>(parsers: Parsers) {
/**
* Generate a query string for the given values.
*/
function serialize(values: Values<Parsers>): string
/**
* Append/amend the query string of the given base with the given values.
*
* Existing search param values will kept, unless:
* - the value is null, in which case the search param will be deleted
* - another value is given for an existing key, in which case the
* search param will be updated
*/
function serialize(base: Base, values: Values<Parsers>): string
function serialize(
baseOrValues: Base | Values<Parsers>,
Expand Down

0 comments on commit bea9d02

Please sign in to comment.