@libj/make-uri
Version:
37 lines (36 loc) • 971 B
TypeScript
import { LooseObject } from './common/types';
import { UriQueryStringOptions } from './makeUriQueryString';
export interface MakeUriParams {
scheme?: string;
authority?: AuthorityOpt;
path?: PathOpt;
query?: QueryOpt;
fragment?: QueryOpt;
}
type Args = [MakeUriParams] | [string] | [string, MakeUriParams];
export declare const makeUri: (...args: Args) => string;
interface AuthorityParams {
host: string;
port?: number | string;
user?: string;
}
type AuthorityOpt = string | AuthorityParams;
interface PathParams {
template: string;
params: LooseObject;
}
type PathVariants = string | PathParams | string[];
interface PathOptOptions {
trimTrail?: boolean;
}
interface PathOptWithOpts {
path: PathVariants;
opts: PathOptOptions;
}
type PathOpt = PathVariants | PathOptWithOpts;
interface QueryParams {
$data: LooseObject;
$options: UriQueryStringOptions;
}
type QueryOpt = LooseObject | QueryParams;
export {};