Skip to content

Commit 3011b17

Browse files
committed
several optimzations
1 parent f545499 commit 3011b17

4 files changed

Lines changed: 1163 additions & 1230 deletions

dist/javascript-interface-library.d.ts

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
export declare const acceptNil = true;
22

3+
export declare const allowAbsoluteURL: (Description: string, Argument: any, allowedProtocols?: string[] | undefined) => string | null | undefined;
4+
35
export declare const allowAnonymousFunction: (Description: string, Argument: any) => Function | null | undefined;
46

5-
/**** allow[ed]Array ****/
6-
export declare function allowArray(Description: string, Argument: any): any[] | null | undefined;
7+
export declare const allowArray: (Description: string, Argument: any) => any[] | null | undefined;
78

89
export declare const allowArrayBuffer: (Description: string, Argument: any) => ArrayBuffer | null | undefined;
910

@@ -21,9 +22,11 @@ export declare const allowDate: (Description: string, Argument: any) => Date | n
2122

2223
export declare const allowE164PhoneNumber: (Description: string, Argument: any) => string | null | undefined;
2324

25+
export declare const allowedAbsoluteURL: (Description: string, Argument: any, allowedProtocols?: string[] | undefined) => string | null | undefined;
26+
2427
export declare const allowedAnonymousFunction: (Description: string, Argument: any) => Function | null | undefined;
2528

26-
export declare const allowedArray: typeof allowArray;
29+
export declare const allowedArray: (Description: string, Argument: any) => any[] | null | undefined;
2730

2831
export declare const allowedArrayBuffer: (Description: string, Argument: any) => ArrayBuffer | null | undefined;
2932

@@ -55,11 +58,11 @@ export declare const allowedHostName: (Description: string, Argument: any) => st
5558

5659
export declare const allowedIdentifier: (Description: string, Argument: any) => string | null | undefined;
5760

58-
export declare const allowedInstanceOf: typeof allowInstanceOf;
61+
export declare const allowedInstanceOf: (Description: string, Argument: any, constructor: Function, Expectation: string) => any;
5962

6063
export declare const allowedInteger: (Description: string, Argument: any) => number | null | undefined;
6164

62-
export declare const allowedIntegerInRange: typeof allowIntegerInRange;
65+
export declare const allowedIntegerInRange: (Description: string, Argument: any, minValue?: number | undefined, maxValue?: number | undefined) => number | null | undefined;
6366

6467
export declare const allowedIPv4Address: (Description: string, Argument: any) => string | null | undefined;
6568

@@ -71,11 +74,11 @@ export declare const allowedISOTimestamp: (Description: string, Argument: any) =
7174

7275
export declare const allowedJSONString: (Description: string, Argument: any) => string | null | undefined;
7376

74-
export declare const allowedList: typeof allowList;
77+
export declare const allowedList: (Description: string, Argument: any, Expectation?: string | undefined, minLength?: number | undefined, maxLength?: number | undefined) => any[] | null | undefined;
7578

76-
export declare const allowedListOf: typeof allowListOf;
79+
export declare const allowedListOf: (Description: string, Argument: any, ValueList: any[]) => any[] | null | undefined;
7780

78-
export declare const allowedListSatisfying: typeof allowListSatisfying;
81+
export declare const allowedListSatisfying: (Description: string, Argument: any, Validator: (Value: any) => boolean, Expectation?: string | undefined, minLength?: number | undefined, maxLength?: number | undefined) => any[] | null | undefined;
7982

8083
export declare const allowedMap: (Description: string, Argument: any) => Map<any, any> | null | undefined;
8184

@@ -89,11 +92,11 @@ export declare const allowedNonEmptyString: (Description: string, Argument: any)
8992

9093
export declare const allowedNumber: (Description: string, Argument: any) => number | null | undefined;
9194

92-
export declare const allowedNumberInRange: typeof allowNumberInRange;
95+
export declare const allowedNumberInRange: (Description: string, Argument: any, minValue?: number | undefined, maxValue?: number | undefined, withMin?: boolean | undefined, withMax?: boolean | undefined) => number | null | undefined;
9396

9497
export declare const allowedObject: (Description: string, Argument: any) => object | null | undefined;
9598

96-
export declare const allowedOneOf: typeof allowOneOf;
99+
export declare const allowedOneOf: (Description: string, Argument: any, ValueList: any[]) => any;
97100

98101
export declare const allowedOrdinal: (Description: string, Argument: any) => number | null | undefined;
99102

@@ -117,7 +120,7 @@ export declare const allowedSet: (Description: string, Argument: any) => Set<any
117120

118121
export declare const allowedString: (Description: string, Argument: any) => string | null | undefined;
119122

120-
export declare const allowedStringMatching: typeof allowStringMatching;
123+
export declare const allowedStringMatching: (Description: string, Argument: any, Pattern: RegExp) => string | null | undefined;
121124

122125
export declare const allowedSymbol: (Description: string, Argument: any) => symbol | null | undefined;
123126

@@ -133,7 +136,7 @@ export declare const allowedUUID: (Description: string, Argument: any) => string
133136

134137
export declare const allowedValue: typeof allowValue;
135138

136-
export declare const allowedValueInheritingFrom: typeof allowValueInheritingFrom;
139+
export declare const allowedValueInheritingFrom: (Description: string, Argument: any, prototype: any, Expectation: string) => any;
137140

138141
export declare const allowedVanillaObject: (Description: string, Argument: any) => object | null | undefined;
139142

@@ -151,13 +154,11 @@ export declare const allowHostName: (Description: string, Argument: any) => stri
151154

152155
export declare const allowIdentifier: (Description: string, Argument: any) => string | null | undefined;
153156

154-
/**** allow[ed]InstanceOf ****/
155-
export declare function allowInstanceOf(Description: string, Argument: any, constructor: Function, Expectation: string): any | null | undefined;
157+
export declare const allowInstanceOf: (Description: string, Argument: any, constructor: Function, Expectation: string) => any;
156158

157159
export declare const allowInteger: (Description: string, Argument: any) => number | null | undefined;
158160

159-
/**** allow[ed]IntegerInRange ****/
160-
export declare function allowIntegerInRange(Description: string, Argument: any, minValue?: number, maxValue?: number): number | null | undefined;
161+
export declare const allowIntegerInRange: (Description: string, Argument: any, minValue?: number | undefined, maxValue?: number | undefined) => number | null | undefined;
161162

162163
export declare const allowIPv4Address: (Description: string, Argument: any) => string | null | undefined;
163164

@@ -169,14 +170,11 @@ export declare const allowISOTimestamp: (Description: string, Argument: any) =>
169170

170171
export declare const allowJSONString: (Description: string, Argument: any) => string | null | undefined;
171172

172-
/**** allow[ed]List ****/
173-
export declare function allowList(Description: string, Argument: any, Expectation?: string, minLength?: number, maxLength?: number): any[] | null | undefined;
173+
export declare const allowList: (Description: string, Argument: any, Expectation?: string | undefined, minLength?: number | undefined, maxLength?: number | undefined) => any[] | null | undefined;
174174

175-
/**** allow/expect[ed]ListOf ****/
176-
export declare function allowListOf(Description: string, Argument: any, ValueList: any[]): any[] | null | undefined;
175+
export declare const allowListOf: (Description: string, Argument: any, ValueList: any[]) => any[] | null | undefined;
177176

178-
/**** allow[ed]ListSatisfying ****/
179-
export declare function allowListSatisfying(Description: string, Argument: any, Validator: (Value: any) => boolean, Expectation?: string, minLength?: number, maxLength?: number): any[] | null | undefined;
177+
export declare const allowListSatisfying: (Description: string, Argument: any, Validator: (Value: any) => boolean, Expectation?: string | undefined, minLength?: number | undefined, maxLength?: number | undefined) => any[] | null | undefined;
180178

181179
export declare const allowMap: (Description: string, Argument: any) => Map<any, any> | null | undefined;
182180

@@ -190,13 +188,11 @@ export declare const allowNonEmptyString: (Description: string, Argument: any) =
190188

191189
export declare const allowNumber: (Description: string, Argument: any) => number | null | undefined;
192190

193-
/**** allow[ed]NumberInRange ****/
194-
export declare function allowNumberInRange(Description: string, Argument: any, minValue?: number, maxValue?: number, withMin?: boolean, withMax?: boolean): number | null | undefined;
191+
export declare const allowNumberInRange: (Description: string, Argument: any, minValue?: number | undefined, maxValue?: number | undefined, withMin?: boolean | undefined, withMax?: boolean | undefined) => number | null | undefined;
195192

196193
export declare const allowObject: (Description: string, Argument: any) => object | null | undefined;
197194

198-
/**** allow[ed]OneOf ****/
199-
export declare function allowOneOf(Description: string, Argument: any, ValueList: any[]): any | null | undefined;
195+
export declare const allowOneOf: (Description: string, Argument: any, ValueList: any[]) => any;
200196

201197
export declare const allowOrdinal: (Description: string, Argument: any) => number | null | undefined;
202198

@@ -220,8 +216,7 @@ export declare const allowSet: (Description: string, Argument: any) => Set<any>
220216

221217
export declare const allowString: (Description: string, Argument: any) => string | null | undefined;
222218

223-
/**** allow[ed]StringMatching ****/
224-
export declare function allowStringMatching(Description: string, Argument: any, Pattern: RegExp): string | null | undefined;
219+
export declare const allowStringMatching: (Description: string, Argument: any, Pattern: RegExp) => string | null | undefined;
225220

226221
export declare const allowSymbol: (Description: string, Argument: any) => symbol | null | undefined;
227222

@@ -238,8 +233,7 @@ export declare const allowUUID: (Description: string, Argument: any) => string |
238233
/**** allow[ed]Value ****/
239234
export declare function allowValue(Description: string, Argument: any, Validator?: Function): any;
240235

241-
/**** allow[ed]ValueInheritingFrom ****/
242-
export declare function allowValueInheritingFrom(Description: string, Argument: any, prototype: any, Expectation: string): any | null | undefined;
236+
export declare const allowValueInheritingFrom: (Description: string, Argument: any, prototype: any, Expectation: string) => any;
243237

244238
export declare const allowVanillaObject: (Description: string, Argument: any) => object | null | undefined;
245239

@@ -399,6 +393,9 @@ export declare function constrained(Value: number, Minimum?: number, Maximum?: n
399393

400394
export declare function escaped(Text: string): string;
401395

396+
/**** expect[ed]AbsoluteURL ****/
397+
export declare function expectAbsoluteURL(Description: string, Argument: any, allowedProtocols?: string[]): string;
398+
402399
export declare const expectAnonymousFunction: (Description: string, Argument: any) => Function;
403400

404401
/**** expect[ed]Array ****/
@@ -420,6 +417,8 @@ export declare const expectDate: (Description: string, Argument: any) => Date;
420417

421418
export declare const expectE164PhoneNumber: (Description: string, Argument: any) => string;
422419

420+
export declare const expectedAbsoluteURL: typeof expectAbsoluteURL;
421+
423422
export declare const expectedAnonymousFunction: (Description: string, Argument: any) => Function;
424423

425424
export declare const expectedArray: typeof expectArray;
@@ -655,22 +654,22 @@ export declare function HTMLsafe(Argument: string, EOLReplacement?: string): str
655654
export declare function MarkDownSafe(Argument: string, EOLReplacement?: string): string;
656655

657656
/**** Object_hasOwnProperty ****/
658-
export declare function Object_hasOwnProperty(Value: Object, PropertyName: string): boolean;
657+
export declare const Object_hasOwnProperty: (Value: Object, PropertyName: string) => boolean;
659658

660659
/**** Object_isPrototypeOf ****/
661-
export declare function Object_isPrototypeOf(Value: Object, Candidate: any): boolean;
660+
export declare const Object_isPrototypeOf: (Value: Object, Candidate: any) => boolean;
662661

663662
/**** Object_propertyIsEnumerable ****/
664-
export declare function Object_propertyIsEnumerable(Value: Object, PropertyName: string): boolean;
663+
export declare const Object_propertyIsEnumerable: (Value: Object, PropertyName: string) => boolean;
665664

666665
/**** Object_toLocaleString ****/
667666
export declare function Object_toLocaleString(Value: Object): string;
668667

669668
/**** Object_toString ****/
670-
export declare function Object_toString(Value: Object): string;
669+
export declare const Object_toString: (Value: Object) => string;
671670

672671
/**** Object_valueOf ****/
673-
export declare function Object_valueOf(Value: Object): any;
672+
export declare const Object_valueOf: (Value: Object) => any;
674673

675674
/**** ObjectIsEmpty ****/
676675
export declare function ObjectIsEmpty(Candidate: any): boolean;
@@ -733,6 +732,8 @@ export declare function ValueExists(Value: unknown): boolean;
733732
/**** ValueInheritsFrom ****/
734733
export declare function ValueInheritsFrom(Value: unknown, Prototype: object): boolean;
735734

735+
export declare function ValueIsAbsoluteURL(Value: unknown, allowedProtocols?: string[]): Value is string;
736+
736737
/**** ValueIsAnonymousFunction ****/
737738
export declare function ValueIsAnonymousFunction(Value: unknown): Value is Function;
738739

0 commit comments

Comments
 (0)