With @ types / select2 installed, it allows the typescript compiler to do static type checking to make sure that the Select2 library is called correctly. It does not change the way you use it select2- you still need to install the library select2and use it just as if you weren't checking the type.
For external dependencies (e.g. jQuery or Select2), you must install the appropriate type definition files so that the typescript compiler can resolve external types at compile time. This is preferable to declaring types any(i.e. declare var $: any)
Make sure you also set jQuery types:
npm install @types/jquery
node_modules/@types/jQuery. typescript node_modules/@types.
typescript NodeJS index.d.ts typings package.json. node_modules/@types.