1/* 2* Copyright (c) 2021 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 16/** 17 * The uri module provides utilities for URI resolution and parsing. 18 * @since 8 19 * @syscap SystemCapability.Utils.Lang 20 * @import import uri from '@ohos.uri'; 21 * @permission N/A 22 */ 23declare namespace uri { 24 class URI { 25 /** 26 * URI constructor, which is used to instantiate a URI object. 27 * uri: Constructs a URI by parsing a given string. 28 */ 29 constructor(uri: string); 30 31 /** 32 * Returns the serialized URI as a string. 33 * @since 8 34 * @syscap SystemCapability.Utils.Lang 35 * @return Returns the serialized URI as a string. 36 */ 37 toString(): string 38 39 /** 40 * Tests whether this URI is equivalent to other URI objects. 41 * @since 8 42 * @syscap SystemCapability.Utils.Lang 43 * @param other URI object to be compared 44 * @return boolean Tests whether this URI is equivalent to other URI objects. 45 */ 46 equals(other: URI): boolean; 47 48 /** 49 * Indicates whether this URI is an absolute URI. 50 * @since 8 51 * @syscap SystemCapability.Utils.Lang 52 * @return boolean Indicates whether the URI is an absolute URI (whether the scheme component is defined). 53 */ 54 checkIsAbsolute(): boolean; 55 56 /** 57 * Normalize the path of this URI. 58 * @since 8 59 * @syscap SystemCapability.Utils.Lang 60 * @return URI Used to normalize the path of this URI and return a URI object whose path has been normalized. 61 */ 62 normalize(): URI; 63 64 /** 65 * Gets the protocol part of the URI. 66 * @since 8 67 * @syscap SystemCapability.Utils.Lang 68 */ 69 scheme: string; 70 71 /** 72 * Obtains the user information part of the URI. 73 * @since 8 74 * @syscap SystemCapability.Utils.Lang 75 */ 76 userInfo: string; 77 78 /** 79 * Gets the hostname portion of the URI without a port. 80 * @since 8 81 * @syscap SystemCapability.Utils.Lang 82 */ 83 host: string; 84 85 /** 86 * Gets the port portion of the URI. 87 * @since 8 88 * @syscap SystemCapability.Utils.Lang 89 */ 90 port: string; 91 92 /** 93 * Gets the path portion of the URI. 94 * @since 8 95 * @syscap SystemCapability.Utils.Lang 96 */ 97 path: string; 98 99 /** 100 * Gets the query portion of the URI 101 * @since 8 102 * @syscap SystemCapability.Utils.Lang 103 */ 104 query: string; 105 106 /** 107 * Gets the fragment part of the URI. 108 * @since 8 109 * @syscap SystemCapability.Utils.Lang 110 */ 111 fragment: string; 112 113 /** 114 * Gets the decoding permission component part of this URI. 115 * @since 8 116 * @syscap SystemCapability.Utils.Lang 117 */ 118 authority: string; 119 120 /** 121 * Gets the decoding scheme-specific part of the URI. 122 * @since 8 123 * @syscap SystemCapability.Utils.Lang 124 */ 125 ssp: string; 126 } 127} 128export default uri;