Skip to content

Commit b6df817

Browse files
committed
docs: fix types
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 5f1f0a4 commit b6df817

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/node_modules/@stdlib/array/typed/docs/types/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
/// <reference types="@stdlib/types"/>
2424

25-
import { RealOrComplexTypedArray, TypedDataTypeMap } from '@stdlib/types/array';
25+
import { RealOrComplexTypedArray, TypedDataTypeMap, Collection } from '@stdlib/types/array';
26+
import { Iterator } from '@stdlib/types/iter';
2627
import ArrayBuffer = require( '@stdlib/array/buffer' );
2728

2829
/**
@@ -100,7 +101,7 @@ declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( typed
100101
* var arr = typedarray( [ 5, -3 ], 'int32' );
101102
* // returns <Int32Array>[ 5, -3 ]
102103
*/
103-
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( obj: ArrayLike<number> | Iterable<any>, dtype?: T ): TypedDataTypeMap[T];
104+
declare function typedarray<T extends keyof TypedDataTypeMap = 'float64'>( obj: Collection<unknown> | Iterator, dtype?: T ): TypedDataTypeMap[T];
104105

105106
/**
106107
* Creates a typed array.

lib/node_modules/@stdlib/array/typed/docs/types/test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@
1616
* limitations under the License.
1717
*/
1818

19+
import array2iterator = require( '@stdlib/array/to-iterator' );
20+
import ArrayBuffer = require( '@stdlib/array/buffer' );
1921
import typedarray = require( './index' );
2022

2123

2224
// TESTS //
2325

24-
// The function returns a typed array..
26+
// The function returns a typed array...
2527
{
2628
typedarray(); // $ExpectType Float64Array
29+
typedarray( [ 1, 2, 3 ] ); // $ExpectType Float64Array
30+
typedarray( array2iterator( [ 1, 2, 3 ] ) ); // $ExpectType Float64Array
31+
typedarray( new ArrayBuffer( 10 ) ); // $ExpectType Float64Array
32+
2733
typedarray( 'float32' ); // $ExpectType Float32Array
2834
typedarray( 10, 'float32' ); // $ExpectType Float32Array
2935
typedarray( [ 1, 2, 3 ], 'int32' ); // $ExpectType Int32Array

0 commit comments

Comments
 (0)