mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add type definitions for js-roman-numerals (#40033)
This commit is contained in:
parent
469a9dad40
commit
ea18e353c1
13
types/js-roman-numerals/index.d.ts
vendored
Normal file
13
types/js-roman-numerals/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for js-roman-numerals 1.1
|
||||
// Project: https://github.com/bcotrim/roman-numerals
|
||||
// Definitions by: Ricardo Mello <https://github.com/ricardo-mello>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.5
|
||||
|
||||
declare class RomanNumeral {
|
||||
constructor(value: number | string);
|
||||
toInt(): number;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export = RomanNumeral;
|
||||
12
types/js-roman-numerals/js-roman-numerals-tests.ts
Normal file
12
types/js-roman-numerals/js-roman-numerals-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import RomanNumeral = require('js-roman-numerals');
|
||||
|
||||
function constructorTests() {
|
||||
const x = new RomanNumeral(10); // '10' | 'X'
|
||||
const y = new RomanNumeral('V'); // '5' | 'V'
|
||||
}
|
||||
|
||||
function functionTests() {
|
||||
const x = new RomanNumeral(10);
|
||||
const y: number = x.toInt();
|
||||
const z: string = x.toString();
|
||||
}
|
||||
16
types/js-roman-numerals/tsconfig.json
Normal file
16
types/js-roman-numerals/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "js-roman-numerals-tests.ts"]
|
||||
}
|
||||
3
types/js-roman-numerals/tslint.json
Normal file
3
types/js-roman-numerals/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user