-
Notifications
You must be signed in to change notification settings - Fork 3
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
Class constructors undefined #6
Comments
Very valid point. When I created the typings I was expecting everything under I painstakingly went through the whole document to add all typings in. But for those classes I didn't know how to access them (it was not described in the doc). As now I look into it, it is from here: https://github.com/atom/text-buffer/blob/master/src/point.coffee Do you know how to access it in js? We can then refactor it to put it in the right place. |
Ok. I found it. It can be accessed under: import a = require('atom');
a.Point;
a.TextBuffer.Point; Will see if I can pull the relevant types into the module (instead of the global |
Yes, it can be accessed like that, but the typechecker would complain. While these classes seem perfectly fine to be accessed. /// <reference path="./atom-namespace.d.ts" />
declare module 'atom' {
export var BufferedNodeProcess: atom.Typings.BufferedNodeProcess;
export var BufferedProcess: atom.Typings.BufferedProcess;
export var CompositeDisposable: atom.Typings.CompositeDisposable;
export var Task: atom.Typings.Task;
} |
I think we should move everything to the module while leaving only the properties of AtomEnvironment in the global |
Yes. That what I mean by "pull the relevant types into the module" |
Actually there are many things on the "blobStore",
"applicationDelegate",
"window",
"document",
"configDirPath",
"enablePersistence",
"unloaded",
"loadTime",
"emitter",
"disposables",
"stateStore",
"deserializers",
"deserializeTimings",
"views",
"notifications",
"config",
"keymaps",
"tooltips",
"commands",
"grammars",
"styles",
"packages",
"themes",
"menu",
"contextMenu",
"clipboard",
"project",
"appVersion",
"commandInstaller",
"workspace",
"textEditors",
"autoUpdater",
"initialStyleElements",
"stylesElement",
"previousWindowErrorHandler",
"windowEventHandler",
"constructor",
"lastUncaughtError",
"saveStateDebounceInterval",
"attachSaveStateListeners",
"setConfigSchema",
"registerDefaultDeserializers",
"registerDefaultCommands",
"registerDefaultViewProviders",
"registerDefaultOpeners",
"registerDefaultTargetForKeymaps",
"observeAutoHideMenuBar",
"reset",
"destroy",
"onDidBeep",
"onWillThrowError",
"onDidThrowError",
"onDidFailAssertion",
"inDevMode",
"inSafeMode",
"inSpecMode",
"isFirstLoad",
"getVersion",
"getReleaseChannel",
"isReleasedVersion",
"getWindowLoadTime",
"getLoadSettings",
"open",
"pickFolder",
"close",
"getSize",
"setSize",
"getPosition",
"setPosition",
"getCurrentWindow",
"center",
"focus",
"show",
"hide",
"reload",
"isMaximized",
"maximize",
"isFullScreen",
"setFullScreen",
"toggleFullScreen",
"displayWindow",
"getWindowDimensions",
"setWindowDimensions",
"isValidDimensions",
"storeWindowDimensions",
"getDefaultWindowDimensions",
"restoreWindowDimensions",
"restoreWindowBackground",
"storeWindowBackground",
"startEditorWindow",
"serialize",
"unloadEditorWindow",
"openInitialEmptyEditorIfNecessary",
"installUncaughtErrorHandler",
"uninstallUncaughtErrorHandler",
"installWindowEventHandler",
"uninstallWindowEventHandler",
"beep",
"confirm",
"openDevTools",
"toggleDevTools",
"executeJavaScriptInDevTools",
"assert",
"loadThemes",
"watchProjectPaths",
"setDocumentEdited",
"setRepresentedFilename",
"addProjectFolder",
"showSaveDialog",
"showSaveDialogSync",
"saveBlobStoreSync",
"saveState",
"loadState",
"deserialize",
"getStateKey",
"getStorageFolder",
"getConfigDirPath",
"getUserInitScriptPath",
"requireUserInitScript",
"onUpdateAvailable",
"updateAvailable",
"listenForUpdates",
"setBodyPlatformClass",
"setAutoHideMenuBar",
"dispatchApplicationMenuCommand",
"dispatchContextMenuCommand",
"openLocations",
"alive",
"assignId",
"isAlive",
"isDestroyed" Some of them are either private or not documented. |
Hi, how can I contribute to this repo? |
Sorry, didn't have time to work on it since last week. I have added you to this and other related projects. Feed free to give them some love. Remaining work:
|
Ah, I was having some difficulty on this: typings/discussions#15 (comment) |
Still have a few files left. |
@banacorn , I don't have time to work on it for the next few days, can you fix the files starting from Then we can test. Thanks. |
This is the best typings for Atom I can find on the planet, thanks for inviting me to this repo. I'll be happy to fix them. |
I've managed to clear all of the type errors, but I have no idea what should I do next (or what I've been doing). Is there a brain dead simple typings publish tutorial? Or something like |
Huge thanks! I'll check it out. If it works, then the next and last step is updating https://github.com/typings/registry/blob/master/env/atom.json |
Good news. I got it working. Checking in to registry now: |
I'm working on
|
The test https://github.com/typed-typings/env-atom/blob/master/spec/atom-spec.ts#L21 If you found other issue, feel free to open new ones. 🌷 |
I can reference some types such as
Point
like this:But not it's constructor:
The line above can be type checked, but will crash on runtime, because
atom.Typings
isundefined
, am I using it the wrong way?The text was updated successfully, but these errors were encountered: