mirror of
https://github.com/fluencelabs/libp2p-ts
synced 2025-03-31 09:21:04 +00:00
Merge pull request #20 from polkadot-js/jg-jdenticon
Add jdenticon 2.1.1
This commit is contained in:
commit
66963832be
@ -7,7 +7,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"babel-core": "^7.0.0-bridge.0",
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
"typescript": "^3.2.2"
|
"typescript": "^3.3.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./build.sh",
|
"build": "./build.sh",
|
||||||
@ -16,6 +16,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.2.2",
|
"@babel/core": "^7.2.2",
|
||||||
"@polkadot/dev": "^0.23.14"
|
"@polkadot/dev": "^0.24.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,5 @@
|
|||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"forceConsistentCasingInFileNames": 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
28
types/jdenticon/index.d.ts
vendored
Normal 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;
|
||||||
|
}
|
3
types/jdenticon/jdenticon-tests.ts
Normal file
3
types/jdenticon/jdenticon-tests.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import jdenticon from 'jdenticon';
|
||||||
|
|
||||||
|
jdenticon.toSvg('12345', 64);
|
16
types/jdenticon/tsconfig.json
Normal file
16
types/jdenticon/tsconfig.json
Normal 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"]
|
||||||
|
}
|
1
types/jdenticon/tslint.json
Normal file
1
types/jdenticon/tslint.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "extends": "dtslint/dt.json" }
|
Loading…
x
Reference in New Issue
Block a user