import type { _NSArray } from "./NSArray.js";
import type { _NSCopying } from "./NSCopying.js";
import type { _NSNumber } from "./NSNumber.js";
import type { _NSObject } from "./NSObject.js";
import type { _NSString } from "./NSString.js";
import type { _NSURL } from "./NSURL.js";
import type { NSRange } from "../structs/NSRange.js";
export declare class _NSURLComponents extends _NSObject {
    static alloc(): _NSURLComponents;
    static new(): _NSURLComponents;
    /**
     * Initializes and returns a newly created NSURLComponents with the components of a URL. If resolvingAgainstBaseURL is YES and url is a relative URL, the components of [url absoluteURL] are used. If the url string from the NSURL is malformed, nil is returned.
     */
    static componentsWithURL$resolvingAgainstBaseURL$(url: _NSURL, resolve: boolean): _NSURLComponents | null;
    /**
     * Initializes and returns a newly created NSURLComponents with a URL string. If the URLString is malformed, nil is returned.
     */
    static componentsWithString$(URLString: _NSString): _NSURLComponents | null;
    /**
     * Initializes and returns a newly created `NSURLComponents` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters. If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned. If `encodingInvalidCharacters` is true, `NSURLComponents` will try to encode the string to create a valid URL. If the URL string is still invalid after encoding, nil is returned. - Parameter URLString: The URL string. - Parameter encodingInvalidCharacters: True if `NSURLComponents` should try to encode an invalid URL string, false otherwise. - Returns: An `NSURLComponents` instance for a valid URL, or `nil` if the URL is invalid.
     */
    static componentsWithString$encodingInvalidCharacters$(URLString: _NSString, encodingInvalidCharacters: boolean): _NSURLComponents | null;
    /**
     * Initialize a NSURLComponents with all components undefined. Designated initializer.
     */
    init(): _NSURLComponents;
    /**
     * Initialize a NSURLComponents with the components of a URL. If resolvingAgainstBaseURL is YES and url is a relative URL, the components of [url absoluteURL] are used. If the url string from the NSURL is malformed, nil is returned.
     */
    initWithURL$resolvingAgainstBaseURL$(url: _NSURL, resolve: boolean): _NSURLComponents | null;
    /**
     * Initialize a NSURLComponents with a URL string. If the URLString is malformed, nil is returned.
     */
    initWithString$(URLString: _NSString): _NSURLComponents | null;
    /**
     * Initializes an `NSURLComponents` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters. If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned. If `encodingInvalidCharacters` is true, `NSURLComponents` will try to encode the string to create a valid URL. If the URL string is still invalid after encoding, `nil` is returned. - Parameter URLString: The URL string. - Parameter encodingInvalidCharacters: True if `NSURLComponents` should try to encode an invalid URL string, false otherwise. - Returns: An `NSURLComponents` instance for a valid URL, or `nil` if the URL is invalid.
     */
    initWithString$encodingInvalidCharacters$(URLString: _NSString, encodingInvalidCharacters: boolean): _NSURLComponents | null;
    /**
     * Returns a URL created from the NSURLComponents relative to a base URL. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
     */
    URLRelativeToURL$(baseURL: _NSURL | null): _NSURL | null;
    /**
     * Returns a URL created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
     */
    URL(): _NSURL | null;
    /**
     * Returns a URL string created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
     */
    string(): _NSString | null;
    /**
     * Attempting to set the scheme with an invalid scheme string will cause an exception.
     */
    scheme(): _NSString | null;
    setScheme$(value: _NSString | null): void;
    user(): _NSString | null;
    setUser$(value: _NSString | null): void;
    password(): _NSString | null;
    setPassword$(value: _NSString | null): void;
    host(): _NSString | null;
    setHost$(value: _NSString | null): void;
    /** Attempting to set a negative port number will cause an exception. */
    port(): _NSNumber | null;
    setPort$(value: _NSNumber | null): void;
    path(): _NSString | null;
    setPath$(value: _NSString | null): void;
    query(): _NSString | null;
    setQuery$(value: _NSString | null): void;
    /** @deprecated Use encodedHost instead */
    fragment(): _NSString | null;
    setFragment$(value: _NSString | null): void;
    /**
     * Getting these properties retains any percent encoding these components may have. Setting these properties assumes the component string is already correctly percent encoded. Attempting to set an incorrectly percent encoded string will cause an exception. Although ';' is a legal path character, it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet).
     * @deprecated Use encodedHost instead
     */
    percentEncodedUser(): _NSString | null;
    setPercentEncodedUser$(value: _NSString | null): void;
    /** @deprecated Use encodedHost instead */
    percentEncodedPassword(): _NSString | null;
    setPercentEncodedPassword$(value: _NSString | null): void;
    /** @deprecated Use encodedHost instead */
    percentEncodedHost(): _NSString | null;
    setPercentEncodedHost$(value: _NSString | null): void;
    percentEncodedPath(): _NSString | null;
    setPercentEncodedPath$(value: _NSString | null): void;
    percentEncodedQuery(): _NSString | null;
    setPercentEncodedQuery$(value: _NSString | null): void;
    percentEncodedFragment(): _NSString | null;
    setPercentEncodedFragment$(value: _NSString | null): void;
    encodedHost(): _NSString | null;
    setEncodedHost$(value: _NSString | null): void;
    /**
     * These properties return the character range of a component in the URL string returned by -[NSURLComponents string]. If the component does not exist in the NSURLComponents object, {NSNotFound, 0} is returned. Note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path.
     */
    rangeOfScheme(): NSRange;
    rangeOfUser(): NSRange;
    rangeOfPassword(): NSRange;
    rangeOfHost(): NSRange;
    rangeOfPort(): NSRange;
    rangeOfPath(): NSRange;
    rangeOfQuery(): NSRange;
    rangeOfFragment(): NSRange;
    /**
     * The query component as an array of NSURLQueryItems for this NSURLComponents. Each NSURLQueryItem represents a single key-value pair, Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the NSURLComponents has an empty query component, returns an empty array. If the NSURLComponents has no query component, returns nil. The queryItems getter returns an array of NSURLQueryItems in the order in which they appear in the original query string. Any percent-encoding in a NSURLQueryItem name or value is removed. The queryItems setter combines an array containing any number of NSURLQueryItems, each of which represents a single key-value pair, into a query string and sets the NSURLComponents query property. If the NSURLQueryItems name or value strings contain any characters not allowed in a URL's query component, those characters are percent-encoded. In addition, any '&' and '=' characters in a NSURLQueryItem name are percent-encoded. Passing an empty array sets the query component of the NSURLComponents to an empty string. Passing nil removes the query component of the NSURLComponents. - note: If a NSURLQueryItem name-value pair is empty (i.e. the query string starts with '&', ends with '&', or has "&&" within it), you get a NSURLQueryItem with a zero-length name and a nil value. If a NSURLQueryItem name-value pair has nothing before the equals sign, you get a zero-length name. If a NSURLQueryItem name-value pair has nothing after the equals sign, you get a zero-length value. If a NSURLQueryItem name-value pair has no equals sign, the NSURLQueryItem name-value pair string is the name and you get a nil value.
     */
    queryItems(): _NSArray | null;
    setQueryItems$(value: _NSArray | null): void;
    /**
     * The percentEncodedQueryItems getter returns an array of NSURLQueryItems in the order in which they appear in the original query string. Any percent-encoding in a NSURLQueryItem name or value is retained. The percentEncodedQueryItems setter combines an array containing any number of NSURLQueryItems, each of which represents a single key-value pair, into a query string and sets the NSURLComponents query property. This property assumes the NSURLQueryItem names and values are already correctly percent-encoded, and that the NSURLQueryItem names do not contain the query item delimiter characters '&' and '='. Attempting to set an incorrectly percent-encoded NSURLQueryItem or a NSURLQueryItem name with the query item delimiter characters '&' and '=' will cause an exception.
     */
    percentEncodedQueryItems(): _NSArray | null;
    setPercentEncodedQueryItems$(value: _NSArray | null): void;
}
export interface _NSURLComponents extends _NSCopying {
}
