-
Notifications
You must be signed in to change notification settings - Fork 4
/
types.d.ts
32 lines (30 loc) · 835 Bytes
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
declare module "urlite" {
export type URLDescriptor = {
protocol?: string
auth?: string
hostname?: string
port?: string
path?: string
pathname?: string
search?: string
hash?: string
href?: string
}
export function parse(path: string): URLDescriptor
export function format(obj: URLDescriptor): string
}
declare module "urlite/extra" {
export type URLDescriptorExtra = {
protocol?: string
auth?: { user?: string; password?: string }
hostname?: string
port?: string
path?: string
pathname?: string
search: Record<string, string | string[] | true | undefined>
hash: Record<string, string | string[] | true | undefined>
href?: string
}
export function parse(path: string): URLDescriptorExtra
export function format(obj: URLDescriptorExtra): string
}