diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..1820007 --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,8 @@ +declare module "json-diff" { + interface Options { + color: boolean; + full: boolean; + } + export function diff(obj1: JSON, obj2: JSON, options: Options): JSON; + export function diffString(obj1: JSON, obj2: JSON, options: Options): string; +} \ No newline at end of file diff --git a/package.json b/package.json index b58a0ce..ec20d8d 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,38 @@ { - "author": "Andrey Tarantsov ", - "contributors": [ - "Gavriel Fleischer ", - "Eric Woudenberg " - ], - "name": "json-diff", - "description": "JSON diff", - "version": "1.0.3", - "homepage": "https://github.com/andreyvit/json-diff", - "license": "MIT", - "repository": { - "url": "git@github.com:andreyvit/json-diff.git" - }, - "main": "lib/index.js", - "bin": "bin/json-diff.js", - "scripts": { - "fix": "eslint --fix lib", - "test": "coffee -c test; mocha test/*.js", - "cov": "rm -rf lib-cov; jscoverage lib lib-cov; env JSLIB=lib-cov mocha -R dot && env JSLIB=lib-cov mocha -R html-cov >coverage.html; open coverage.html" - }, - "dependencies": { - "@ewoudenberg/difflib": "0.1.0", - "colors": "^1.4.0", - "dreamopt": "~0.8.0" - }, - "devDependencies": { - "coffeescript": "^2.6.1", - "eslint": "^8", - "eslint-config-standard": "^17", - "jscoverage": "^0.6.0", - "mocha": "9.1.3" - }, - "engines": { - "node": "*" - } + "author": "Andrey Tarantsov ", + "contributors": [ + "Gavriel Fleischer ", + "Eric Woudenberg " + ], + "name": "json-diff", + "description": "JSON diff", + "version": "1.0.3", + "homepage": "https://github.com/andreyvit/json-diff", + "license": "MIT", + "repository": { + "url": "git@github.com:andreyvit/json-diff.git" + }, + "main": "lib/index.js", + "types": "lib/index.d.ts", + "bin": "bin/json-diff.js", + "scripts": { + "fix": "eslint --fix lib", + "test": "coffee -c test; mocha test/*.js", + "cov": "rm -rf lib-cov; jscoverage lib lib-cov; env JSLIB=lib-cov mocha -R dot && env JSLIB=lib-cov mocha -R html-cov >coverage.html; open coverage.html" + }, + "dependencies": { + "@ewoudenberg/difflib": "0.1.0", + "colors": "^1.4.0", + "dreamopt": "~0.8.0" + }, + "devDependencies": { + "coffeescript": "^2.6.1", + "eslint": "^8", + "eslint-config-standard": "^17", + "jscoverage": "^0.6.0", + "mocha": "9.1.3" + }, + "engines": { + "node": "*" + } }