import { Cata } from '../Basics'; import Maybe from '../Maybe'; import { Parser } from './Parser'; export interface Protocol { isHttp(): boolean; isHttps(): boolean; isEqual(another: Protocol): boolean; cata(pattern: Protocol.Pattern): R; } export declare const Http: { isHttp(): boolean; isHttps(): boolean; isEqual(another: Protocol): boolean; cata(pattern: { Http: () => R; Https: () => R; _?: (() => never) | undefined; } | { Http?: (() => R) | undefined; Https?: (() => R) | undefined; _: () => R; }): R; }; export declare const Https: { isHttp(): boolean; isHttps(): boolean; isEqual(another: Protocol): boolean; cata(pattern: { Http: () => R; Https: () => R; _?: (() => never) | undefined; } | { Http?: (() => R) | undefined; Https?: (() => R) | undefined; _: () => R; }): R; }; export declare namespace Protocol { type Pattern = Cata<{ Http(): R; Https(): R; }>; } export declare class Url { readonly protocol: Protocol; readonly host: string; readonly port: Maybe; readonly path: string; readonly query: Maybe; readonly fragment: Maybe; static Http: { isHttp(): boolean; isHttps(): boolean; isEqual(another: Protocol): boolean; cata(pattern: { Http: () => R; Https: () => R; _?: (() => never) | undefined; } | { Http?: (() => R) | undefined; Https?: (() => R) | undefined; _: () => R; }): R; }; static Https: { isHttp(): boolean; isHttps(): boolean; isEqual(another: Protocol): boolean; cata(pattern: { Http: () => R; Https: () => R; _?: (() => never) | undefined; } | { Http?: (() => R) | undefined; Https?: (() => R) | undefined; _: () => R; }): R; }; static fromString(str: string): Maybe; static fromPercent(str: string): Maybe; static cons(protocol: Protocol, host: string, config?: { port?: number; path?: string; query?: string; fragment?: string; }): Url; private static preparePort; private static preparePath; private static prepareQuery; private static prepareFragment; private constructor(); withProtocol(nextProtocol: Protocol): Url; withHost(nextHost: string): Url; withoutPort(): Url; withPort(nextPort: number): Url; withoutPath(): Url; withPath(nextPath: string): Url; withoutQuery(): Url; withQuery(nextQuery: string): Url; withoutFragment(): Url; withFragment(nextFragment: string): Url; parse(parser: Parser<(value: A) => B, B>): Maybe; toString(): string; toPercent(): string; }