UNPKG

1.13 kBTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2import { WebAuthorityConstraints } from './webAuthority';
3/**
4 * Constraints to be applied on {@link webUrl}
5 * @remarks Since 1.14.0
6 * @public
7 */
8export interface WebUrlConstraints {
9 /**
10 * Enforce specific schemes, eg.: http, https
11 * @remarks Since 1.14.0
12 */
13 validSchemes?: string[];
14 /**
15 * Settings for {@link webAuthority}
16 * @remarks Since 1.14.0
17 */
18 authoritySettings?: WebAuthorityConstraints;
19 /**
20 * Enable query parameters in the generated url
21 * @remarks Since 1.14.0
22 */
23 withQueryParameters?: boolean;
24 /**
25 * Enable fragments in the generated url
26 * @remarks Since 1.14.0
27 */
28 withFragments?: boolean;
29}
30/**
31 * For web url
32 *
33 * According to {@link https://www.ietf.org/rfc/rfc3986.txt | RFC 3986} and
34 * {@link https://url.spec.whatwg.org/ | WHATWG URL Standard}
35 *
36 * @param constraints - Constraints to apply when building instances
37 *
38 * @remarks Since 1.14.0
39 * @public
40 */
41export declare function webUrl(constraints?: WebUrlConstraints): Arbitrary<string>;