Add typings for gravatar

This commit is contained in:
Denis Sokolov
2016-03-09 15:06:39 +02:00
parent bd269cad4c
commit f230764afd
2 changed files with 37 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="gravatar.d.ts" />
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" });
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for gravatar v1.4.0
// Project: https://github.com/emerleite/node-gravatar
// Definitions by: Denis Sokolov <https://github.com/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;
}