镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Allow local interface definition #2148

Description

@NN---

It is impossible to define local interface in the function, but you can do it in the module.

module A {
  interface B{} // OK 
}

(function X() {
  interface Y { } // Error
})();

Activity

  1. RyanCavanaugh commented on Mar 4, 2015

    @RyanCavanaugh
    Member

    I thought we had a bug for block-level interfaces somewhere already?

    Anyway some compelling examples would be useful. It's just as easy to write a var declaration with a given type and use typeof x to refer to that shape, since you're probably going to consume the type that way regardless?

  2. NN--- commented on Mar 4, 2015

    @NN---
    Author

    Agree, 'typeof x' is possible workaround.
    I should get used to it.

  3. added
    CommittedThe team has roadmapped this issue
    and removed
    Needs More InfoThe issue still hasn't been fully clarified
    on Jun 1, 2015
  4. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommittedThe team has roadmapped this issueFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions