Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "iter/to-array-view-right/docs/types/index.d"

Index

Type aliases

Binary

Binary<T, U, V>: (this: V, value: T, index: number) => U

Map function invoked for each iterated value.

param

iterated value

param

iterated value index

returns

iterator value

Type parameters

  • T

  • U

  • V

Type declaration

    • (this: V, value: T, index: number): U
    • Parameters

      • this: V
      • value: T
      • index: number

      Returns U

Iterator

Type parameters

  • T

MapFunction

MapFunction<T, U, V>: Nullary<U, V> | Unary<T, U, V> | Binary<T, U, V> | Ternary<T, U, V>

Map function invoked for each iterated value.

param

iterated value

param

iterated value index

param

source array-like object

returns

iterator value

Type parameters

  • T

  • U

  • V

Nullary

Nullary<U, V>: (this: V) => U

Map function invoked for each iterated value.

returns

iterator value

Type parameters

  • U

  • V

Type declaration

    • (this: V): U
    • Parameters

      • this: V

      Returns U

Ternary

Ternary<T, U, V>: (this: V, value: T, index: number, src: Collection<U>) => U

Map function invoked for each iterated value.

param

iterated value

param

iterated value index

param

source array-like object

returns

iterator value

Type parameters

  • T

  • U

  • V

Type declaration

    • (this: V, value: T, index: number, src: Collection<U>): U
    • Parameters

      • this: V
      • value: T
      • index: number
      • src: Collection<U>

      Returns U

Unary

Unary<T, U, V>: (this: V, value: T) => U

Map function invoked for each iterated value.

param

iterated value

returns

iterator value

Type parameters

  • T

  • U

  • V

Type declaration

    • (this: V, value: T): U
    • Parameters

      • this: V
      • value: T

      Returns U

Functions

Export assignment iterator2arrayviewRight

  • Fills an array-like object view from right to left with values returned from an iterator.

    throws

    third argument must be an integer (starting index) or a callback function

    Type parameters

    • T

    • U

    • V

    Parameters

    • iterator: Iterator<T>

      source iterator

    • out: Collection<U>

      output array

    • Optional mapFcn: MapFunction<T, U, V>

      function to invoke for each iterated value

    • Optional thisArg: ThisParameterType<MapFunction<T, U, V>>

      execution context

    Returns Collection < U >

    output array

    Example

    var randu = require( '@stdlib/random/iter/randu' );
    var Float64Array = require( '@stdlib/array/float64' );
    
    var iter = randu({
        'iter': 10
    });
    
    var arr = iterator2arrayviewRight( iter, new Float64Array( 20 ) );
    // returns <Float64Array>
  • Fills an array-like object view from right to left with values returned from an iterator.

    throws

    third argument must be an integer (starting index) or a callback function

    Type parameters

    • T

    • U

    • V

    Parameters

    • iterator: Iterator<T>

      source iterator

    • out: Collection<U>

      output array

    • begin: number

      starting index (inclusive) (default: 0)

    • Optional mapFcn: MapFunction<T, U, V>

      function to invoke for each iterated value

    • Optional thisArg: ThisParameterType<MapFunction<T, U, V>>

      execution context

    Returns Collection < U >

    output array

    Example

    var randu = require( '@stdlib/random/iter/randu' );
    var Float64Array = require( '@stdlib/array/float64' );
    
    var iter = randu({
        'iter': 10
    });
    
    var arr = iterator2arrayviewRight( iter, new Float64Array( 20 ), 5 );
    // returns <Float64Array>
  • Fills an array-like object view from right to left with values returned from an iterator.

    throws

    third argument must be an integer (starting index) or a callback function

    throws

    fourth argument must be an integer (ending index) or a callback function

    Type parameters

    • T

    • U

    • V

    Parameters

    • iterator: Iterator<T>

      source iterator

    • out: Collection<U>

      output array

    • begin: number

      starting index (inclusive) (default: 0)

    • end: number

      ending index (non-inclusive) (default: out.length)

    • Optional mapFcn: MapFunction<T, U, V>

      function to invoke for each iterated value

    • Optional thisArg: ThisParameterType<MapFunction<T, U, V>>

      execution context

    Returns Collection < U >

    output array

    Example

    var randu = require( '@stdlib/random/iter/randu' );
    var Float64Array = require( '@stdlib/array/float64' );
    
    var iter = randu({
        'iter': 10
    });
    
    var arr = iterator2arrayviewRight( iter, new Float64Array( 20 ), 5, 8 );
    // returns <Float64Array>