Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Prefer direct exports over "declare module" #90

Closed
ghost opened this issue Dec 13, 2017 · 4 comments
Closed

Prefer direct exports over "declare module" #90

ghost opened this issue Dec 13, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 13, 2017

Currently the type definitions are written like:

declare module 'vscode' {
	export const version: string;
	...
}

interface Thenable<T> { ... }

But they could be written like:

export const version: string;
...

declare global {
	interface Thenable<T> { ... }
}

The latter is the style we recommend on DefinitelyTyped. The difference is that it makes the file into an external module that is imported based on its path, rather than an ambient declaration that can be imported from anywhere.

@bpasero
Copy link
Member

bpasero commented Dec 18, 2017

@jrieken fyi not sure if this could be done from the vscode.d.ts we have in our repo in VSCode or we would have to massage the d.ts when downloading for this module.

@jrieken
Copy link
Member

jrieken commented Jan 3, 2018

I believe not, esp. because we have the vscode module declared in two files, vscode.d.ts and vscode.proposed.d.ts. @andy-ms Unsure if that's possible?

@ghost
Copy link
Author

ghost commented Jan 3, 2018

Yeah, if you have two different versions of the same thing I guess you'll have to use an ambient module in at least one of them.

guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Jan 15, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Jan 16, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Jan 19, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Jan 23, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Jan 29, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Jan 30, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Feb 1, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Feb 2, 2018
guw added a commit to forcedotcom/salesforcedx-vscode that referenced this issue Feb 5, 2018
@bpasero
Copy link
Member

bpasero commented Feb 8, 2018

I am closing this as I see no actionable item for the vscode module. Since the vscode.d.ts is coming from the VS Code repo, please report the issue there.

@bpasero bpasero closed this as completed Feb 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants