I just found the answer to this in another Stack Overflow question’s answer.
declare global {
interface Window { MyNamespace: any; }
}
window.MyNamespace = window.MyNamespace || {};
Basically, you need to extend the existing window
interface to tell it about your new property.
Related Contents:
- In Typescript, what is the ! (exclamation mark / bang) operator when dereferencing a member?
- Experimental decorators warning in TypeScript compilation
- Expression ___ has changed after it was checked
- Typescript interface default values
- Declaring abstract method in TypeScript
- What’s the difference between ‘extends’ and ‘implements’ in TypeScript
- How to get argument types from function in Typescript [duplicate]
- How to use a typescript enum value in an Angular2 ngSwitch statement
- Specify return type in TypeScript arrow function
- Safe navigation operator (?.) or (!.) and null property paths
- Derive union type from tuple/array values
- Auto import in Visual Studio Code only offering absolute path with Lerna subpackages in TypeScript
- “This syntax requires an imported helper but module ‘tslib’ cannot be found” with ES2015 modules
- TypeScript type signatures for functions with variable argument counts
- TypeScript – Angular: Multiline string
- How to declare and import typescript interfaces in a separate file
- Types from both keys and values of object in Typescript
- Module vs Namespace – Import vs Require Typescript
- Difference between const and readonly in typescript
- How do I actually deploy an Angular 2 + Typescript + systemjs app?
- Typescript, how to pass “Object is possibly null” error?
- What is reflect-metadata in typescript
- Make a single property optional in TypeScript
- Do I need to use the “import type” feature of TypeScript 3.8 if all of my imports are from my own file?
- How to check the object type on runtime in TypeScript?
- How to add custom “typings” in typescript 2.0 / 3.0
- What’s the difference between Map and Record [duplicate]
- A TypeScript GUID class? [closed]
- Declaring an HTMLElement Typescript
- Why does TypeScript have both `void` and `undefined`?
- Object index key type in Typescript
- Exclude with pattern in tsconfig.json
- How to install older version of Typescript?
- Error object inside catch is of type unknown
- What are enum Flags in TypeScript?
- What does ?: mean in TypeScript?
- Typescript : require statement not part of an import statement
- create-react-app Typescript 3.5, Path Alias
- Cannot find name ‘it’ in Jest TypeScript
- Switch for specific type in TypeScript
- Property ‘matchAll’ does not exist on type ‘string’
- How to write Helper class in typescript? [duplicate]
- vscode typescript: ‘Add all missing imports’ shortcut
- In Typescript, how to select a type from a union, using a literal type property of said type?
- Is there a way to use –esModuleInterop in tsconfig as opposed to it being a flag?
- Typescript decorator for function, not method. Possible?
- TypeScript – wait for an observable/promise to finish, and return observable
- tsconfig.json for project with `src` and `tests`
- How to exclude properties from interface while inheriting
- ‘Stack.Navigator’ cannot be used as a JSX component