Add types for blockies (#26112)

This commit is contained in:
Leonid Logvinov
2018-05-29 15:43:23 -07:00
committed by Mohamed Hegazy
parent b3a60ecd4d
commit 03f4ecbb33
4 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import blockies = require('blockies');
const seed = 'seed';
blockies({ seed });

14
types/blockies/index.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
// Type definitions for blockies 0.0
// Project: https://github.com/goldylucks/blockies-npm
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface BlockiesIcon {
toDataURL(): string;
}
interface BlockiesConfig {
seed: string;
}
declare function blockies(config: BlockiesConfig): BlockiesIcon;
export = blockies;

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "blockies-tests.ts"]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }