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

Separate internal/external definitions? #34

Open
altano opened this issue Dec 31, 2014 · 1 comment
Open

Separate internal/external definitions? #34

altano opened this issue Dec 31, 2014 · 1 comment

Comments

@altano
Copy link

altano commented Dec 31, 2014

Hello,

knockout.d.ts defines both an ambient internal module as well as an ambient external module. This sucks because your entire solution will then assume that "ko" is a global variable, even if you intent to use Knockout as a CommonJS package via NPM rather than inject it as a script tag.

Would you be okay with my splitting knockout.d.ts into two separate files? The proposal is to change:

knockout.d.ts:

// <Common definitions here>
declare module "knockout" {
    export = ko;
}
declare var ko: KnockoutStatic;

to:

knockout.internal-module.d.ts:

// <Common definitions here>
declare var ko: KnockoutStatic;

and knockout.external-module.d.ts:

// <Common definitions here>
declare module "knockout" {
    var ko: KnockoutStatic;
    export = ko;
}

Thoughts?

@altano
Copy link
Author

altano commented Dec 31, 2014

Optionally we can leave knockout.d.ts alone and just create knockout-external.d.ts or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant