mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
Merge pull request #6544 from DanielRosenwasser/takeAChance
Allow 'chance' to be callable, and also self-referential as a module
This commit is contained in:
@@ -34,3 +34,6 @@ chance.mixin({
|
||||
});
|
||||
|
||||
var timeString: string = chance.time();
|
||||
|
||||
var chanceConstructedWithSeed100 = new Chance(100);
|
||||
var chanceCalledWithSeed100 = Chance()
|
||||
Vendored
+9
-1
@@ -5,7 +5,10 @@
|
||||
declare module Chance {
|
||||
|
||||
interface ChanceStatic {
|
||||
Chance(): Chance;
|
||||
(): Chance
|
||||
(seed: number): Chance
|
||||
(generator: () => any): Chance
|
||||
|
||||
new(): Chance;
|
||||
new(seed: number): Chance;
|
||||
new(generator: () => any): Chance;
|
||||
@@ -209,5 +212,10 @@ declare var Chance: Chance.ChanceStatic;
|
||||
|
||||
// import Chance = require('chance');
|
||||
declare module 'chance' {
|
||||
interface ExportedChance extends Chance.ChanceStatic {
|
||||
Chance: ExportedChance;
|
||||
}
|
||||
var Chance: ExportedChance;
|
||||
|
||||
export = Chance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user