diff --git a/types/nslog/index.d.ts b/types/nslog/index.d.ts new file mode 100644 index 0000000000..e351c8117d --- /dev/null +++ b/types/nslog/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for nslog 3.0 +// Project: https://github.com/atom/node-nslog +// Definitions by: Daniel Perez Alvarez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Outputs a message to the native console. + */ +type NSLog = (...args: any[]) => void; + +declare var nslog: NSLog; +export = nslog; diff --git a/types/nslog/nslog-tests.ts b/types/nslog/nslog-tests.ts new file mode 100644 index 0000000000..3a80c5a13b --- /dev/null +++ b/types/nslog/nslog-tests.ts @@ -0,0 +1,4 @@ +import NSLog = require('nslog'); + +NSLog('Hello world!'); +NSLog('My number is %i and my text is %s.', 42, 'foobar'); diff --git a/types/nslog/tsconfig.json b/types/nslog/tsconfig.json new file mode 100644 index 0000000000..885e4f0dc0 --- /dev/null +++ b/types/nslog/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nslog-tests.ts" + ] +} diff --git a/types/nslog/tslint.json b/types/nslog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/nslog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }