From 161dc46c8dbe5691b3a6ac6e796cc69e855a327a Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Tue, 13 Jan 2026 02:48:28 +0000 Subject: [PATCH] feat: update `random/tools` TypeScript declarations Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> --- .../random/tools/docs/types/index.d.ts | 126 +++++++++++++++++- 1 file changed, 122 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/random/tools/docs/types/index.d.ts b/lib/node_modules/@stdlib/random/tools/docs/types/index.d.ts index 3e24bf0e673e..e3e11ab4a69b 100644 --- a/lib/node_modules/@stdlib/random/tools/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/random/tools/docs/types/index.d.ts @@ -22,6 +22,8 @@ import binary = require( '@stdlib/random/tools/binary' ); import binaryFactory = require( '@stdlib/random/tools/binary-factory' ); +import ternary = require( '@stdlib/random/tools/ternary' ); +import ternaryFactory = require( '@stdlib/random/tools/ternary-factory' ); import unary = require( '@stdlib/random/tools/unary' ); import unaryFactory = require( '@stdlib/random/tools/unary-factory' ); @@ -53,7 +55,7 @@ interface Namespace { * 'order': 'row-major' * }; * - * var rand = new Random( uniform, [ idt, idt ], odt, policies, options ); + * var rand = new ns.binary( uniform, [ idt, idt ], odt, policies, options ); * * var v = rand.generate( [ 2, 2 ], 0.0, 1.0 ); * // returns @@ -73,7 +75,7 @@ interface Namespace { * 'order': 'row-major' * }; * - * var rand = new Random( uniform, [ idt, idt ], odt, policies, options ); + * var rand = new ns.binary( uniform, [ idt, idt ], odt, policies, options ); * * var out = ndzeros( [ 2, 2 ] ); * var v = rand.assign( 0.0, 1.0, out ); @@ -145,6 +147,122 @@ interface Namespace { */ binaryFactory: typeof binaryFactory; + /** + * Constructor for creating ndarrays filled with pseudorandom values drawn from a ternary PRNG. + * + * @param prng - ternary pseudorandom value generator + * @param idtypes - list containing a list of supported input data types for each PRNG parameter + * @param odtypes - list of supported output data types + * @param policies - dispatch policies + * @param options - function options + * @returns instance + * + * @example + * var dtypes = require( '@stdlib/ndarray/dtypes' ); + * var frechet = require( '@stdlib/random/base/frechet' ); + * + * var idt = dtypes( 'real_and_generic' ); + * var odt = dtypes( 'real_floating_point_and_generic' ); + * + * var policies = { + * 'output': 'real_floating_point_and_generic' + * }; + * var options = { + * 'order': 'row-major' + * }; + * + * var rand = new ns.ternary( frechet, [ idt, idt, idt ], odt, policies, options ); + * + * var v = rand.generate( [ 2, 2 ], 2.0, 3.0, 0.0 ); + * // returns + * + * @example + * var dtypes = require( '@stdlib/ndarray/dtypes' ); + * var ndzeros = require( '@stdlib/ndarray/zeros' ); + * var frechet = require( '@stdlib/random/base/frechet' ); + * + * var idt = dtypes( 'real_and_generic' ); + * var odt = dtypes( 'real_floating_point_and_generic' ); + * + * var policies = { + * 'output': 'real_floating_point_and_generic' + * }; + * var options = { + * 'order': 'row-major' + * }; + * + * var rand = new ns.ternary( frechet, [ idt, idt, idt ], odt, policies, options ); + * + * var out = ndzeros( [ 2, 2 ] ); + * var v = rand.assign( 2.0, 3.0, 0.0, out ); + * // returns + * + * var bool = ( v === out ); + * // returns true + */ + ternary: typeof ternary; + + /** + * Returns a function for generating pseudorandom values drawn from a ternary PRNG. + * + * @param prng - ternary pseudorandom value generator + * @param idtypes - list containing a list of supported input data types for each PRNG parameter + * @param odtypes - list of supported output data types + * @param policies - dispatch policies + * @param options - function options + * @returns instance + * + * @example + * var dtypes = require( '@stdlib/ndarray/dtypes' ); + * var frechet = require( '@stdlib/random/base/frechet' ); + * + * var idt = dtypes( 'real_and_generic' ); + * var odt = dtypes( 'real_floating_point_and_generic' ); + * + * var policies = { + * 'output': 'real_floating_point_and_generic' + * }; + * var options = { + * 'order': 'row-major' + * }; + * + * var factory = ns.ternaryFactory( frechet, [ idt, idt, idt ], odt, policies, options ); + * + * var rand = factory(); + * // returns + * + * var v = rand( [ 2, 2 ], 2.0, 3.0, 0.0 ); + * // returns + * + * @example + * var dtypes = require( '@stdlib/ndarray/dtypes' ); + * var ndzeros = require( '@stdlib/ndarray/zeros' ); + * var frechet = require( '@stdlib/random/base/frechet' ); + * + * var idt = dtypes( 'real_and_generic' ); + * var odt = dtypes( 'real_floating_point_and_generic' ); + * + * var policies = { + * 'output': 'real_floating_point_and_generic' + * }; + * var options = { + * 'order': 'row-major' + * }; + * + * var factory = ns.ternaryFactory( frechet, [ idt, idt, idt ], odt, policies, options ); + * + * var rand = factory(); + * // returns + * + * var out = ndzeros( [ 2, 2 ] ); + * var v = rand.assign( 2.0, 3.0, 0.0, out ); + * // returns + * + * var bool = ( v === out ); + * // returns true + */ + ternaryFactory: typeof ternaryFactory; + /** * Constructor for creating ndarrays filled with pseudorandom values drawn from a unary PRNG. * @@ -169,7 +287,7 @@ interface Namespace { * 'order': 'row-major' * }; * - * var rand = new Random( exponential, idt, odt, policies, options ); + * var rand = new ns.unary( exponential, idt, odt, policies, options ); * * var v = rand.generate( [ 2, 2 ], 2.0 ); * // returns @@ -189,7 +307,7 @@ interface Namespace { * 'order': 'row-major' * }; * - * var rand = new Random( exponential, idt, odt, policies, options ); + * var rand = new ns.unary( exponential, idt, odt, policies, options ); * * var out = ndzeros( [ 2, 2 ] ); * var v = rand.assign( 2.0, out );