Merge pull request #20 from polkadot-js/jg-jdenticon

Add jdenticon 2.1.1
This commit is contained in:
Jaco Greeff 2019-02-21 12:36:37 +01:00 committed by GitHub
commit 66963832be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1330 additions and 1168 deletions

View File

@ -7,7 +7,7 @@
"license": "ISC",
"resolutions": {
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.2.2"
"typescript": "^3.3.3"
},
"scripts": {
"build": "./build.sh",
@ -16,6 +16,6 @@
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@polkadot/dev": "^0.23.14"
"@polkadot/dev": "^0.24.2"
}
}

View File

@ -12,5 +12,5 @@
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "bn.js-tests.ts"]
"files": ["index.d.ts", "blakejs-tests.ts"]
}

28
types/jdenticon/index.d.ts vendored Normal file
View File

@ -0,0 +1,28 @@
// Type definitions for Jdenticon 2.1.1
// Project: http://jdenticon.com/
// Definitions by: Martin Thorsen Ranang <https://github.com/mtr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface JdenticonConfig {
lightness?: {
color?: number[];
grayscale?: number[];
};
saturation?: number;
}
interface Jdenticon {
drawIcon(ctx: CanvasRenderingContext2D, hash: string, size: number): void;
toPng(hash: string, size: number, padding?: number): string;
toSvg(hash: string, size: number, padding?: number): string;
update(el: Element | string, hash?: string, padding?: number): void;
config: JdenticonConfig;
version: string;
}
declare module 'jdenticon' {
const jdenticon: Jdenticon;
export default jdenticon;
}

View File

@ -0,0 +1,3 @@
import jdenticon from 'jdenticon';
jdenticon.toSvg('12345', 64);

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", "jdenticon-tests.ts"]
}

View File

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

2444
yarn.lock

File diff suppressed because it is too large Load Diff