Skip to content

Instantly share code, notes, and snippets.

@aeldar
Created March 3, 2023 15:50
Show Gist options
  • Save aeldar/ec35f757eec5aa6a4933ef9284df8d03 to your computer and use it in GitHub Desktop.
Save aeldar/ec35f757eec5aa6a4933ef9284df8d03 to your computer and use it in GitHub Desktop.
Declare global `window` interface
// Usage example
import './global.types.ts';
// Enough to be imported in a single file, closer to the app's initialisation.
// some internal types
import { EnvConfig } from '@/some/internal/type/for/env';
declare global {
interface Window {
env: EnvConfig;
}
}
// needed to make the file exportable
export {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment