mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(hex2dec): adds types for hex2dec (#46018)
This commit is contained in:
parent
e8378bbd71
commit
b5503ad6dc
5
types/hex2dec/hex2dec-tests.ts
Normal file
5
types/hex2dec/hex2dec-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import hex2dec = require('hex2dec');
|
||||
|
||||
hex2dec.hexToDec('0xFA'); // $ExpectType string
|
||||
hex2dec.decToHex('250'); // $ExpectType string
|
||||
hex2dec.decToHex('250', { prefix: false }); // $ExpectType string
|
||||
13
types/hex2dec/index.d.ts
vendored
Normal file
13
types/hex2dec/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for hex2dec 1.1
|
||||
// Project: https://github.com/donmccurdy/hex2dec#readme
|
||||
// Definitions by: Adriaan Knapen <https://github.com/Addono>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Takes a hexadecimal string and returns it as a decimal string.
|
||||
*/
|
||||
export function hexToDec(hexStr: string): string;
|
||||
/**
|
||||
* Takes a decimal string and returns it as a hexadecimal string.
|
||||
*/
|
||||
export function decToHex(decStr: string, opts?: { prefix?: boolean }): string;
|
||||
23
types/hex2dec/tsconfig.json
Normal file
23
types/hex2dec/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hex2dec-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/hex2dec/tslint.json
Normal file
1
types/hex2dec/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user