• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16The definitions of some interfaces implemented in jsapi/api/js_url.cpp are released under Mozilla license.
17
18The definitions and functions of these interfaces are consistent with the standard interfaces under mozilla license,
19but the implementation of specific functions is independent and self-developed.
20
21All interfaces are described in d.ts, the following is the interface written in d.ts under to Mozilla license
22
23class URLSearchParams {
24
25    constructor(init?: string[][] | Record<string, string> | string | URLSearchParams);
26    append(name: string, value: string): void;
27    delete(name: string): void;
28    getAll(name: string): string[];
29    entries(): IterableIterator<[string, string]>;
30    forEach(callbackfn: (value: string, key: string, searchParams: this) => void): void;
31    get(name: string): string | null;
32    has(name: string): boolean;
33    set(name: string, value: string): void;
34    sort(): void;
35    keys(): IterableIterator<string>;
36    values(): IterableIterator<string>;
37    [Symbol.iterator](): IterableIterator<[string, string]>;
38    toString(): string;
39}
40
41class URL {
42
43    constructor(url: string, base?: string | URL);
44    toString(): string;
45    toJSON(): string;
46    hash: string;
47    host: string;
48    hostname: string;
49    href: string;
50    readonly origin: string;
51    password: string;
52    pathname: string;
53    port: string;
54    protocol: string;
55    search: string;
56    readonly searchParams: URLSearchParams;
57    username: string;
58}