mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 19:43:20 +08:00
Create types for gravatar-url
This commit is contained in:
12
types/gravatar-url/gravatar-url-tests.ts
Normal file
12
types/gravatar-url/gravatar-url-tests.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import gravatarUrl = require('gravatar-url');
|
||||
|
||||
gravatarUrl('sindresorhus@gmail.com'); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { default: 'monsterid' }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { default: 'monsterid', size: 200 }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { default: 'monsterid', rating: 'g', size: 200 }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { rating: 'g' }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { rating: 'pg' }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { rating: 'r' }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { rating: 'x' }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { rating: 'g', size: 200 }); // $ExpectType string
|
||||
gravatarUrl('sindresorhus@gmail.com', { size: 200 }); // $ExpectType string
|
||||
16
types/gravatar-url/index.d.ts
vendored
Normal file
16
types/gravatar-url/index.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// Type definitions for gravatar-url 2.0
|
||||
// Project: https://github.com/sindresorhus/gravatar-url
|
||||
// Definitions by: Ivan Gabriele <https://github.com/ivangabriele>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = GravatarUrl;
|
||||
|
||||
declare function GravatarUrl(email: string, options?: GravatarUrl.Options): string;
|
||||
|
||||
declare namespace GravatarUrl {
|
||||
interface Options {
|
||||
default?: string;
|
||||
rating?: 'g' | 'pg' | 'r' | 'x';
|
||||
size?: number;
|
||||
}
|
||||
}
|
||||
22
types/gravatar-url/tsconfig.json
Normal file
22
types/gravatar-url/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gravatar-url-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/gravatar-url/tslint.json
Normal file
1
types/gravatar-url/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user