Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
RandomNumberGenerator class
- Package:
- @microsoft/sp-core-library
This is the default implementation of IRandomNumberGenerator that simply calls Math.random().
Constructors
| (constructor)(serviceScope) | Constructs a new instance of the |
Properties
| serviceKey | The service key for IRandomNumberGenerator. |
Methods
| generate() | Returns a pseudorandom number between 0 (inclusive) and 1 (exclusive), following the contract of Math.random(). |
Constructor Details
(constructor)(serviceScope)
Constructs a new instance of the RandomNumberGenerator class
constructor(serviceScope: ServiceScope);
Parameters
- serviceScope
- ServiceScope
Property Details
serviceKey
The service key for IRandomNumberGenerator.
static readonly serviceKey: IServiceKey<IRandomNumberGenerator>;
Property Value
Method Details
generate()
Returns a pseudorandom number between 0 (inclusive) and 1 (exclusive), following the contract of Math.random().
generate(): number;
Returns
number
