declare const _PROTOCOLS: readonly ["http", "https", "ws", "wss"];
export type Protocol = (typeof _PROTOCOLS)[number];
export type Path = `/${string}`;
export type Url = {
    protocol: Protocol;
    host: string;
    port?: number;
    path?: Path;
};
export type UrlParseResult = {
    status: 'success';
    url: Url;
} | {
    status: 'error';
    error: string;
};
export declare function parse(hostOrUrl: string): UrlParseResult;
export declare const format: (url: Url) => string;
export {};
