Skip to content

Commit 72ac2e6

Browse files
committed
feat!: refactor declarations to preserve type info
1 parent 8b22739 commit 72ac2e6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/node_modules/@stdlib/random/iter/bernoulli/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// <reference types="@stdlib/types"/>
2222

2323
import * as random from '@stdlib/types/random';
24-
import { Iterator } from '@stdlib/types/iter';
24+
import { TypedIterator } from '@stdlib/types/iter';
2525

2626
/**
2727
* Interface defining function options.
@@ -56,7 +56,7 @@ interface Options {
5656
/**
5757
* Interface for iterators of pseudorandom numbers drawn from a Bernoulli distribution.
5858
*/
59-
interface RandIter extends Iterator {
59+
interface Iterator<T> extends TypedIterator<T> {
6060
/**
6161
* Underlying PRNG.
6262
*/
@@ -112,7 +112,7 @@ interface RandIter extends Iterator {
112112
*
113113
* // ...
114114
*/
115-
declare function iterator( p: number, options?: Options ): RandIter;
115+
declare function iterator( p: number, options?: Options ): Iterator<number>;
116116

117117

118118
// EXPORTS //

lib/node_modules/@stdlib/random/iter/bernoulli/docs/types/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import iterator = require( './index' );
2323

2424
// The function returns an iterator...
2525
{
26-
iterator( 0.3 ); // $ExpectType RandIter
27-
iterator( 0.5, {} ); // $ExpectType RandIter
28-
iterator( 0.5, { 'iter': 10 } ); // $ExpectType RandIter
26+
iterator( 0.3 ); // $ExpectType Iterator<number>
27+
iterator( 0.5, {} ); // $ExpectType Iterator<number>
28+
iterator( 0.5, { 'iter': 10 } ); // $ExpectType Iterator<number>
2929
}
3030

3131
// The compiler throws an error if the function is provided an invalid input argument...

0 commit comments

Comments
 (0)