1 | import * as common from './common';
|
2 | /**
|
3 | * Represents an IPv4 address
|
4 | * @class Address4
|
5 | * @param {string} address - An IPv4 address string
|
6 | */
|
7 | export declare class Address4 {
|
8 | address: string;
|
9 | addressMinusSuffix?: string;
|
10 | groups: number;
|
11 | parsedAddress: string[];
|
12 | parsedSubnet: string;
|
13 | subnet: string;
|
14 | subnetMask: number;
|
15 | v4: boolean;
|
16 | constructor(address: string);
|
17 | static isValid(address: string): boolean;
|
18 | parse(address: string): string[];
|
19 | /**
|
20 | * Returns the correct form of an address
|
21 | * @memberof Address4
|
22 | * @instance
|
23 | * @returns {String}
|
24 | */
|
25 | correctForm(): string;
|
26 | /**
|
27 | * Returns true if the address is correct, false otherwise
|
28 | * @memberof Address4
|
29 | * @instance
|
30 | * @returns {Boolean}
|
31 | */
|
32 | isCorrect: (this: Address4 | import("./ipv6").Address6) => boolean;
|
33 | /**
|
34 | * Converts a hex string to an IPv4 address object
|
35 | * @memberof Address4
|
36 | * @static
|
37 | * @param {string} hex - a hex string to convert
|
38 | * @returns {Address4}
|
39 | */
|
40 | static fromHex(hex: string): Address4;
|
41 | /**
|
42 | * Converts an integer into a IPv4 address object
|
43 | * @memberof Address4
|
44 | * @static
|
45 | * @param {integer} integer - a number to convert
|
46 | * @returns {Address4}
|
47 | */
|
48 | static fromInteger(integer: number): Address4;
|
49 | /**
|
50 | * Return an address from in-addr.arpa form
|
51 | * @memberof Address4
|
52 | * @static
|
53 | * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address
|
54 | * @returns {Adress4}
|
55 | * @example
|
56 | * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.)
|
57 | * address.correctForm(); // '192.0.2.42'
|
58 | */
|
59 | static fromArpa(arpaFormAddress: string): Address4;
|
60 | /**
|
61 | * Converts an IPv4 address object to a hex string
|
62 | * @memberof Address4
|
63 | * @instance
|
64 | * @returns {String}
|
65 | */
|
66 | toHex(): string;
|
67 | /**
|
68 | * Converts an IPv4 address object to an array of bytes
|
69 | * @memberof Address4
|
70 | * @instance
|
71 | * @returns {Array}
|
72 | */
|
73 | toArray(): number[];
|
74 | /**
|
75 | * Converts an IPv4 address object to an IPv6 address group
|
76 | * @memberof Address4
|
77 | * @instance
|
78 | * @returns {String}
|
79 | */
|
80 | toGroup6(): string;
|
81 | /**
|
82 | * Returns the address as a `bigint`
|
83 | * @memberof Address4
|
84 | * @instance
|
85 | * @returns {bigint}
|
86 | */
|
87 | bigInt(): bigint;
|
88 | /**
|
89 | * Helper function getting start address.
|
90 | * @memberof Address4
|
91 | * @instance
|
92 | * @returns {bigint}
|
93 | */
|
94 | _startAddress(): bigint;
|
95 | /**
|
96 | * The first address in the range given by this address' subnet.
|
97 | * Often referred to as the Network Address.
|
98 | * @memberof Address4
|
99 | * @instance
|
100 | * @returns {Address4}
|
101 | */
|
102 | startAddress(): Address4;
|
103 | /**
|
104 | * The first host address in the range given by this address's subnet ie
|
105 | * the first address after the Network Address
|
106 | * @memberof Address4
|
107 | * @instance
|
108 | * @returns {Address4}
|
109 | */
|
110 | startAddressExclusive(): Address4;
|
111 | /**
|
112 | * Helper function getting end address.
|
113 | * @memberof Address4
|
114 | * @instance
|
115 | * @returns {bigint}
|
116 | */
|
117 | _endAddress(): bigint;
|
118 | /**
|
119 | * The last address in the range given by this address' subnet
|
120 | * Often referred to as the Broadcast
|
121 | * @memberof Address4
|
122 | * @instance
|
123 | * @returns {Address4}
|
124 | */
|
125 | endAddress(): Address4;
|
126 | /**
|
127 | * The last host address in the range given by this address's subnet ie
|
128 | * the last address prior to the Broadcast Address
|
129 | * @memberof Address4
|
130 | * @instance
|
131 | * @returns {Address4}
|
132 | */
|
133 | endAddressExclusive(): Address4;
|
134 | /**
|
135 | * Converts a BigInt to a v4 address object
|
136 | * @memberof Address4
|
137 | * @static
|
138 | * @param {bigint} bigInt - a BigInt to convert
|
139 | * @returns {Address4}
|
140 | */
|
141 | static fromBigInt(bigInt: bigint): Address4;
|
142 | /**
|
143 | * Returns the first n bits of the address, defaulting to the
|
144 | * subnet mask
|
145 | * @memberof Address4
|
146 | * @instance
|
147 | * @returns {String}
|
148 | */
|
149 | mask(mask?: number): string;
|
150 | /**
|
151 | * Returns the bits in the given range as a base-2 string
|
152 | * @memberof Address4
|
153 | * @instance
|
154 | * @returns {string}
|
155 | */
|
156 | getBitsBase2(start: number, end: number): string;
|
157 | /**
|
158 | * Return the reversed ip6.arpa form of the address
|
159 | * @memberof Address4
|
160 | * @param {Object} options
|
161 | * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix
|
162 | * @instance
|
163 | * @returns {String}
|
164 | */
|
165 | reverseForm(options?: common.ReverseFormOptions): string;
|
166 | /**
|
167 | * Returns true if the given address is in the subnet of the current address
|
168 | * @memberof Address4
|
169 | * @instance
|
170 | * @returns {boolean}
|
171 | */
|
172 | isInSubnet: typeof common.isInSubnet;
|
173 | /**
|
174 | * Returns true if the given address is a multicast address
|
175 | * @memberof Address4
|
176 | * @instance
|
177 | * @returns {boolean}
|
178 | */
|
179 | isMulticast(): boolean;
|
180 | /**
|
181 | * Returns a zero-padded base-2 string representation of the address
|
182 | * @memberof Address4
|
183 | * @instance
|
184 | * @returns {string}
|
185 | */
|
186 | binaryZeroPad(): string;
|
187 | /**
|
188 | * Groups an IPv4 address for inclusion at the end of an IPv6 address
|
189 | * @returns {String}
|
190 | */
|
191 | groupForV6(): string;
|
192 | }
|
193 | //# sourceMappingURL=ipv4.d.ts.map |
\ | No newline at end of file |