-
Notifications
You must be signed in to change notification settings - Fork 44
Add type definitions to allow editor autocompletion / intellisense #116
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
base: 3.1-preview
Are you sure you want to change the base?
Add type definitions to allow editor autocompletion / intellisense #116
Conversation
|
Amazing, much needed! |
|
How can I help? |
|
We only need to create a file for every missing definition that export a definition like this:
export namespace Broadcast {
let sampleProperty: type;
function methodSignature(arg1: type, arg2: type);
}on export { Broadcast, Broadcastable } from './types/Broadcast';EDIT: there are too many documented modes to do this but after a lot of tests, export declare class SampleClass extends someBaseClass {
sampleProperty: sampleType;
sampleMethod(sampleArg: sampleType): sampleReturnType;
}The last example allow to declare: class, extended class, properties and methods, also allow declaration of functions i.e. export declare function MyFunction(sampleArg: sampleType): sampleReturnType; |
|
Having those autocompletions and typing from the .d.ts or ts-core is AMAZING! |
This PR add a folder
typeswith one definition file for every src classes, with same name as original class and a.dsuffix, these definition are exposed using anindex.d.tson repository root that import and re export all available definitions.These additions allow an editor like vscode to automatically suggest methods, properties and arguments, making more easier especially for new users the core classes usages.
I hope that this work could be considered useful.
Available definitions:
Some working examples:
Methods list:

Function argument list:

This PR also add
typescriptand@types/nodeas dev dependency to validate definitions file using this command:npx tsc --esModuleInterop true index.d.ts