Apologies for this question, as I am struggling to find the necessary information due to my limited understanding of Typescript. I have integrated a jquery plugin called typeahead
and added a global variable named bound
on the window object for communication with my C# wrapper app.
Unfortunately, these additions are causing errors during compilation, and I need guidance on how to address them. I considered creating definitions for these items, but I cannot locate relevant documentation. Although I installed a definition for jquery
using typings
, it seems that the window
object already has its own definition.
The specific errors I encounter are:
Property 'typeahead' does not exist on type 'JQuery'.
Property 'bound' does not exist on type 'Window'.
How can I resolve these errors? If defining new types is necessary, where should these definitions be placed, especially for objects that already have existing definitions?
I attempted to create an index.d.ts
file in the project root, but encountered the following error even without any content in the file:
WARNING in ./src/index.d.ts
Module build failed: Error: Debug Failure. False expression: Output generation failed
Despite trying different approaches like interface statements, module declaration statements, and namespace declaration statements, the error persists. Is there a specific filename or location requirement for these definitions?
I reviewed the documentation at https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html but could not find instructions on where to place definitions or how to handle objects with pre-existing definitions.
Your assistance is greatly appreciated. Thank you in advance for any advice provided.
EDIT
Neither Definitely Typed nor Typings offer definitions for the typeahead library I am using or the global bound
object I created. I am seeking clarification on manually resolving these errors.