18

Closed

Classes and enums inside classes

description

It'd be nice if we were able to create scoped classes and enums inside classes:

class MyClass {
public enum SomeEnum {
    ...
}

private ScopedClass {
    ...
}
}
Closed Oct 24, 2013 at 5:34 PM by jonturner

comments

jonturner wrote Mar 12, 2013 at 3:57 PM

We're working on a spec for this type of feature which allows you to mix across different types of abstraction, like so:
class Store { }
module Store {
  export class Error { }
}

LarsCorneliussen wrote Jul 11, 2013 at 8:36 AM

isn't this fixed in 0.9? Declaration merging...?

derekcicerone wrote Oct 13, 2013 at 6:56 PM

This is likely needed for leaflet since it has both L.Icon and L.Icon.Default.

derekcicerone wrote Oct 13, 2013 at 7:03 PM

Whoops, this is already working in 0.9.1.1 with the suggested syntax. I'll fix the definition for leaflet in DefinitelyTyped now.

jonturner wrote Oct 24, 2013 at 5:34 PM

Yes, this should be marked as fixed. Declaration merging is the intended solution now for inner classes.