From 2265316a1015ec5d89aec54f73f2b26e99f16527 Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Thu, 2 Feb 2017 17:03:43 -0600 Subject: [PATCH 1/5] Added cordova-plugin-device-name Added cordova-plugin-device-name type definitions --- cordova-plugin-device-name/README.md | 8 ++++++ .../cordova-plugin-device-name-tests.ts | 4 +++ cordova-plugin-device-name/index.d.ts | 26 +++++++++++++++++++ cordova-plugin-device-name/tsconfig.json | 23 ++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 cordova-plugin-device-name/README.md create mode 100644 cordova-plugin-device-name/cordova-plugin-device-name-tests.ts create mode 100644 cordova-plugin-device-name/index.d.ts create mode 100644 cordova-plugin-device-name/tsconfig.json diff --git a/cordova-plugin-device-name/README.md b/cordova-plugin-device-name/README.md new file mode 100644 index 0000000000..6826b06c32 --- /dev/null +++ b/cordova-plugin-device-name/README.md @@ -0,0 +1,8 @@ +# Installation +> `npm install --save @types/cordova-plugin-device-name` + +# Summary +This package contains type definitions for cordova-plugin-device-name (https://www.npmjs.com/package/cordova-plugin-device-name) + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cordova-plugin-device-name diff --git a/cordova-plugin-device-name/cordova-plugin-device-name-tests.ts b/cordova-plugin-device-name/cordova-plugin-device-name-tests.ts new file mode 100644 index 0000000000..c101f14d97 --- /dev/null +++ b/cordova-plugin-device-name/cordova-plugin-device-name-tests.ts @@ -0,0 +1,4 @@ +/// + +var deviceName = cordova.plugins.deviceName; +console.log(deviceName.name) // e.g: Becvert's iPad diff --git a/cordova-plugin-device-name/index.d.ts b/cordova-plugin-device-name/index.d.ts new file mode 100644 index 0000000000..479f443cfd --- /dev/null +++ b/cordova-plugin-device-name/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for cordova-plugin-device-name v1.1.0 +// Project: https://www.npmjs.com/package/cordova-plugin-device-name +// Definitions by: Larry Bahr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// Licensed under the MIT license. + +interface CordovaPlugins { + /** + * cordova-plugin-device-name interface + */ + deviceName: CordovaPluginDeviceName.CordovaPluginDeviceName; +} + +/** + * Keep the type global namespace clean by using a module + */ +declare module CordovaPluginDeviceName { + interface CordovaPluginDeviceName { + /** + * User-friendly name of the device. + * @example cordova.plugins.deviceName.name // e.g: Larry's Android + */ + name: string; + } +} \ No newline at end of file diff --git a/cordova-plugin-device-name/tsconfig.json b/cordova-plugin-device-name/tsconfig.json new file mode 100644 index 0000000000..5012f628be --- /dev/null +++ b/cordova-plugin-device-name/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova-plugin-device-name-tests.ts" + ] +} \ No newline at end of file From cae031eac4fb2ec35eef4fa8d3bdf8f5e9d6cf34 Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Fri, 3 Feb 2017 13:13:36 -0600 Subject: [PATCH 2/5] Added cordova_app_version_plugin Added type definitions for https://www.npmjs.com/package/cordova_app_version_plugin --- cordova_app_version_plugin/README.md | 8 ++++++ .../cordova_app_version_plugin-tests.ts | 3 +++ cordova_app_version_plugin/index.d.ts | 26 +++++++++++++++++++ cordova_app_version_plugin/tsconfig.json | 23 ++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 cordova_app_version_plugin/README.md create mode 100644 cordova_app_version_plugin/cordova_app_version_plugin-tests.ts create mode 100644 cordova_app_version_plugin/index.d.ts create mode 100644 cordova_app_version_plugin/tsconfig.json diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md new file mode 100644 index 0000000000..17e7e72ad3 --- /dev/null +++ b/cordova_app_version_plugin/README.md @@ -0,0 +1,8 @@ +# Installation +> `npm install --save @types/cordova_app_version_plugin` + +# Summary +This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin) + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cordova_app_version_plugin diff --git a/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts new file mode 100644 index 0000000000..5e4eb16e66 --- /dev/null +++ b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts @@ -0,0 +1,3 @@ +/// + +var appVersion = window.cordova.plugins.version.getAppVersion(); // e.g. "1.5.0" diff --git a/cordova_app_version_plugin/index.d.ts b/cordova_app_version_plugin/index.d.ts new file mode 100644 index 0000000000..b8a70216a6 --- /dev/null +++ b/cordova_app_version_plugin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for cordova_app_version_plugin v0.2.6 +// Project: https://www.npmjs.com/package/cordova_app_version_plugin +// Definitions by: Larry Bahr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// Licensed under the MIT license. + +interface CordovaPlugins { + /** + * cordova_app_version_plugin interface + */ + version: CordovaAppVersionPlugin.CordovaAppVersionPlugin; +} + +/** + * Keep the type global namespace clean by using a module + */ +declare module CordovaAppVersionPlugin { + interface CordovaAppVersionPlugin { + /** + * App version from config.xml's version (e.g. ) + * @example window.cordova.plugins.version.getAppVersion() // e.g: "1.5.0" + */ + getAppVersion(): string; + } +} \ No newline at end of file diff --git a/cordova_app_version_plugin/tsconfig.json b/cordova_app_version_plugin/tsconfig.json new file mode 100644 index 0000000000..13e07865d9 --- /dev/null +++ b/cordova_app_version_plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova_app_version_plugin-tests.ts" + ] +} \ No newline at end of file From 896c3963361bee686e91a34c82a0f4e1d4fa63b5 Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Fri, 3 Feb 2017 13:18:01 -0600 Subject: [PATCH 3/5] Revert "Added cordova_app_version_plugin" This reverts commit cae031eac4fb2ec35eef4fa8d3bdf8f5e9d6cf34. --- cordova_app_version_plugin/README.md | 8 ------ .../cordova_app_version_plugin-tests.ts | 3 --- cordova_app_version_plugin/index.d.ts | 26 ------------------- cordova_app_version_plugin/tsconfig.json | 23 ---------------- 4 files changed, 60 deletions(-) delete mode 100644 cordova_app_version_plugin/README.md delete mode 100644 cordova_app_version_plugin/cordova_app_version_plugin-tests.ts delete mode 100644 cordova_app_version_plugin/index.d.ts delete mode 100644 cordova_app_version_plugin/tsconfig.json diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md deleted file mode 100644 index 17e7e72ad3..0000000000 --- a/cordova_app_version_plugin/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Installation -> `npm install --save @types/cordova_app_version_plugin` - -# Summary -This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin) - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cordova_app_version_plugin diff --git a/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts deleted file mode 100644 index 5e4eb16e66..0000000000 --- a/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -var appVersion = window.cordova.plugins.version.getAppVersion(); // e.g. "1.5.0" diff --git a/cordova_app_version_plugin/index.d.ts b/cordova_app_version_plugin/index.d.ts deleted file mode 100644 index b8a70216a6..0000000000 --- a/cordova_app_version_plugin/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for cordova_app_version_plugin v0.2.6 -// Project: https://www.npmjs.com/package/cordova_app_version_plugin -// Definitions by: Larry Bahr -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// -// Licensed under the MIT license. - -interface CordovaPlugins { - /** - * cordova_app_version_plugin interface - */ - version: CordovaAppVersionPlugin.CordovaAppVersionPlugin; -} - -/** - * Keep the type global namespace clean by using a module - */ -declare module CordovaAppVersionPlugin { - interface CordovaAppVersionPlugin { - /** - * App version from config.xml's version (e.g. ) - * @example window.cordova.plugins.version.getAppVersion() // e.g: "1.5.0" - */ - getAppVersion(): string; - } -} \ No newline at end of file diff --git a/cordova_app_version_plugin/tsconfig.json b/cordova_app_version_plugin/tsconfig.json deleted file mode 100644 index 13e07865d9..0000000000 --- a/cordova_app_version_plugin/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cordova_app_version_plugin-tests.ts" - ] -} \ No newline at end of file From 8931b431d23463807e639b7eb6107d35920a4fbf Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Wed, 8 Feb 2017 11:25:25 -0600 Subject: [PATCH 4/5] Update tsconfig.json Updated tsconfig.json to have strictNullChecks set to true as is stated in the readme. --- cordova-plugin-app-version/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cordova-plugin-app-version/tsconfig.json b/cordova-plugin-app-version/tsconfig.json index 935b5b77de..6ee5886fae 100644 --- a/cordova-plugin-app-version/tsconfig.json +++ b/cordova-plugin-app-version/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 2c7b05422c054c875c9bfac0eedfc91e386ee2fe Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Wed, 8 Feb 2017 11:47:21 -0600 Subject: [PATCH 5/5] Change spaces to tabs Updated the file to use tabs instead of 4 spaces --- cordova-plugin-app-version/tsconfig.json | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/cordova-plugin-app-version/tsconfig.json b/cordova-plugin-app-version/tsconfig.json index 6ee5886fae..1c9f396113 100644 --- a/cordova-plugin-app-version/tsconfig.json +++ b/cordova-plugin-app-version/tsconfig.json @@ -1,23 +1,23 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cordova-plugin-app-version-tests.ts" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova-plugin-app-version-tests.ts" + ] } \ No newline at end of file