I'm currently in the process of converting my project to Typescript. I've installed the latest @types and am in the midst of creating a custom.d.ts file. Here is what the file looks like so far:
/// <reference path="../../../node_modules/@types/jquery/index.d.ts"/>
interface jQuery{
iCheck(): JQuery;
bootstrapSwitch(): JQuery;
}
interface jQueryStatic{
notific8(): JQuery;
}
declare var notific8: JQueryStatic;
declare var isCheck: JQuery;
declare var bootstrapSwitch: JQuery;
When trying to implement these definitions in my file, I reference it using:
/// <reference path="../utility/custom.d.ts" />
Although Visual Studio recognizes that the paths are correct, when I hover over the code that implements it, I receive the following errors:
[ts] Property 'notific8' does not exist on type 'JQueryStatic<HTMLElement>'
and
[ts] Property 'iCheck' does not exist on type 'JQuery<HTMLElement>'.
[ts] Property 'bootstrapSwitch' does not exist on type 'JQuery<HTMLElement>'.
I've attempted moving the declare lines into the app file, yet the same error persists. Can someone shed some light on why Typescript isn't recognizing it? My setup includes typescript 2.5.2 and "@types/jquery": "^3.2.12". Thank you.