Add type definitions for js-roman-numerals (#40033)

This commit is contained in:
Ricardo Mello 2019-11-05 18:13:53 -03:00 committed by Nathan Shively-Sanders
parent 469a9dad40
commit ea18e353c1
4 changed files with 44 additions and 0 deletions

13
types/js-roman-numerals/index.d.ts vendored Normal file
View 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;

View 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();
}

View 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"]
}

View File

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