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

TypeScript static interface binding #1280

Closed
MrMatthewLayton opened this issue Nov 26, 2014 · 3 comments
Closed

TypeScript static interface binding #1280

MrMatthewLayton opened this issue Nov 26, 2014 · 3 comments
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Revisit An issue worth coming back to

Comments

@MrMatthewLayton
Copy link

I would like to know if there are any plans to refactor lib.d.ts (and subsequent definitions) to declare interfaces for static implementations, thus allowing custom static bindings for existing Objects.

i.e.

interface _Object {
    is(value1: any, value2: any): boolean;
}

declare var Object: _Object;

instead of

declare var Object: {
    is(value1: any, value2: any): boolean;
}

Full problem here: http://stackoverflow.com/questions/27144550/typescript-static-interface-binding

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Revisit An issue worth coming back to labels Nov 26, 2014
@RyanCavanaugh
Copy link
Member

We need to make the built-in objects more extensible by some mechanism or another. This is still under discussion.

@basarat
Copy link
Contributor

basarat commented Nov 26, 2014

Duplicate of #182

@MrMatthewLayton
Copy link
Author

Will continue thread in #182

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Revisit An issue worth coming back to
Projects
None yet
Development

No branches or pull requests

3 participants