// Define the async function with TypeScript async function mockApiCall(delay: number): Promise { return new Promise((resolve) => { setTimeout(() => { resolve('Mock API call completed'); }, delay); }); } // Example usage (async () => { console.log('Calling mock API...'); const result = await mockApiCall(2000); // Simulate a 2-second API call console.log(result); // Output: Mock API call completed })();