@types/whatwg-url

  • Version 13.0.0
  • Published
  • 15 kB
  • 1 dependency
  • 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?: URLRecord | 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 hasAnOpaquePath

hasAnOpaquePath: (urlRecord: URLRecord) => boolean;
  • https://url.spec.whatwg.org/#url-opaque-path

function parseURL

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

function percentDecodeBytes

percentDecodeBytes: (buffer: TypedArray) => Uint8Array;
  • https://url.spec.whatwg.org/#percent-decode

function percentDecodeString

percentDecodeString: (string: string) => Uint8Array;
  • https://url.spec.whatwg.org/#string-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 serializePath

serializePath: (urlRecord: URLRecord) => string;
  • https://url.spec.whatwg.org/#url-path-serializer

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 canParse

                              static canParse: (url: string, base?: string) => boolean;

                                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;

                                      property size

                                      readonly size: number;

                                        method [Symbol.iterator]

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

                                          method append

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

                                            method delete

                                            delete: (name: string, value?: 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, value?: 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 fragment

                                                                fragment: string | null;

                                                                  property host

                                                                  host: string | number | IPv6Address | null;

                                                                    property password

                                                                    password: string;

                                                                      property path

                                                                      path: string | 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'
                                                                                | 'opaque path'
                                                                                | 'query'
                                                                                | 'fragment';
                                                                                • https://url.spec.whatwg.org/#scheme-start-state

                                                                                type TypedArray

                                                                                type TypedArray =
                                                                                | Uint8Array
                                                                                | Uint8ClampedArray
                                                                                | Uint16Array
                                                                                | Uint32Array
                                                                                | Int8Array
                                                                                | Int16Array
                                                                                | Int32Array
                                                                                | Float32Array
                                                                                | Float64Array;

                                                                                  Package Files (1)

                                                                                  Dependencies (1)

                                                                                  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>