|
| 1 | +/* |
| 2 | +* @license Apache-2.0 |
| 3 | +* |
| 4 | +* Copyright (c) 2019 The Stdlib Authors. |
| 5 | +* |
| 6 | +* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +* you may not use this file except in compliance with the License. |
| 8 | +* You may obtain a copy of the License at |
| 9 | +* |
| 10 | +* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +* |
| 12 | +* Unless required by applicable law or agreed to in writing, software |
| 13 | +* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +* See the License for the specific language governing permissions and |
| 16 | +* limitations under the License. |
| 17 | +*/ |
| 18 | + |
| 19 | +// TypeScript Version: 2.0 |
| 20 | + |
| 21 | +/** |
| 22 | +* Interface defining `isNegativeNumberArray` with methods for testing for primitive and object arrays, respectively. |
| 23 | +*/ |
| 24 | +interface CheckNegativeNumberArray { |
| 25 | + /** |
| 26 | + * Tests if a value is an array-like object containing only negative numbers. |
| 27 | + * |
| 28 | + * @param value - value to test |
| 29 | + * @returns boolean indicating whether value is an array-like object containing only negative numbers |
| 30 | + * |
| 31 | + * @example |
| 32 | + * var bool = isNegativeNumberArray( [ -3.7, new Number(-3.0) ] ); |
| 33 | + * // returns true |
| 34 | + * |
| 35 | + * @example |
| 36 | + * var bool = isNegativeNumberArray( [ -3.0, '-3.0' ] ); |
| 37 | + * // returns false |
| 38 | + */ |
| 39 | + ( value: any ): boolean; |
| 40 | + |
| 41 | + /** |
| 42 | + * Tests if a value is an array-like object containing only negative primitive number values. |
| 43 | + * |
| 44 | + * @param value - value to test |
| 45 | + * @returns boolean indicating whether value is an array-like object containing only negative primitive number values |
| 46 | + * |
| 47 | + * @example |
| 48 | + * var bool = isNegativeNumberArray.primitives( [ -1.0, -10.0 ] ); |
| 49 | + * // returns true |
| 50 | + * |
| 51 | + * @example |
| 52 | + * var bool = isNegativeNumberArray.primitives( [ -1.0, 0.0, -10.0 ] ); |
| 53 | + * // returns false |
| 54 | + * |
| 55 | + * @example |
| 56 | + * var bool = isNegativeNumberArray.primitives( [ -3.0, new Number(-1.0) ] ); |
| 57 | + * // returns false |
| 58 | + */ |
| 59 | + primitives( value: any ): boolean; |
| 60 | + |
| 61 | + /** |
| 62 | + * Tests if a value is an array-like object containing only number objects having negative number values. |
| 63 | + * |
| 64 | + * @param value - value to test |
| 65 | + * @returns boolean indicating whether value is an array-like object containing only number objects having negative number values |
| 66 | + * |
| 67 | + * @example |
| 68 | + * var bool = isNegativeNumberArray.objects( [ new Number(-1.3), new Number(-10.8) ] ); |
| 69 | + * // returns true |
| 70 | + * |
| 71 | + * @example |
| 72 | + * var bool = isNegativeNumberArray.objects( [ -1.0, 0.0, -10.0 ] ); |
| 73 | + * // returns false |
| 74 | + * |
| 75 | + * @example |
| 76 | + * var bool = isNegativeNumberArray.objects( [ -3.0, new Number(-1.0) ] ); |
| 77 | + * // returns false |
| 78 | + */ |
| 79 | + objects( value: any ): boolean; |
| 80 | +} |
| 81 | + |
| 82 | +/** |
| 83 | +* Tests if a value is an array-like object containing only negative numbers. |
| 84 | +* |
| 85 | +* @param value - value to test |
| 86 | +* @returns boolean indicating whether value is an array-like object containing only negative numbers |
| 87 | +* |
| 88 | +* @example |
| 89 | +* var bool = isNegativeNumberArray( [ -3.7, new Number(-3.0) ] ); |
| 90 | +* // returns true |
| 91 | +* |
| 92 | +* @example |
| 93 | +* var bool = isNegativeNumberArray( [ -3.7, '-3.0' ] ); |
| 94 | +* // returns false |
| 95 | +* |
| 96 | +* @example |
| 97 | +* var bool = isNegativeNumberArray.primitives( [ -1.3, -10.0 ] ); |
| 98 | +* // returns true |
| 99 | +* |
| 100 | +* @example |
| 101 | +* var bool = isNegativeNumberArray.objects( [ new Number(-1.3), new Number(-10.0) ] ); |
| 102 | +* // returns true |
| 103 | +*/ |
| 104 | +declare var isNegativeNumberArray: CheckNegativeNumberArray; |
| 105 | + |
| 106 | + |
| 107 | +// EXPORTS // |
| 108 | + |
| 109 | +export = isNegativeNumberArray; |
0 commit comments