diff --git a/gravatar/gravatar-tests.ts b/gravatar/gravatar-tests.ts new file mode 100644 index 000000000..d0edb4e64 --- /dev/null +++ b/gravatar/gravatar-tests.ts @@ -0,0 +1,14 @@ +/// + +import gravatar = require('gravatar'); + +gravatar.url("email@example.com"); +gravatar.url("email@example.com", { s: "200", r: "pg", d: "404" }); +gravatar.url("email@example.com", { size: "200", r: "pg", d: "404" }); +gravatar.url("email@example.com", { s: "200" }); +gravatar.url("email@example.com", { default: "404" }); +gravatar.url("email@example.com", { s: "200", rating: "pg", d: "404" }, true); +gravatar.url("email@example.com", { s: "200", r: "pg", default: "404" }, false); +gravatar.url("email@example.com", { d: "404" }, false); +gravatar.url("email@example.com", { forcedefault: "y" }, false); +gravatar.url("email@example.com", { f: "y" }); diff --git a/gravatar/gravatar.d.ts b/gravatar/gravatar.d.ts new file mode 100644 index 000000000..42ef46bb6 --- /dev/null +++ b/gravatar/gravatar.d.ts @@ -0,0 +1,23 @@ +// Type definitions for gravatar v1.4.0 +// Project: https://github.com/emerleite/node-gravatar +// Definitions by: Denis Sokolov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module GravatarModule { + type Options = { + d?: string + default?: string + f?: string + forcedefault?: string + r?: string + rating?: string + s?: string + size?: string + } + + function url(email: string, options?: Options, forceProtocol?: boolean): string; +} + +declare module "gravatar" { + export = GravatarModule; +}