Skip to content

Commit 3bb1a1f

Browse files
hugopeixotogtournie
authored andcommitted
Add url.parseURL type definition (#66)
1 parent 46fbe95 commit 3bb1a1f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

index.d.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,25 @@ export interface UrlValidatorOptions extends DefaultValidatorOptions {
188188
hash?: boolean
189189
}
190190

191-
export const url: (options?: UrlValidatorOptions) => Validator
191+
interface URL {
192+
protocol?: string;
193+
hash?: string;
194+
host?: string;
195+
ipv4?: string;
196+
ipv6?: string;
197+
port?: number;
198+
search?: string;
199+
path?: string;
200+
basicAuth?: {
201+
username: string;
202+
password?: string;
203+
};
204+
}
205+
206+
export const url : {
207+
(options?: UrlValidatorOptions): Validator;
208+
parseURL: (url: string, options?: UrlValidatorOptions) => URL | null;
209+
}
192210

193211
declare const Validators: {
194212
formatMessage: (msg: MessageDescriptor) => string

0 commit comments

Comments
 (0)