toosoon-prng-controllers
Version:
This project provides PRNG functions with a set of Controllers for generating pseudo-random values using a seed-based approach and various algorithms
41 lines (40 loc) • 1.11 kB
TypeScript
import { type AlgorithmFunction, type AlgorithmName, PRNG as BasePRNG } from 'toosoon-prng';
import { type PRNGController } from './controllers';
/**
* Utility class for generating pseudo-random values and managing PRNG Controllers
*
* @exports
* @class PRNG
* @extends BasePRNG
*/
export declare class PRNG extends BasePRNG {
controllers: PRNGController[];
set seed(seed: string | number);
set algorithm(algorithm: AlgorithmFunction);
/**
* Add a controller to this PRNG
*
* @param {PRNGController} controller
*/
addController(controller: PRNGController): void;
/**
* Remove a controller from this PRNG
*
* @param {PRNGController} controller
*/
removeController(controller: PRNGController): void;
/**
* Set this PRNG seed
*
* @param {string|number} seed
*/
setSeed(seed: string | number): void;
/**
* Set this PRNG algorithm
*
* @param {AlgorithmName} algorithmName Algorithm name
*/
setAlgorithm(algorithmName: AlgorithmName): void;
}
declare const prng: PRNG;
export default prng;