@types/whatwg-url

  • Version 8.2.1
  • Published
  • 25.6 kB
  • 2 dependencies
  • MIT license

Install

npm i @types/whatwg-url
yarn add @types/whatwg-url
pnpm add @types/whatwg-url

Overview

TypeScript definitions for whatwg-url

Index

Functions

function basicURLParse

basicURLParse: (
input: string,
options?: {
baseURL?: string | undefined;
encodingOverride?: string | undefined;
url?: URLRecord | undefined;
stateOverride?: StateOverride | undefined;
}
) => URLRecord | null;
  • https://url.spec.whatwg.org/#concept-basic-url-parser

function cannotHaveAUsernamePasswordPort

cannotHaveAUsernamePasswordPort: (urlRecord: URLRecord) => boolean;
  • https://url.spec.whatwg.org/#cannot-have-a-username-password-port

function parseURL

parseURL: (
input: string,
options?: {
readonly baseURL?: string | undefined;
readonly encodingOverride?: string | undefined;
}
) => URLRecord | null;
  • https://url.spec.whatwg.org/#concept-url-parser

function percentDecode

percentDecode: (buffer: Extract<NodeJS.TypedArray, ArrayLike<number>>) => any;
  • https://url.spec.whatwg.org/#percent-decode

function serializeHost

serializeHost: (host: string | number | IPv6Address) => string;
  • https://url.spec.whatwg.org/#concept-host-serializer

function serializeInteger

serializeInteger: (number: number) => string;
  • https://url.spec.whatwg.org/#serialize-an-integer

function serializeURL

serializeURL: (urlRecord: URLRecord, excludeFragment?: boolean) => string;
  • https://url.spec.whatwg.org/#concept-url-serializer

function serializeURLOrigin

serializeURLOrigin: (urlRecord: URLRecord) => string;
  • https://html.spec.whatwg.org#ascii-serialisation-of-an-origin

function setThePassword

setThePassword: (urlRecord: URLRecord, password: string) => void;
  • https://url.spec.whatwg.org/#set-the-password

function setTheUsername

setTheUsername: (urlRecord: URLRecord, username: string) => void;
  • https://url.spec.whatwg.org/#set-the-username

Classes

class URL

class URL {}
  • https://url.spec.whatwg.org/#url-class

constructor

constructor(url: string, base?: string | URL);

    property [Symbol.toStringTag]

    readonly [Symbol.toStringTag]: string;

      property hash

      hash: string;

        property host

        host: string;

          property hostname

          hostname: string;

            property href

            href: string;

              property origin

              readonly origin: string;

                property password

                password: string;

                  property pathname

                  pathname: string;

                    property port

                    port: string;

                      property protocol

                      protocol: string;

                        property search

                        search: string;

                          property searchParams

                          readonly searchParams: URLSearchParams;

                            property username

                            username: string;

                              method toJSON

                              toJSON: () => string;

                                class URLSearchParams

                                class URLSearchParams {}
                                • https://url.spec.whatwg.org/#interface-urlsearchparams

                                constructor

                                constructor(
                                init?:
                                | string
                                | readonly (readonly [name: string, value: string])[]
                                | Iterable<readonly [name: string, value: string]>
                                | { readonly [name: string]: string }
                                );

                                  property [Symbol.toStringTag]

                                  readonly [Symbol.toStringTag]: string;

                                    method [Symbol.iterator]

                                    [Symbol.iterator]: () => IterableIterator<[name: string, value: string]>;

                                      method append

                                      append: (name: string, value: string) => void;

                                        method delete

                                        delete: (name: string) => void;

                                          method entries

                                          entries: () => IterableIterator<[name: string, value: string]>;

                                            method forEach

                                            forEach: <THIS_ARG = void>(
                                            callback: (
                                            this: THIS_ARG,
                                            value: string,
                                            name: string,
                                            searchParams: this
                                            ) => void,
                                            thisArg?: THIS_ARG
                                            ) => void;

                                              method get

                                              get: (name: string) => string | null;

                                                method getAll

                                                getAll: (name: string) => string[];

                                                  method has

                                                  has: (name: string) => boolean;

                                                    method keys

                                                    keys: () => IterableIterator<string>;

                                                      method set

                                                      set: (name: string, value: string) => void;

                                                        method sort

                                                        sort: () => void;

                                                          method values

                                                          values: () => IterableIterator<string>;

                                                            Interfaces

                                                            interface URLRecord

                                                            interface URLRecord {}
                                                            • https://url.spec.whatwg.org/#url-representation

                                                            property cannotBeABaseURL

                                                            cannotBeABaseURL?: boolean | undefined;

                                                              property fragment

                                                              fragment: string | null;

                                                                property host

                                                                host: string | number | IPv6Address | null;

                                                                  property password

                                                                  password: string;

                                                                    property path

                                                                    path: string[];

                                                                      property port

                                                                      port: number | null;

                                                                        property query

                                                                        query: string | null;

                                                                          property scheme

                                                                          scheme: string;

                                                                            property username

                                                                            username: string;

                                                                              Type Aliases

                                                                              type IPv6Address

                                                                              type IPv6Address = [number, number, number, number, number, number, number, number];
                                                                              • https://url.spec.whatwg.org/#concept-ipv6

                                                                              type StateOverride

                                                                              type StateOverride =
                                                                              | 'scheme start'
                                                                              | 'scheme'
                                                                              | 'no scheme'
                                                                              | 'special relative or authority'
                                                                              | 'path or authority'
                                                                              | 'relative'
                                                                              | 'relative slash'
                                                                              | 'special authority slashes'
                                                                              | 'special authority ignore slashes'
                                                                              | 'authority'
                                                                              | 'host'
                                                                              | 'hostname'
                                                                              | 'port'
                                                                              | 'file'
                                                                              | 'file slash'
                                                                              | 'file host'
                                                                              | 'path start'
                                                                              | 'path'
                                                                              | 'cannot-be-a-base-URL path'
                                                                              | 'query'
                                                                              | 'fragment';
                                                                              • https://url.spec.whatwg.org/#scheme-start-state

                                                                              Package Files (1)

                                                                              Dependencies (2)

                                                                              Dev Dependencies (0)

                                                                              No dev dependencies.

                                                                              Peer Dependencies (0)

                                                                              No peer dependencies.

                                                                              Badge

                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/whatwg-url.

                                                                              • Markdown
                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/whatwg-url)
                                                                              • HTML
                                                                                <a href="https://www.jsdocs.io/package/@types/whatwg-url"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>