{"_id":"@appulate/minimal-knockout-types-for-devexpress-web-without-global-ko","_rev":"4-8cc71fd207a161806d350486b7eebce3","name":"@appulate/minimal-knockout-types-for-devexpress-web-without-global-ko","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@appulate/minimal-knockout-types-for-devexpress-web-without-global-ko","version":"0.0.1","description":"Minimal Knockout.js TypeScript definitions for @types/devexpress-web without global ko variable","repository":{"type":"git","url":"https://github.com/appulate/minimal-knockout-types-for-devexpress-web-without-global-ko.git"},"types":"index.d.ts","license":"MIT","devDependencies":{"knockout":"^3.5.1"},"peerDependencies":{"knockout":"^3.5.1"},"_id":"@appulate/minimal-knockout-types-for-devexpress-web-without-global-ko@0.0.1","dist":{"shasum":"61130c5508f70301c3736df612240b596838ce1d","integrity":"sha512-cGWf++LfPUNjfZ4E8PJk1Yd1sQVAhtIQPqnIfV6SA7Fw4o9nfw3KB8/leXgS0wd1SwAS2H7eiSuH78B2zGLiNA==","tarball":"https://registry.npmjs.org/@appulate/minimal-knockout-types-for-devexpress-web-without-global-ko/-/minimal-knockout-types-for-devexpress-web-without-global-ko-0.0.1.tgz","fileCount":4,"unpackedSize":2357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh11wTCRA9TVsSAnZWagAAs/wP/RiKRB2EiEjiTeR7mKDB\nMBEGrBdrGYQMqp4dxf8Ev1IpkDBmyec0bGLqRqgexLa01dKrIZbTzM3Cpe2n\n7e7TKKIUg/UlAhtv3cIjLV2mC3oBBJDyJF8bcq4YH72dG9qRKg4VAoh+PSqU\njFt310vaqT4WP9N9kuvT9y0aqGrnxO4g1cAEnhT4VIAsqa7AL0CNnnWxJgjw\nWEoMWxxiXsKlM4QM5ZpQCx8hrhMEPgcRI9z+bfWqw+PhiSRy2vQXeaWTIPSz\n19be/ubocKchlzYPLV2lDl/q1CumQHheq1mJWzvkxgXVUzcVttfOt8Xs8Q2x\nWKUx9oWoRHqdAqzEfS/mKWef35AH8dN15FjWPiEA9dutu9mUiZXhfq/WBISk\nq79MtrsIPlYzdqq1RUKPh5F3MhlQ7fdlskSB4tmikjx6ujEOsEnzqdg1Trax\nFXAGn7EgoSTkYlMnfPFi0tVdUvuSAJ8dQaWEEG8taMPBlZnvpQhsnfsFpx06\nkBy2IOYyTv1VyxBBZri7ihLqEG/PgXHjllMllUSRsxS0lSDcOa4EbC3yp2rB\nDJfbIyLATYWBh1tH9z+IRPyf/uwyv/XzcWP0/DhNesq9ODvrxwb48/ovBFit\nFU3KqqJv/zQTCybZf5ipMUrXVFb7him6ytjyhDnFYauJvfrC1x/FG5r0TyQO\nxKsI\r\n=CWpT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFnoscMD5QZMytZo4zgd97Ggx7A+0tBJYOQXe6LBe5FuAiEAseZfjMWLfAKZa/KHLK+XVeU/hoTlIjhA+Z+rkphr4+g="}]},"maintainers":[{"name":"vkrol","email":"veniamin.krol@gmail.com"}],"_npmUser":{"name":"vkrol","email":"veniamin.krol@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minimal-knockout-types-for-devexpress-web-without-global-ko_0.0.1_1595960466563_0.6661671601035948"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-28T18:21:06.258Z","0.0.1":"2020-07-28T18:21:06.705Z","modified":"2022-04-04T15:06:54.381Z"},"maintainers":[{"email":"apushkin@appulate.com","name":"apushkin"},{"email":"nkirsanov@appulate.com","name":"nkirsanov"}],"description":"Minimal Knockout.js TypeScript definitions for @types/devexpress-web without global ko variable","repository":{"type":"git","url":"https://github.com/appulate/minimal-knockout-types-for-devexpress-web-without-global-ko.git"},"license":"MIT","readme":"# Minimal Knockout.js TypeScript definitions for @types/devexpress-web without global ko variable\n\n## Problem\n\n`@types/devexpress-web` refers to `@types/knockout` via `<reference types='knockout' />`, so types and variable declarations from this package fall into global scope. This leads to several problems:\n1. `@types/knockout` declares the `ko` global variable, so TypeScript does not throw any errors when such a global variable is used in the module without its import.\n2. If the `ko` global variable from `@types/knockout` package is not used anywhere, the following error occurs for some reason:\n```\nnode_modules/@types/knockout/index.d.ts:1062:13 - error TS2403: Subsequent variable declarations must have the same\ntype. Variable 'ko' must be of type 'typeof import(\".../node_modules/knockout/build/types/knockout\")', but here has\ntype 'KnockoutStatic'.\n\n\t1062 declare var ko: KnockoutStatic;\n\t                 ~~\n\n\t  node_modules/knockout/build/types/knockout.d.ts:5:1\n\t    5 export as namespace ko;\n\t      ~~~~~~\n\t    'ko' was also declared here.\n```\n \n## Solution:\n \nTo solve these problems, we use the Yarn resolutions functionality to replace the `@types/knockout` package with one that does not contain the global `ko` variable. We have to declare some global types because they are used in `@types/devexpress-web`. If the `@types/devexpress-web` package starts using some other Knockout types in the future, we will need to add them to this file.\n```json\n{\n  \"resolutions\": {\n    \"@types/knockout\": \"@appulate/minimal-knockout-types-for-devexpress-web-without-global-ko\",\n  }\n}\n","readmeFilename":"README.md"}