Complete the code to import a JavaScript module with TypeScript support.
import [1] from './mathLib';
We import the function named add from the JavaScript module to use it in TypeScript.
Complete the declaration file to describe the function's type.
export declare function add(a: number, b: number): [1];The add function returns a number because it sums two numbers.
Fix the error by completing the declaration file for a JavaScript module without types.
declare module '[1]' { export function add(a: number, b: number): number; }
The declaration file must match the module name mathLib to provide types for it.
Fill both blanks to create a declaration file that describes a variable and a function.
export declare const version: [1]; export declare function greet(name: string): [2];
The version is a string, and greet returns nothing, so its return type is void.
Fill all three blanks to write a declaration file for an object with properties and a method.
export interface User {
id: [1];
name: [2];
isActive(): [3];
}User's id is a number, name is a string, and isActive returns a boolean indicating status.