UNPKG

1.47 kBTypeScriptView Raw
1import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js';
2import type { SizeForArbitrary } from './_internals/helpers/MaxLengthFromMinLength.js';
3/**
4 * Constraints to be applied on {@link webAuthority}
5 * @remarks Since 1.14.0
6 * @public
7 */
8export interface WebAuthorityConstraints {
9 /**
10 * Enable IPv4 in host
11 * @defaultValue false
12 * @remarks Since 1.14.0
13 */
14 withIPv4?: boolean;
15 /**
16 * Enable IPv6 in host
17 * @defaultValue false
18 * @remarks Since 1.14.0
19 */
20 withIPv6?: boolean;
21 /**
22 * Enable extended IPv4 format
23 * @defaultValue false
24 * @remarks Since 1.17.0
25 */
26 withIPv4Extended?: boolean;
27 /**
28 * Enable user information prefix
29 * @defaultValue false
30 * @remarks Since 1.14.0
31 */
32 withUserInfo?: boolean;
33 /**
34 * Enable port suffix
35 * @defaultValue false
36 * @remarks Since 1.14.0
37 */
38 withPort?: boolean;
39 /**
40 * Define how large the generated values should be (at max)
41 * @remarks Since 2.22.0
42 */
43 size?: Exclude<SizeForArbitrary, 'max'>;
44}
45/**
46 * For web authority
47 *
48 * According to {@link https://www.ietf.org/rfc/rfc3986.txt | RFC 3986} - `authority = [ userinfo "@" ] host [ ":" port ]`
49 *
50 * @param constraints - Constraints to apply when building instances
51 *
52 * @remarks Since 1.14.0
53 * @public
54 */
55export declare function webAuthority(constraints?: WebAuthorityConstraints): Arbitrary<string>;