Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to augment export = function/namespace #7545

Closed
blakeembrey opened this issue Mar 16, 2016 · 6 comments
Closed

Unable to augment export = function/namespace #7545

blakeembrey opened this issue Mar 16, 2016 · 6 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@blakeembrey
Copy link
Contributor

Possible duplicate of #7148, but it seems like it should be working according to #6742.

TypeScript Version:

1.8.7

Code

File: 1.d.ts

declare module 'm1' {
  function x (): x.Test;

  namespace x {
    export interface Test {
      prop1: boolean;
    }
  }

  export = x;
}

File: 2.ts

/// <reference path="./1.d.ts" />

import m1 = require('m1');

declare module 'm1' {
  interface Test {
    prop2: boolean;
  }
}

m1().prop2 // `prop2` does not exist on type `Test`.

Expected behavior:

Interfaces should merge, giving me access to prop2.

Actual behavior:

No prop2 on interface Test.

@vladima
Copy link
Contributor

vladima commented Mar 16, 2016

I can repro this in 1.8 and it seems to be fixed in @next.

@blakeembrey
Copy link
Contributor Author

@vladima Thanks for the confirmation, will it be ported to 1.8?

@mhegazy
Copy link
Contributor

mhegazy commented Mar 16, 2016

i would use typesctipt@next for this one. there are a couple of other related fixes as well.

@mhegazy mhegazy closed this as completed Mar 16, 2016
@mhegazy mhegazy added Fixed A PR has been merged for this issue Bug A bug in TypeScript labels Mar 16, 2016
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Mar 16, 2016
@blakeembrey
Copy link
Contributor Author

@Guria If you want to type moment plugins, looks like you'll need to be using typescript@next. (Ref: #7148 (comment)).

@Guria
Copy link

Guria commented Mar 16, 2016

@blakeembrey thanks, will try it :)

@Guria
Copy link

Guria commented Mar 16, 2016

Seems working. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants