@types/jsurl2
TypeScript icon, indicating that this package has built-in type declarations

2.1.4 • Public • Published

Installation

npm install --save @types/jsurl2

Summary

This package contains type definitions for jsurl2 (https://github.com/wmertens/jsurl2).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jsurl2.

index.d.ts

export interface StringifyOptions {
    /**
     * `rich`: encode Date, `undefined`, `Infinity`
     */
    rich?: boolean;
    /**
     * `short`: remove optional trailing delimiters
     */
    short?: boolean;
}

export function stringify(object: object, options?: StringifyOptions): string;

export interface ParseOptions {
    /**
     * Remove URI encoding and whitespace
     */
    deURI?: boolean;
}

// eslint-disable-next-line @definitelytyped/no-unnecessary-generics -- allows the user to specify a specific type that they expect the string to parse to
export function parse<T extends object>(urlFragment: string, options?: ParseOptions): T;

/**
 * Same as `parse`, but returns `defaultValue` instead of throwing on error.
 */
export function tryParse<T extends object>(urlFragment: string, defaultValue: T, options?: ParseOptions): T;

export as namespace JSURL2;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Ben Grynhaus.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/jsurl2

Weekly Downloads

5,974

Version

2.1.4

License

MIT

Unpacked Size

4.26 kB

Total Files

5

Last publish

Collaborators

  • types