diff --git a/lib/VSS.SDK.js b/lib/VSS.SDK.js index ff51a20..25f6a71 100644 --- a/lib/VSS.SDK.js +++ b/lib/VSS.SDK.js @@ -841,6 +841,9 @@ var VSS; initOptions = options || {}; usingPlatformScripts = initOptions.usePlatformScripts; usingPlatformStyles = initOptions.usePlatformStyles; + if(initOptions.parentChannel){ + parentChannel = initOptions.parentChannel + } // Run this after current execution path is complete - allows objects to get initialized window.setTimeout(function () { var appHandshakeData = { diff --git a/package-lock.json b/package-lock.json index 2e03afd..bc822bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,98 @@ { "name": "vss-web-extension-sdk", "version": "5.140.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "vss-web-extension-sdk", + "version": "5.140.0", + "license": "MIT", + "dependencies": { + "@types/jquery": ">=2.0.48", + "@types/jqueryui": ">=1.11.34", + "@types/knockout": "^3.4.49", + "@types/mousetrap": "~1.5.34", + "@types/q": "0.0.32", + "@types/react": "^16.8.2", + "@types/requirejs": ">=2.1.28" + }, + "devDependencies": { + "typescript": "^3.9.6" + } + }, + "node_modules/@types/jquery": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.0.tgz", + "integrity": "sha512-szaKV2OQgwxYTGTY6qd9eeBfGGCaP7n2OGit4JdbOcfGgc9VWjfhMhnu5AVNhIAu8WWDIB36q9dfPVba1fGeIQ==" + }, + "node_modules/@types/jqueryui": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@types/jqueryui/-/jqueryui-1.12.1.tgz", + "integrity": "sha512-aLMCZSEsZJqnE6K1wcTsMojH/MZRaYkoiWbr/NauE96LP3+BzR8ki29wWYkVOunolb95a7hotCtTgzeoTPqb6A==", + "dependencies": { + "@types/jquery": "*" + } + }, + "node_modules/@types/knockout": { + "version": "3.4.49", + "resolved": "https://registry.npmjs.org/@types/knockout/-/knockout-3.4.49.tgz", + "integrity": "sha512-Hag6/xIJADyGvo1XwXGeTibyiss33QqT0AmfuyfakGj4kplIM3e59/nfjf3iB/iNRbH0I3cx61N2VT6TK6iA2A==" + }, + "node_modules/@types/mousetrap": { + "version": "1.5.34", + "resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.5.34.tgz", + "integrity": "sha1-IrM42cS839j4HDBoSu/rBKRycWg=" + }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, + "node_modules/@types/q": { + "version": "0.0.32", + "resolved": "http://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", + "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=" + }, + "node_modules/@types/react": { + "version": "16.14.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.26.tgz", + "integrity": "sha512-c/5CYyciOO4XdFcNhZW1O2woVx86k4T+DO2RorHZL7EhitkNQgSD/SgpdZJAUJa/qjVgOmTM44gHkAdZSXeQuQ==", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/requirejs": { + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz", + "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==" + }, + "node_modules/@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, + "node_modules/csstype": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", + "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" + }, + "node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, "dependencies": { "@types/jquery": { "version": "3.3.0", @@ -27,25 +117,45 @@ "resolved": "https://registry.npmjs.org/@types/mousetrap/-/mousetrap-1.5.34.tgz", "integrity": "sha1-IrM42cS839j4HDBoSu/rBKRycWg=" }, + "@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + }, "@types/q": { "version": "0.0.32", "resolved": "http://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=" }, "@types/react": { - "version": "15.6.12", - "resolved": "https://registry.npmjs.org/@types/react/-/react-15.6.12.tgz", - "integrity": "sha512-HnYIML+3EOWUACx+83iLJZcb32/XgxovPh/9oJIzoGSjcobHRRhb04GahG871Bkgz4RqIV+Ztmvk1LZRckSJVg==" + "version": "16.14.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.26.tgz", + "integrity": "sha512-c/5CYyciOO4XdFcNhZW1O2woVx86k4T+DO2RorHZL7EhitkNQgSD/SgpdZJAUJa/qjVgOmTM44gHkAdZSXeQuQ==", + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } }, "@types/requirejs": { "version": "2.1.31", "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz", "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==" }, + "@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + }, + "csstype": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", + "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" + }, "typescript": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.5.3.tgz", - "integrity": "sha1-3z3Nw48764ANS8MiZGsEo/bKfw0=", + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true } } diff --git a/package.json b/package.json index 2734ae4..2d7579e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vss-web-extension-sdk", - "version": "5.140.0", + "version": "5.140.1", "description": "Visual Studio Team Services web extension JavaScript library and types.", "repository": { "type": "git", @@ -31,10 +31,10 @@ "@types/knockout": "^3.4.49", "@types/mousetrap": "~1.5.34", "@types/q": "0.0.32", - "@types/react": "^15.6.12", + "@types/react": "^16.8.2", "@types/requirejs": ">=2.1.28" }, "devDependencies": { - "typescript": "~2.5.3" + "typescript": "^3.9.6" } } diff --git a/tsconfig.json b/tsconfig.json index ae28414..416d745 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,10 @@ "dom" ], "skipLibCheck": true, - "types": [] + "types": [], + "strict": true, + "noImplicitAny": true, + "noImplicitThis": true }, "include": [ "typings/**/*.ts" diff --git a/typings/VSS.SDK.d.ts b/typings/VSS.SDK.d.ts index f954751..4337208 100644 --- a/typings/VSS.SDK.d.ts +++ b/typings/VSS.SDK.d.ts @@ -50,7 +50,7 @@ declare module XDM { * @param instanceId unique id of the registered object * @param contextData Optional context data to pass to a registered object's factory method */ - getInstance(instanceId: string, contextData?: Object): T; + getInstance(instanceId: string, contextData?: Object): T | undefined ; } /** * The registry of global XDM handlers diff --git a/typings/vss.d.ts b/typings/vss.d.ts index 7c1faf8..383a61e 100644 --- a/typings/vss.d.ts +++ b/typings/vss.d.ts @@ -171,7 +171,7 @@ interface IXDMChannelManager { * * @param channel The channel to remove from the channel manager */ - removeChannel(channel: IXDMChannel); + removeChannel(channel: IXDMChannel) : void; } /** @@ -200,7 +200,7 @@ interface IXDMObjectRegistry { * @param instanceId unique id of the registered object * @param contextData Optional context data to pass to the contructor of an object factory method */ - getInstance(instanceId: string, contextData?: Object): T; + getInstance(instanceId: string, contextData?: Object): T | undefined ; } /** @@ -246,6 +246,11 @@ interface IExtensionInitializationOptions { * If true, send back the theme data as part of the initial handshake */ applyTheme?: boolean; + + /** + * If set will use the channel specified for all commmunication + */ + parentChannel?: IXDMChannel; } /** @@ -470,19 +475,19 @@ interface IExternalDialog { /** * Close the dialog */ - close(); + close(): void; /** * Update the title of the dialog * * @param title New dialog title */ - setTitle(title: string); + setTitle(title: string): void; /** * Update the enablement of the OK button */ - updateOkButton(enabled: boolean); + updateOkButton(enabled: boolean): void; } /** @@ -804,7 +809,7 @@ interface IContributedMenuSource { * * @param actionContext Menu-specific context information */ - execute?(actionContext: any); + execute?(actionContext: any): void; } /**