Skip to content

Instantly share code, notes, and snippets.

@orlaqp
Last active April 21, 2016 11:43
Show Gist options
  • Select an option

  • Save orlaqp/d36064d57d35bd751ebe611f55f026ae to your computer and use it in GitHub Desktop.

Select an option

Save orlaqp/d36064d57d35bd751ebe611f55f026ae to your computer and use it in GitHub Desktop.
Minimalist typescript definitions for meteor packages
// meteor/ddp-rate-limiter
declare module "meteor/ddp-rate-limiter" {
export module DDPRateLimiter {
function addRule(options:any, time:number, milliseconds:number):void;
}
}
// meteor/underscore
declare module "meteor/underscore" {
export module _ {
// function pluck(propertyName: string): any[];
function pluck<T extends {}>(
list: _.List<T>,
propertyName: string): any[];
function contains<T>(
list: _.List<T>,
value: T): boolean;
}
}
// validated method
declare module 'meteor/mdg:validated-method' {
interface IValidatedMethodOptions {
name:string;
validate(parameters:any):void;
run(parameters:any):void;
};
function ValidatedMethod(option:IValidatedMethodOptions): any;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment