Skip to content

Instantly share code, notes, and snippets.

@vmadman
Created December 19, 2013 04:13
Show Gist options
  • Save vmadman/8034329 to your computer and use it in GitHub Desktop.
Save vmadman/8034329 to your computer and use it in GitHub Desktop.
This is *my* current temporary fix to get SugarJS's static method additions working in typescript.
/// <reference path="../path/to/sugar.d.ts" />
/**
* Usage Examples:
* sgObject.isArray([1]); // -> true
*/
declare var sgObject:ObjectStatic;
declare var sgNumber:NumberStatic;
declare var sgDate:DateStatic;
declare var sgRegExp:RegExpStatic;
eval(
"sgObject = Object;" +
"sgNumber = Number;" +
"sgDate = Date;" +
"sgRegExp = RegExp;"
);
@xps
Copy link

xps commented Dec 19, 2013

Just realized that regarding the second point, you could actually just copy the definitions over from Date to DateStatic (maybe that's what you did).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment