Code
typescript
// global.d.ts
declare module "my-lib" {
export function greet(name: string): string;
export const version: string;
export interface Config {
timeout?: number;
retries?: number;
}
}
declare module "*.css" {
const content: Record<string, string>;
export default content;
}
declare module "*.png" {
const src: string;
export default src;
}
declare global {
interface Window {
myApp: { version: string };
}
}