interface URLSearchParams {
    append(name: string, value: string): void;
    delete(name: string): void;
    forEach(callbackfn: ((value: string, key: string, parent: URLSearchParams) => void), thisArg?: any): void;
    get(name: string): null | string;
    getAll(name: string): string[];
    has(name: string): boolean;
    set(name: string, value: string): void;
    sort(): void;
    toString(): string;
}

方法

  • Appends a specified key/value pair as a new search parameter.

    参数

    • name: string
    • value: string

    返回 void

  • Deletes the given search parameter, and its associated value, from the list of all search parameters.

    参数

    • name: string

    返回 void

  • 参数

    • callbackfn: ((value: string, key: string, parent: URLSearchParams) => void)
        • (value, key, parent): void
        • 参数

          返回 void

    • 可选thisArg: any

    返回 void

  • Returns the first value associated to the given search parameter.

    参数

    • name: string

    返回 null | string

  • Returns all the values association with a given search parameter.

    参数

    • name: string

    返回 string[]

  • Returns a Boolean indicating if such a search parameter exists.

    参数

    • name: string

    返回 boolean

  • Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.

    参数

    • name: string
    • value: string

    返回 void

  • 返回 void

  • Returns a string containing a query string suitable for use in a URL. Does not include the question mark.

    返回 string