Add typings for object-diff. (#11984)

* Add typings for object-diff.

* review comment

* review comment - tsconfig.json

* fix tsc errors
This commit is contained in:
Rogier Schouten 2016-11-07 15:24:21 +01:00 committed by Andy
parent e9270215e9
commit b006daa1c6
3 changed files with 44 additions and 0 deletions

7
object-diff/index.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
// Type definitions for object-diff v0.0
// Project: https://github.com/srcagency/object-diff
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare function diff(a: any, b: any): any;
export = diff;

View File

@ -0,0 +1,18 @@
import diff = require('object-diff');
// from the package README.md, typescriptified:
var a = {
speed: 4,
power: 54,
level: 1,
};
var b = {
speed: 4, // unchanged
power: 22, // changed
weight: 10, // added
};
var d: any = diff(a, b);

19
object-diff/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"object-diff-tests.ts"
]
}