Module members not accessible when merging declarations for class and module

Topics: Language Specification
Sep 25, 2013 at 7:29 AM
Shouldn't this example work (it works when I merge a function and a module)
// class_module.d.ts
declare module "class_module" {
    class cm {

    module cm {
        export interface TestInterface {
            name: string;

    export = cm;

// class_module_main.ts
/// <reference path="class_module.d.ts" />

import class_module = require('class_module');

var test = new class_module();

class Test extends class_module.TestInterface {
This gives me "TS2094: The property 'TestInterface' does not exist on value of type 'class_module'."
Sep 25, 2013 at 6:04 PM
You need to write 'implements' instead of 'extends' for an interface, but there's a bug in the compiler anyway where we're not recognizing the name. I've logged a bug.
Sep 25, 2013 at 6:11 PM
This has been fixed in the develop branch
Sep 26, 2013 at 6:11 AM
Thank you!