I am closely adhering to the guidance provided in the official manual for declaration.
Global library
// example.js
example = 20;
Declaration file
// example.d.ts
declare const let example: number;
Implementing the declaration file and library
// index.ts
/// <reference path="./example.d.ts" />
console.log(example);
An error message is displayed:
Cannot find name 'example'. (2304)
I have posted a related question, but the issue has not been resolved. I understand the concept and have thoroughly studied the official guidelines. However, while the official guide explains how to write a declaration file, it lacks examples on importing the declared file properly.
Could you assist me in modifying the code to make the above scenario functional?