Is there any sample of using TypeScript with KnockoutJS? I\'m just curious as to how they would work together?
Here is what I have, seems to work
Ok so just use the following command to import the knockout types or tds.
npm install @types/knockout
This will create a @types directory in your projects node_modules directory and the index knockout type definition file will be in a directory named knockout. Next, through a triple-slash reference to the types file. This will give great IDE and TypeScript features.
/// Finally, just use a declare statement to bring the ko variable into scope. This is strongly-typed so hello intellisense.
declare var ko: KnockoutStatic;
So now you can use KO just like in your javascript files.
Hope this helps.