Complete the code to declare an ambient variable named myVar of type string.
declare var [1]: string;myVar.The declare var syntax is used to declare an ambient variable. Here, myVar is the variable name.
Complete the code to declare an ambient function named greet that takes a name parameter of type string and returns void.
declare function [1](name: string): void;The ambient function declaration uses declare function followed by the function name. Here, the function name is greet.
Fix the error in the ambient declaration by completing the code to declare a constant named PI of type number.
declare const [1]: number;Ambient constants are declared with declare const. The name must match exactly PI (case-sensitive).
Fill both blanks to declare an ambient namespace named Utils with a function log that takes a message string and returns void.
declare namespace [1] { function [2](message: string): void; }
The ambient namespace is declared with declare namespace Utils. Inside it, the function log is declared.
Fill all three blanks to declare an ambient interface named Person with a name property of type string and an optional age property of type number.
declare interface [1] { [2]: string; [3]?: number; }
?.The ambient interface is declared with declare interface Person. It has a required name property and an optional age property.