In modern TypeScript we have class expressions which you can use to create a nested class. For example you can do the following :
class Foo {
static Bar = class {
}
}
// works!
var foo = new Foo();
var bar = new Foo.Bar();
More Related Contents:
- Use async await with Array.map
- How do I use namespaces with TypeScript external modules?
- Get keys of a Typescript interface as array of strings
- Why can I access TypeScript private members when I shouldn’t be able to?
- Using _ (underscore) variable with arrow functions in ES6/Typescript
- Check if an object implements an interface at runtime with TypeScript
- Angular4 – No value accessor for form control
- When to use JSX.Element vs ReactNode vs ReactElement?
- Property ‘value’ does not exist on type EventTarget in TypeScript [duplicate]
- How to define type for a function callback (as any function type, not universal any) used in a method parameter
- Mongoose the Typescript way…?
- Angular 2 – communication of typescript functions with external js libraries
- Extend native JavaScript array
- npm WARN … requires a peer of … but none is installed. You must install peer dependencies yourself
- Property ‘entries’ does not exist on type ‘ObjectConstructor’
- Possible to extend types in Typescript?
- TypeScript – Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type
- Calling properly TypeScript code from JavaScript
- Unraveling Angular 2 book, Chapter 1, Example 5
- Cast int to enum strings in Typescript
- Typescript: How to extend two classes?
- how to define index in angular material table
- Type ‘void’ is not assignable to type ‘((event: MouseEvent) => void) | undefined’
- Make sure array has all types from a union
- How to disable the selection of an item when the first letter of the option is pressed in the Select component?
- TypeScript TS7015: Element implicitly has an ‘any’ type because index expression is not of type ‘number’
- binding data to angular checkbox
- Determine if a CSS class exists with Javascript
- How to prevent Next.js from instantiating a singleton class/object multiple times?
- Declare an array in TypeScript