import { Result } from "./result.js"; import { ReadonlyURL, WritableURL } from "./mutable-url.js"; import { KeysParam } from "./index.js"; import { StripCommand } from "./utils/stripper.js"; type NullOrUndef = null | undefined; type OneKey = Record; export interface IsURIResult { readonly isURI: boolean; readonly uri?: URI; } export interface URIInterface> { readonly getParams: Iterable<[string, string]>; hasParam(key: string): boolean; getParam(key: string | OneKey, def?: T): T extends string ? string : string | undefined; getParamResult(key: string, msgFn?: (key: string) => string): Result; getParamsResult(...keys: KeysParam): Result>; match(other: CoerceURI): MatchResult; clone(): R; asURL(): URL; toString(): string; toJSON(): string; asObj(...strips: StripCommand[]): Partial; } export interface MatchResult { readonly score: number; readonly protocol: boolean; readonly hostname: boolean; readonly port: boolean; readonly pathname: boolean; readonly pathParts: string[]; readonly params: Record; } export interface URIObject { readonly style: "host" | "path"; readonly protocol: string; readonly pathname: string; readonly searchParams: Record; } export interface PathURIObject extends URIObject { readonly style: "path"; } export interface HostURIObject extends URIObject { readonly style: "host"; readonly hostname: string; readonly port: string; } export declare function isURL(value: unknown): value is URL; export declare function isRequestLike(value: unknown): value is { url: string | URL; }; export declare class BuildURI implements URIInterface { _url: WritableURL; private constructor(); static is(value: unknown): value is BuildURI; static from(strURLUri?: CoerceURI, defaultProtocol?: string): BuildURI; match(other: CoerceURI): MatchResult; port(p: string): BuildURI; host(h: string): BuildURI; hostname(h: string): BuildURI; protocol(p: string): BuildURI; pathname(p: string): BuildURI; hash(h: string): BuildURI; resolve(p: CoerceURI): BuildURI; appendRelative(p: CoerceURI): BuildURI; cleanParams(...remove: (string | string[])[]): BuildURI; searchParams(val: Record, mode?: "reset" | "merge"): BuildURI; hashParams(val: Record, mode?: "reset" | "merge"): BuildURI; delParam(key: string): BuildURI; defParam(key: string, str: string): BuildURI; setParam(key: string, str: string): BuildURI; hasParam(key: string): boolean; get getParams(): Iterable<[string, string]>; getParam(key: string | OneKey, def?: T): T extends string ? string : string | undefined; getParamResult(key: string, msgFn?: (key: string) => string): Result; getParamsResult(...keys: KeysParam): Result>; getHashParams(...keys: KeysParam): Result>; toString(): string; toJSON(): string; asURL(): URL; asObj(...strips: StripCommand[]): Partial; clone(): BuildURI; get onlyHostAndSchema(): string; get withoutHostAndSchema(): string; URI(): URI; } export type CoerceURI = string | URI | ReadonlyURL | WritableURL | URL | BuildURI | NullOrUndef | { url: URL | string; }; export declare function isCoerceURI(value: unknown): value is CoerceURI; export declare class URI implements URIInterface { static protocolHasHostpart(protocol: string): () => void; match(other: CoerceURI): MatchResult; static merge(into: CoerceURI, from: CoerceURI, defaultProtocol?: string): URI; static is(value: unknown): value is URI; static from(strURLUri?: CoerceURI, defaultProtocol?: string): URI; static fromResult(strURLUri?: CoerceURI, defaultProtocol?: string): Result; readonly _url: ReadonlyURL; private constructor(); build(): BuildURI; get hostname(): string; get onlyHostAndSchema(): string; get withoutHostAndSchema(): string; get port(): string; get host(): string; get search(): string; get protocol(): string; get pathname(): string; get hash(): string; get getParams(): Iterable<[string, string]>; get getHashes(): Iterable<[string, string]>; hasParam(key: string): boolean; getParam(key: string | OneKey, def?: T): T extends string ? string : string | undefined; getParamResult(key: string, msgFn?: (key: string) => string): Result; getParamsResult(...keys: KeysParam): Result>; getHashParams(...keys: KeysParam): Result>; clone(): URI; asURL(): URL; toString(): string; toJSON(): string; asObj(...strips: StripCommand[]): Partial; } export {}; //# sourceMappingURL=uri.d.ts.map