├── .editorconfig ├── .gitattributes ├── .gitignore ├── .npmignore ├── LICENSE.md ├── README.md ├── es6.d.ts ├── gulpfile.js ├── keymaps └── json-schema.cson ├── lib ├── helpers │ └── get-ranges.ts ├── json-schema.ts ├── omni.ts ├── providers │ ├── bower-provider.ts │ └── npm-provider.ts ├── schema-autocomplete.ts ├── schema-linter.ts ├── schema-provider.ts ├── schema-selector-view.ts └── schema-selector.ts ├── menus └── json-schema.cson ├── package.json ├── schema.gif ├── schema2.gif ├── styles └── json-schema.less ├── tsconfig.json ├── tsd.d.ts ├── tsd.json └── typingsTemp ├── atom-keymap └── atom-keymap.d.ts ├── atom-space-pen-views └── atom-space-pen-views.d.ts ├── atom └── atom.d.ts ├── event-kit └── event-kit.d.ts ├── first-mate └── first-mate.d.ts ├── linter └── linter.d.ts ├── pathwatcher └── pathwatcher.d.ts ├── property-accessors └── property-accessors.d.ts ├── scandal └── scandal.d.ts ├── scoped-property-store └── scoped-property-store.d.ts ├── serializable └── serializable.d.ts ├── space-pen └── space-pen.d.ts ├── status-bar └── status-bar.d.ts └── text-buffer └── text-buffer.d.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 4 9 | insert_final_newline = true 10 | charset = utf-8 11 | 12 | [*.json] 13 | indent_size = 2 14 | trim_trailing_whitespace = true 15 | 16 | [*.{ts,js}] 17 | trim_trailing_whitespace = true 18 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | lib/**/*.js 5 | spec/**/*.js 6 | typings 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | server 5 | typings 6 | lib/**/*.js 7 | spec/**/*.js 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Json Schema 2 | 3 | Adds support for [JSON Schema](http://json-schema.org/) in [Atom](http://atom.io). 4 | 5 | ![](https://raw.githubusercontent.com/OmniSharp/atom-json-schema/master/schema.gif) 6 | 7 | 8 | ![](https://raw.githubusercontent.com/OmniSharp/atom-json-schema/master/schema2.gif) 9 | 10 | ## Whats it do 11 | Using is-my-json-valid for schema validation, Json Schema warns the user if their json file doesn't match the commonly defined schema. Also using the defined Json Schema we can offer auto completion results for enum values. 12 | 13 | ## Extentions 14 | Json Schema was built for use with [OmniSharp](http://www.omnisharp.net/). There is an extension point that lets you plug in custom intellisense providers. This is to help with tools like Npm or NuGet, where package.json and project.json 15 | both have their package references. This this extension point you can plug in calls off to the associated webservice / localcache / whatever you want. 16 | 17 | ## Npm support 18 | As stated above, NPM support is added out of the box. Search is limited to `starts with` (if anyone knows how to fuzzy search against skimdb log an issue!). We can add the package for you, as well as the latest version as values. 19 | 20 | ## Bower support 21 | Bower support is planned, I still have to figure out the best way to find version numbers (or if its even possible since bower uses git...). 22 | 23 | 24 | # Make your own schema provider 25 | The schema interface is declared in typescript as follows: 26 | 27 | ``` 28 | interface IAutocompleteProvider { 29 | fileMatchs: string[]; 30 | pathMatch: (path: string) => boolean; 31 | getSuggestions: (options: IAutocompleteProviderOptions) => Promise; 32 | dispose(): void; 33 | } 34 | 35 | interface IAutocompleteProviderOptions { 36 | editor: Atom.TextEditor; 37 | bufferPosition: TextBuffer.Point; // the position of the cursor 38 | prefix: string; 39 | scopeDescriptor: { scopes: string[] }; 40 | activatedManually: boolean; 41 | path: string; 42 | } 43 | ``` 44 | 45 | * fileMatchs 46 | are the files that the provider applies to 47 | * pathMatch 48 | is a callback method that lets you determine. The path that is give is based on where the user has their cursor in the file. 49 | * getSuggestions 50 | identical to autocomplete+ with a few extra options. 51 | * path 52 | is the path part of the file such as `dependencies` or `dependencies.lodash` 53 | 54 | Then in your `package.json` add... 55 | 56 | ``` 57 | "jsonschema.provider": { 58 | "versions": { 59 | "0.1.0": "consumeProvider" 60 | } 61 | } 62 | ``` 63 | 64 | 65 | # TODO 66 | * Bower support? 67 | * JSPM support? 68 | * Allow for custom $schema's 69 | -------------------------------------------------------------------------------- /es6.d.ts: -------------------------------------------------------------------------------- 1 | interface Symbol { 2 | /** Returns a string representation of an object. */ 3 | toString(): string; 4 | 5 | /** Returns the primitive value of the specified object. */ 6 | valueOf(): Object; 7 | 8 | [Symbol.toStringTag]: string; 9 | } 10 | 11 | interface SymbolConstructor { 12 | /** 13 | * A reference to the prototype. 14 | */ 15 | prototype: Symbol; 16 | 17 | /** 18 | * Returns a new unique Symbol value. 19 | * @param description Description of the new Symbol object. 20 | */ 21 | (description?: string|number): symbol; 22 | 23 | /** 24 | * Returns a Symbol object from the global symbol registry matching the given key if found. 25 | * Otherwise, returns a new symbol with this key. 26 | * @param key key to search for. 27 | */ 28 | for(key: string): symbol; 29 | 30 | /** 31 | * Returns a key from the global symbol registry matching the given Symbol if found. 32 | * Otherwise, returns a undefined. 33 | * @param sym Symbol to find the key for. 34 | */ 35 | keyFor(sym: symbol): string; 36 | 37 | // Well-known Symbols 38 | 39 | /** 40 | * A method that determines if a constructor object recognizes an object as one of the 41 | * constructor’s instances. Called by the semantics of the instanceof operator. 42 | */ 43 | hasInstance: symbol; 44 | 45 | /** 46 | * A Boolean value that if true indicates that an object should flatten to its array elements 47 | * by Array.prototype.concat. 48 | */ 49 | isConcatSpreadable: symbol; 50 | 51 | /** 52 | * A method that returns the default iterator for an object. Called by the semantics of the 53 | * for-of statement. 54 | */ 55 | iterator: symbol; 56 | 57 | /** 58 | * A regular expression method that matches the regular expression against a string. Called 59 | * by the String.prototype.match method. 60 | */ 61 | match: symbol; 62 | 63 | /** 64 | * A regular expression method that replaces matched substrings of a string. Called by the 65 | * String.prototype.replace method. 66 | */ 67 | replace: symbol; 68 | 69 | /** 70 | * A regular expression method that returns the index within a string that matches the 71 | * regular expression. Called by the String.prototype.search method. 72 | */ 73 | search: symbol; 74 | 75 | /** 76 | * A function valued property that is the constructor function that is used to create 77 | * derived objects. 78 | */ 79 | species: symbol; 80 | 81 | /** 82 | * A regular expression method that splits a string at the indices that match the regular 83 | * expression. Called by the String.prototype.split method. 84 | */ 85 | split: symbol; 86 | 87 | /** 88 | * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive 89 | * abstract operation. 90 | */ 91 | toPrimitive: symbol; 92 | 93 | /** 94 | * A String value that is used in the creation of the default string description of an object. 95 | * Called by the built-in method Object.prototype.toString. 96 | */ 97 | toStringTag: symbol; 98 | 99 | /** 100 | * An Object whose own property names are property names that are excluded from the with 101 | * environment bindings of the associated objects. 102 | */ 103 | unscopables: symbol; 104 | } 105 | declare var Symbol: SymbolConstructor; 106 | 107 | interface IteratorResult { 108 | done: boolean; 109 | value?: T; 110 | } 111 | 112 | interface Iterator { 113 | next(value?: any): IteratorResult; 114 | return?(value?: any): IteratorResult; 115 | throw?(e?: any): IteratorResult; 116 | } 117 | 118 | interface Iterable { 119 | [Symbol.iterator](): Iterator; 120 | } 121 | 122 | interface IterableIterator extends Iterator { 123 | [Symbol.iterator](): IterableIterator; 124 | } 125 | 126 | interface WeakMap { 127 | clear(): void; 128 | delete(key: K): boolean; 129 | get(key: K): V; 130 | has(key: K): boolean; 131 | set(key: K, value?: V): WeakMap; 132 | } 133 | 134 | interface WeakMapConstructor { 135 | new (): WeakMap; 136 | prototype: WeakMap; 137 | } 138 | 139 | declare var WeakMap: WeakMapConstructor; 140 | 141 | interface Map { 142 | clear(): void; 143 | delete(key: K): boolean; 144 | entries(): IterableIterator<[K, V]>; 145 | forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; 146 | get(key: K): V; 147 | has(key: K): boolean; 148 | keys(): IterableIterator; 149 | set(key: K, value?: V): Map; 150 | size: number; 151 | values(): IterableIterator; 152 | [Symbol.iterator]():IterableIterator<[K,V]>; 153 | [Symbol.toStringTag]: string; 154 | } 155 | 156 | interface MapConstructor { 157 | new (): Map; 158 | new (iterable: Iterable<[K, V]>): Map; 159 | prototype: Map; 160 | } 161 | declare var Map: MapConstructor; 162 | 163 | interface Set { 164 | add(value: T): Set; 165 | clear(): void; 166 | delete(value: T): boolean; 167 | entries(): IterableIterator<[T, T]>; 168 | forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; 169 | has(value: T): boolean; 170 | keys(): IterableIterator; 171 | size: number; 172 | values(): IterableIterator; 173 | [Symbol.iterator]():IterableIterator; 174 | [Symbol.toStringTag]: string; 175 | } 176 | 177 | interface SetConstructor { 178 | new (): Set; 179 | new (iterable: Iterable): Set; 180 | prototype: Set; 181 | } 182 | declare var Set: SetConstructor; 183 | 184 | interface WeakSet { 185 | add(value: T): WeakSet; 186 | clear(): void; 187 | delete(value: T): boolean; 188 | has(value: T): boolean; 189 | [Symbol.toStringTag]: string; 190 | } 191 | 192 | interface WeakSetConstructor { 193 | new (): WeakSet; 194 | new (iterable: Iterable): WeakSet; 195 | prototype: WeakSet; 196 | } 197 | declare var WeakSet: WeakSetConstructor; 198 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var ts = require('typescript'); 3 | var through = require('through2'); 4 | var gutil = require('gulp-util'); 5 | var merge = require('merge-stream'); 6 | var del = require('del'); 7 | var _ = require('lodash'); 8 | var path = require('path'); 9 | 10 | // Simply take TS code and strip anything not javascript 11 | // Does not do any compile time checking. 12 | function tsTranspile() { 13 | return through.obj(function (file, enc, cb) { 14 | if (file.isNull()) { 15 | cb(null, file); 16 | return; 17 | } 18 | 19 | var res = ts.transpile(file.contents.toString(), { module: ts.ModuleKind.CommonJS }); 20 | 21 | file.contents = new Buffer(res); 22 | file.path = gutil.replaceExtension(file.path, '.js'); 23 | gutil.log(gutil.colors.cyan('Writing ') + gutil.colors.green(_.trim(file.path.replace(__dirname, ''), path.sep))); 24 | 25 | this.push(file); 26 | 27 | cb(); 28 | }); 29 | } 30 | 31 | function tsTranspiler(source, dest) { 32 | return source 33 | .pipe(tsTranspile()) 34 | .pipe(gulp.dest(dest)); 35 | } 36 | 37 | var metadata = { 38 | lib: ['lib/**/*.ts', '!lib/**/*.d.ts'], 39 | //spec: ['spec/**/*.ts'], 40 | } 41 | 42 | 43 | gulp.task('typescript', ['clean'], function() { 44 | var lib = tsTranspiler(gulp.src(metadata.lib), './lib'); 45 | //var spec = tsTranspiler(gulp.src(metadata.spec), './spec'); 46 | 47 | //return merge(lib, spec); 48 | return lib; 49 | }); 50 | 51 | gulp.task('clean', ['clean:lib'/*, 'clean:spec'*/]); 52 | 53 | gulp.task('clean:lib', function(done) { 54 | del(metadata.lib.map(function(z) { return gutil.replaceExtension(z, '.js'); }), function(err, paths) { 55 | _.each(paths, function(path) { 56 | gutil.log(gutil.colors.red('Deleted ') + gutil.colors.magenta(path.replace(__dirname, '').substring(1))); 57 | }); 58 | done(); 59 | }); 60 | }); 61 | 62 | gulp.task('clean:spec', function(done) { 63 | del(metadata.spec.map(function(z) { return gutil.replaceExtension(z, '.js'); }), function(err, paths) { 64 | _.each(paths, function(path) { 65 | gutil.log(gutil.colors.red('Deleted ') + gutil.colors.magenta(path.replace(__dirname, '').substring(1))); 66 | }); 67 | done(); 68 | }); 69 | }); 70 | 71 | gulp.task('npm-postinstall', ['typescript']); 72 | 73 | gulp.task('npm-prepublish', ['typescript']); 74 | 75 | // The default task (called when you run `gulp` from CLI) 76 | gulp.task('default', ['typescript']); 77 | -------------------------------------------------------------------------------- /keymaps/json-schema.cson: -------------------------------------------------------------------------------- 1 | # Keybindings require three things to be fully defined: A selector that is 2 | # matched against the focused element, the keystroke and the command to 3 | # execute. 4 | # 5 | # Below is a basic keybinding which registers on all platforms by applying to 6 | # the root workspace element. 7 | 8 | # For more detailed documentation see 9 | # https://atom.io/docs/latest/behind-atom-keymaps-in-depth 10 | #'atom-workspace': 11 | # 'ctrl-alt-y': 'yo:yeoman' 12 | -------------------------------------------------------------------------------- /lib/helpers/get-ranges.ts: -------------------------------------------------------------------------------- 1 | import {unique} from "lodash"; 2 | 3 | export interface ITokenRange { 4 | path: string; 5 | section: { start: [number, number], end: [number, number] }; 6 | value: { start: [number, number], end: [number, number] } 7 | } 8 | 9 | function doGetRanges(editor: Atom.TextEditor, predicate: any): any { 10 | var doc = editor.getText(); 11 | let token_regex = /"([-a-zA-Z0-9+\._]+)"[\s]*:$/; 12 | var open: string[] = []; 13 | let depth = 1; 14 | let line = 0; 15 | let lineStart = 0; 16 | var tokens = []; 17 | var start: [number, number][] = []; 18 | var valueStart: [number, number][] = []; 19 | var current = null; 20 | var isArray = false; 21 | var isString = false; 22 | 23 | if (!predicate) { 24 | var objectPaths: { [key: string]: { line: number; column: number; } } = {}; 25 | var results: { [key: string]: ITokenRange; } = {}; 26 | } 27 | 28 | for (var index = doc.indexOf('{') + 1; index < doc.lastIndexOf('}'); index++) { 29 | let char = doc[index]; 30 | if (char === '\n') { 31 | line += 1; 32 | if (doc[index + 1] === '\r') { 33 | lineStart = index + 2; 34 | } else { 35 | lineStart = index + 1; 36 | } 37 | } 38 | 39 | if ((isString || isArray) && predicate && predicate(line, index - lineStart)) { 40 | if (char === '}' || char === ',') open.pop(); 41 | return { 42 | path: open.join('/'), 43 | }; 44 | } 45 | 46 | if (isString && char !== '"' && doc[index - 1] !== "\\") { 47 | continue; 48 | } 49 | 50 | if (isString && char === '"') { 51 | isString = false; 52 | } else if (!isString && char === '"') { 53 | isString = true; 54 | } 55 | 56 | if (isArray && char !== ']') { 57 | continue; 58 | } 59 | 60 | if (char === '[') { 61 | isArray = true; 62 | } 63 | 64 | if (char === ']') { 65 | isArray = false; 66 | } 67 | 68 | if (char === '{') { 69 | depth += 1; 70 | tokens.push(open[open.length - 1]); 71 | start.push(start[start.length - 1]); 72 | if (objectPaths) { 73 | objectPaths[tokens.join('/')] = { 74 | line: line, 75 | column: index - lineStart, 76 | }; 77 | } 78 | valueStart.push(valueStart[valueStart.length - 1]); 79 | } 80 | 81 | if (char === ':' && !(isString || isArray)) { 82 | let match = doc.substr(0, index + 1).match(token_regex); 83 | if (match) { 84 | open.push(match[1]); 85 | start.push([line, index - match[0].length - lineStart]); 86 | valueStart.push([line, index - lineStart + 1]); 87 | } 88 | } 89 | 90 | if (predicate && predicate(line, index - lineStart)) { 91 | if (char === '}' || char === ',') open.pop(); 92 | return { 93 | path: open.join('/'), 94 | }; 95 | } 96 | 97 | if (open.length && (char === '}' || (!isArray && char === ','))) { 98 | var path = tokens.concat([open.pop()]).join('/'); 99 | if (results) { 100 | results[path] = { 101 | path: path, 102 | section: { 103 | start: start.pop(), 104 | end: [line, index + 1 - lineStart] 105 | }, 106 | value: { 107 | start: valueStart.pop(), 108 | end: [line, index - lineStart] 109 | } 110 | }; 111 | open.pop(); 112 | } 113 | } 114 | 115 | if (char === '}') { 116 | depth -= 1; 117 | var path = tokens.join('/'); 118 | if (results) { 119 | results[path] = { 120 | path: path, 121 | section: { 122 | start: start.pop(), 123 | end: [line, index - lineStart] 124 | }, 125 | value: { 126 | start: valueStart.pop(), 127 | end: [line, index - 1 - lineStart] 128 | } 129 | }; 130 | tokens.pop(); 131 | } 132 | } 133 | } 134 | return { ranges: results, objectPaths }; 135 | } 136 | 137 | export function getRanges(editor: Atom.TextEditor): { ranges: { [key: string]: ITokenRange }; objectPaths: { [key: string]: { line: number; column: number; } }; } { 138 | return doGetRanges(editor, undefined); 139 | } 140 | 141 | export function getPath(editor: Atom.TextEditor, predicate: (line: number, column: number) => boolean): { path: string; } { 142 | return doGetRanges(editor, predicate); 143 | } 144 | -------------------------------------------------------------------------------- /lib/json-schema.ts: -------------------------------------------------------------------------------- 1 | import _ = require('lodash'); 2 | import {CompositeDisposable, ReplaySubject} from "rx"; 3 | import {omni} from "./omni"; 4 | 5 | class JsonSchema { 6 | private disposable = new CompositeDisposable(); 7 | 8 | public editor: Rx.Observable; 9 | 10 | public activate(state) { 11 | omni.activate(); 12 | this.disposable.add(omni); 13 | 14 | var {schemaSelector} = require('./schema-selector'); 15 | this.disposable.add(schemaSelector); 16 | 17 | //var {schemaPrSelector} = require('./schema-selector'); 18 | //this.disposable.add(schemaSelector); 19 | 20 | schemaSelector.activate(); 21 | schemaSelector.attach(); 22 | } 23 | 24 | public deactivate() { 25 | this.disposable.dispose(); 26 | } 27 | 28 | public consumeStatusBar(statusBar) { 29 | var {schemaSelector} = require('./schema-selector'); 30 | schemaSelector.setup(statusBar); 31 | } 32 | 33 | public consumeProvider(providers) { 34 | if (!providers) return; 35 | if (!_.isArray(providers)) providers = [providers]; 36 | var cd = new CompositeDisposable(); 37 | var {CompletionProvider} = require("./schema-autocomplete"); 38 | _.each(providers, CompletionProvider.registerProvider); 39 | return cd; 40 | } 41 | 42 | public provideAutocomplete() { 43 | var {CompletionProvider} = require("./schema-autocomplete"); 44 | //this.disposable.add(CompletionProvider); 45 | return CompletionProvider; 46 | } 47 | 48 | public provideLinter(linter) { 49 | var LinterProvider = require("./schema-linter"); 50 | return LinterProvider.provider; 51 | } 52 | } 53 | 54 | var instance = new JsonSchema; 55 | export = instance; 56 | -------------------------------------------------------------------------------- /lib/omni.ts: -------------------------------------------------------------------------------- 1 | //omnipresent 2 | import _ = require('lodash'); 3 | import {CompositeDisposable, ReplaySubject} from "rx"; 4 | import {ISchema} from "./schema-provider"; 5 | 6 | class Omni implements Rx.IDisposable { 7 | private disposable = new CompositeDisposable(); 8 | private _editor = new ReplaySubject(1); 9 | private _editorObservable = this._editor.asObservable(); 10 | 11 | public activate() { 12 | this.setupEditorObservable(); 13 | } 14 | 15 | public dispose() { 16 | this.disposable.dispose(); 17 | } 18 | 19 | public get activeEditor() { return this._editorObservable; } 20 | 21 | private setupEditorObservable() { 22 | this.disposable.add(atom.workspace.observeActivePaneItem((pane: any) => { 23 | if (pane && pane.getGrammar) { 24 | var grammar = pane.getGrammar(); 25 | if (grammar) { 26 | var grammarName = grammar.name; 27 | if (grammarName === 'JSON') { 28 | this._editor.onNext(pane); 29 | return; 30 | } 31 | } 32 | } 33 | 34 | // This will tell us when the editor is no longer an appropriate editor 35 | this._editor.onNext(null); 36 | })); 37 | } 38 | 39 | private _schema: ISchema; 40 | public get activeSchema() { return this._schema } 41 | public set activeSchema(value) { 42 | this._schema = value; 43 | this._editorObservable.take(1).where(z => !!z).subscribe(editor => editor['__json__schema__'] = value); 44 | } 45 | } 46 | 47 | export var omni = new Omni; 48 | -------------------------------------------------------------------------------- /lib/providers/bower-provider.ts: -------------------------------------------------------------------------------- 1 | import * as _ from "lodash"; 2 | import {Observable} from "rx"; 3 | var fetch: (url: string) => Rx.IPromise = require('node-fetch'); 4 | 5 | interface IResult { 6 | json(): T; 7 | text(): string; 8 | } 9 | 10 | interface BowerResult { 11 | name: string, 12 | url: string 13 | } 14 | 15 | interface BowerPackage { 16 | version: string; 17 | } 18 | 19 | interface GitHubTag { 20 | name: string; 21 | } 22 | 23 | function search(text) { 24 | var $get = fetch(`https://bower.herokuapp.com/packages/search/${text}`); 25 | return Observable 26 | .fromPromise($get.then(res => res.json())) 27 | .flatMap(Observable.fromArray); 28 | } 29 | 30 | function searchPackage(text, name: string) { 31 | var $get = fetch(`https://bower.herokuapp.com/packages/${name}`); 32 | var toJson = (res: IResult) => res.json(); 33 | var getReleases = (res: BowerResult) => { 34 | if (!_.contains(res.url, 'github')) { 35 | return; 36 | } 37 | var url = res.url.replace('.git', '/tags').replace('git://github.com/', 'https://api.github.com/repos/'); 38 | return fetch(url); 39 | }; 40 | var getTags = (rel: GitHubTag) => rel.name.replace('v', ''); 41 | return Observable 42 | .fromPromise($get.then(toJson).then(getReleases).then(res => res.json())) 43 | .flatMap(Observable.fromArray) 44 | .map(getTags); 45 | } 46 | 47 | function makeSuggestion(item: { name }) { 48 | var type = 'package'; 49 | 50 | return { 51 | _search: item.name, 52 | snippet: item.name, 53 | type: type, 54 | displayText: item.name, 55 | className: 'autocomplete-json-schema', 56 | } 57 | } 58 | 59 | var packageName: IAutocompleteProvider = { 60 | getSuggestions(options: IAutocompleteProviderOptions) { 61 | return search(options.replacementPrefix) 62 | .filter(r=> _.contains(r.name, options.replacementPrefix)) 63 | .map(makeSuggestion) 64 | .toArray() 65 | .toPromise(); 66 | }, 67 | fileMatchs: ['bower.json'], 68 | pathMatch(path) { return path === "dependencies" }, 69 | dispose() { } 70 | } 71 | 72 | var packageVersion: IAutocompleteProvider = { 73 | getSuggestions(options: IAutocompleteProviderOptions) { 74 | var name = options.path.split('/'); 75 | return searchPackage(options.replacementPrefix, name[name.length - 1]) 76 | .map(tag => ({ name: `^${tag}` })) 77 | .map(makeSuggestion) 78 | .toArray() 79 | .toPromise(); 80 | }, 81 | fileMatchs: ['bower.json'], 82 | pathMatch(path) { return _.startsWith(path, "dependencies/"); }, 83 | dispose() { } 84 | } 85 | 86 | var providers = [packageName, packageVersion]; 87 | export = providers; 88 | -------------------------------------------------------------------------------- /lib/providers/npm-provider.ts: -------------------------------------------------------------------------------- 1 | import * as _ from "lodash"; 2 | import {Observable} from "rx"; 3 | var fetch: (url: string) => Rx.IPromise = require('node-fetch'); 4 | var filter = require('fuzzaldrin').filter; 5 | 6 | interface IResult { 7 | json(): T; 8 | text(): string; 9 | } 10 | 11 | interface NpmResult { 12 | rows: { key: string; value: string; }[]; 13 | } 14 | 15 | interface NpmPackage { 16 | version: string; 17 | } 18 | 19 | //https://skimdb.npmjs.com/registry/_design/app/_view/browseAll?group_level=1 20 | function search(text) { 21 | return Observable.fromPromise( 22 | fetch(`https://skimdb.npmjs.com/registry/_design/app/_view/browseAll?group_level=1&limit=100&start_key=%5B%22${encodeURIComponent(text) }%22,%7B%7D%5D&end_key=%5B%22${encodeURIComponent(text) }z%22,%7B%7D%5D`) 23 | .then(res => res.json()) 24 | ) 25 | .flatMap(z => 26 | Observable.from(z.rows)); 27 | } 28 | 29 | //http://registry.npmjs.org/gulp/latest 30 | function searchPackage(text, name: string) { 31 | return Observable.fromPromise( 32 | fetch(`http://registry.npmjs.org/${name}/latest`) 33 | .then(res => res.json()) 34 | ); 35 | } 36 | 37 | function makeSuggestion(item: { key: string }) { 38 | var type = 'package'; 39 | 40 | return { 41 | _search: item.key, 42 | text: item.key, 43 | snippet: item.key, 44 | type: type, 45 | displayText: item.key, 46 | className: 'autocomplete-json-schema', 47 | } 48 | } 49 | 50 | var packageName: IAutocompleteProvider = { 51 | getSuggestions(options: IAutocompleteProviderOptions) { 52 | if (!options.replacementPrefix) return Promise.resolve([]); 53 | return search(options.replacementPrefix) 54 | .map(makeSuggestion) 55 | .toArray() 56 | .toPromise(); 57 | }, 58 | fileMatchs: ['package.json'], 59 | pathMatch(path) { 60 | return path === "dependencies" || path === "devDependencies"; 61 | }, 62 | dispose() { } 63 | //getSuggestions: _.throttle(getSuggestions, 0), 64 | //onDidInsertSuggestion, 65 | //dispose 66 | } 67 | 68 | var packageVersion: IAutocompleteProvider = { 69 | getSuggestions(options: IAutocompleteProviderOptions) { 70 | var name = options.path.split('/'); 71 | return searchPackage(options.replacementPrefix, name[name.length - 1]) 72 | .map(z => ({ key: `^${z.version}` })) 73 | .map(makeSuggestion) 74 | .toArray() 75 | .toPromise(); 76 | }, 77 | fileMatchs: ['package.json'], 78 | pathMatch(path) { 79 | return _.startsWith(path, "dependencies/") || _.startsWith(path, "devDependencies/"); 80 | }, 81 | dispose() { } 82 | //getSuggestions: _.throttle(getSuggestions, 0), 83 | //onDidInsertSuggestion, 84 | //dispose 85 | } 86 | 87 | var providers = [packageName, packageVersion]; 88 | export = providers; 89 | -------------------------------------------------------------------------------- /lib/schema-autocomplete.ts: -------------------------------------------------------------------------------- 1 | import _ = require('lodash') 2 | import {Subject, BehaviorSubject, Observable, CompositeDisposable} from 'rx'; 3 | import Promise = require('bluebird'); 4 | //var escape = require("escape-html"); 5 | var filter = require('fuzzaldrin').filter; 6 | import {getPath, getRanges, ITokenRange} from "./helpers/get-ranges"; 7 | import {schemaProvider, ISchemaInstance} from "./schema-provider"; 8 | 9 | interface RequestOptions { 10 | editor: Atom.TextEditor; 11 | bufferPosition: TextBuffer.Point; // the position of the cursor 12 | prefix: string; 13 | scopeDescriptor: { scopes: string[] }; 14 | activatedManually: boolean; 15 | } 16 | 17 | function fixSnippet(snippet: string, options: { hasTrailingQuote: boolean; hasLeadingQuote: boolean; }, type: string) { 18 | let t = _.trim(snippet); 19 | if (_.startsWith(t, '{') || _.startsWith(t, '"') || _.endsWith(t, '}') || _.endsWith(t, '"') || _.endsWith(t, ',')) 20 | return snippet; 21 | 22 | if (!options.hasLeadingQuote) 23 | snippet = '"' + snippet; 24 | if (!options.hasTrailingQuote && !_.endsWith(snippet, '.')) 25 | snippet = snippet + '"'; 26 | 27 | if (type === "string") { 28 | snippet = snippet += ': ""' 29 | } else if (type === "object") { 30 | snippet = snippet += ': {}' 31 | } else if (type === "array") { 32 | snippet = snippet += ': []' 33 | } 34 | 35 | return snippet; 36 | } 37 | 38 | function makeSuggestion(item: { key: string; description: string; type: string }, options: { replacementPrefix: string; hasTrailingQuote: boolean; hasLeadingQuote: boolean }) { 39 | var description = item.description, 40 | leftLabel = item.type.substr(0, 1), 41 | type = 'variable'; 42 | 43 | return { 44 | _search: item.key, 45 | text: item.key, 46 | snippet: fixSnippet(item.key, options, item.type), 47 | type: type, 48 | displayText: item.key, 49 | className: 'autocomplete-json-schema', 50 | description: description, 51 | //leftLabel: leftLabel, 52 | }; 53 | } 54 | 55 | function renderReturnType(returnType: string) { 56 | if (returnType === null) { 57 | return; 58 | } 59 | return `Returns: ${returnType}`; 60 | } 61 | 62 | function schemaGet(schema: ISchemaInstance, path: string) { 63 | // ignore .data 64 | var p = (path || '').split('/'); 65 | var rootSchema = schema; 66 | while (p.length) { 67 | let s = p.shift(); 68 | if (schema.properties && schema.properties[s]) { 69 | schema = schema.properties[s] 70 | } else if (schema.additionalProperties) { 71 | schema = schema.additionalProperties; 72 | } 73 | if (schema.$ref) { 74 | // This is the most common def case, may not always work 75 | var childPath = _.trim(schema.$ref, '/#').split('/').join('.'); 76 | schema = _.get(rootSchema, childPath); 77 | } 78 | } 79 | return schema; 80 | } 81 | 82 | function getSuggestions(options: RequestOptions): Rx.IPromise { 83 | /*var buffer = options.editor.getBuffer(); 84 | var end = options.bufferPosition.column; 85 | var data = buffer.getLines()[options.bufferPosition.row].substring(0, end + 1); 86 | var lastCharacterTyped = data[end - 1]; 87 | 88 | if (!/[A-Z_0-9.]+/i.test(lastCharacterTyped)) { 89 | return; 90 | }*/ 91 | var line = options.editor.getBuffer().getLines()[options.bufferPosition.row]; 92 | var hasLeadingQuote = false; 93 | for (var i = options.bufferPosition.column; i >= 0; i--) { 94 | let char = line[i]; 95 | if (char === ',' || char === '}' || char === ':') { 96 | break; 97 | } 98 | 99 | if (char === '"') { 100 | hasLeadingQuote = true; 101 | break; 102 | } 103 | } 104 | var hasTrailingQuote = false; 105 | for (var i = options.bufferPosition.column; i < line.length; i++) { 106 | let char = line[i]; 107 | if (char === ':' || char === '}' || char === ',' || char === '{') { 108 | break; 109 | } 110 | 111 | if (char === '"') { 112 | hasTrailingQuote = true; 113 | break; 114 | } 115 | } 116 | 117 | var prefix = options.prefix; 118 | try { 119 | let cursor = options.editor.getLastCursor(); 120 | let editor = options.editor; 121 | prefix = editor.getTextInBufferRange(cursor.getCurrentWordBufferRange({ wordRegex: /^[\t ]*$|[^\s\/\\\(\)"':,\;<>~!@#\$%\^&\*\|\+=\[\]\{\}`\?]+|[\/\\\(\)"':,\;<>~!@#\$%\^&\*\|\+=\[\]\{\}`\?]+/ })); 122 | } catch (e) { } 123 | 124 | prefix = _.trim(prefix, ':{}," '); 125 | 126 | var context = getPath(options.editor, (line, column) => 127 | options.bufferPosition.row === line && options.bufferPosition.column === column + 1); 128 | 129 | var {ranges, objectPaths} = getRanges(options.editor); 130 | var existingKeys = _(ranges).keys() 131 | .filter(z => _.startsWith(z + '/', context.path)) 132 | .filter(z => z && z.indexOf('/') === -1) 133 | .value(); 134 | 135 | var p = schemaProvider 136 | .getSchemaForEditor(options.editor) 137 | .flatMap(schema => schema.content) 138 | .map(schema => { 139 | // ignore .data 140 | var p = (context.path || '').split('/'); 141 | var rootSchema = schema; 142 | 143 | var parentSchema; 144 | while (p.length) { 145 | let lastSchema = schema; 146 | let s = p.shift(); 147 | if (schema.properties && schema.properties[s]) { 148 | schema = schema.properties[s] 149 | } else if (schema.additionalProperties) { 150 | schema = schema.additionalProperties; 151 | } else if (schema !== rootSchema) { 152 | schema = {}; 153 | } 154 | if (schema.$ref) { 155 | // This is the most common def case, may not always work 156 | var childPath = _.trim(schema.$ref, '/#').split('/').join('.'); 157 | schema = _.get(rootSchema, childPath); 158 | } 159 | } 160 | 161 | var inferedType = ""; 162 | if (typeof schema.type === "string" && schema.type === "object") { 163 | inferedType = "object"; 164 | } 165 | 166 | var objectPath = _.find(objectPaths, (value, key) => key === context.path); 167 | if (objectPath && _.isArray(schema.type) && _.contains(schema.type, "object") && (options.bufferPosition.row == objectPath.line && options.bufferPosition.column + 1 > objectPath.column || options.bufferPosition.row > objectPath.line)) { 168 | inferedType = "object"; 169 | } 170 | 171 | if (schema.enum && schema.enum.length) { 172 | return schema.enum.map(property => ({ key: property, type: 'enum', description: '' })); 173 | } 174 | 175 | if (inferedType === "object" && schema.properties && _.any(schema.properties)) { 176 | return _.keys(schema.properties) 177 | .filter(z => !_.contains(existingKeys, z)) 178 | .map(property => { 179 | var propertySchema = schema.properties[property]; 180 | return { key: property, type: typeof propertySchema.type === "string" ? propertySchema.type : 'property', description: propertySchema.description } 181 | }); 182 | } 183 | 184 | var types: string[] = []; 185 | if (typeof schema.type === "string") { 186 | types = [schema.type]; 187 | } else if (_.isArray(types)) { 188 | types = schema.type || []; 189 | } 190 | 191 | if (types.length > 1) { 192 | return _.map(types, type => { 193 | if (type === "string") { 194 | return { key: '""', type: "value", description: '' }; 195 | } else if (type === "object") { 196 | var res = {}; 197 | _.each(schema.properties, (value, key) => { 198 | if (value.type === "string") 199 | res[key] = value.default || ''; 200 | }); 201 | return { key: JSON.stringify(res, null, options.editor.getTabLength()), type: "value", description: '' }; 202 | } 203 | }); 204 | } 205 | 206 | return []; 207 | }) 208 | .defaultIfEmpty([]) 209 | .toPromise(); 210 | 211 | var search = prefix; 212 | if (search === ".") 213 | search = ""; 214 | 215 | //options.prefix = prefix; 216 | 217 | if (search) 218 | p = p.then(s => 219 | filter(s, search, { key: 'key' })); 220 | 221 | var baseSuggestions = p.then(response => response.map(s => makeSuggestion(s, { replacementPrefix: prefix, hasLeadingQuote, hasTrailingQuote }))); 222 | 223 | if (providers.length) { 224 | var workingOptions = _.defaults({ prefix, replacementPrefix: prefix }, context, options); 225 | var workingProviders = _.filter(providers, z => 226 | _.contains(z.fileMatchs, options.editor.getBuffer().getBaseName()) && z.pathMatch(context.path)) 227 | .map(z => z.getSuggestions(workingOptions).then(suggestions => 228 | _.each(suggestions, s => s.snippet = fixSnippet(s.snippet, { hasLeadingQuote, hasTrailingQuote }, 'other')))); 229 | if (workingProviders.length) { 230 | return Promise.all(workingProviders.concat([baseSuggestions])) 231 | .then(items => 232 | _.flatten(items)); 233 | } 234 | } 235 | return baseSuggestions; 236 | } 237 | 238 | var providers: IAutocompleteProvider[] = [].concat(require('./providers/npm-provider')).concat(require('./providers/bower-provider')); 239 | 240 | export var CompletionProvider = { 241 | selector: '.source.json', 242 | inclusionPriority: 2, 243 | excludeLowerPriority: false, 244 | getSuggestions, 245 | registerProvider: (provider) => { 246 | providers.push(provider); 247 | }, 248 | onDidInsertSuggestion({editor, suggestion}: { editor: Atom.TextEditor; triggerPosition: any; suggestion: { text: string } }) { 249 | if (_.endsWith(suggestion.text, '.')) { 250 | _.defer(() => atom.commands.dispatch(atom.views.getView(editor), "autocomplete-plus:activate")) 251 | } 252 | }, 253 | dispose() { } 254 | } 255 | -------------------------------------------------------------------------------- /lib/schema-linter.ts: -------------------------------------------------------------------------------- 1 | var validator: (schema) => validatorResult; 2 | (function(){ 3 | var loophole = require("loophole"); 4 | function allowUnsafe(fn) { 5 | return loophole.allowUnsafeEval(function () { return loophole.allowUnsafeNewFunction(function () { return fn(); }); }); 6 | } 7 | 8 | allowUnsafe(() => validator = require('is-my-json-valid')); 9 | })(); 10 | 11 | var Range = require('atom').Range; 12 | import _ = require('lodash'); 13 | import {omni} from "./omni"; 14 | import {Observable, CompositeDisposable} from "rx"; 15 | import {schemaProvider} from "./schema-provider"; 16 | import {getRanges, ITokenRange} from "./helpers/get-ranges"; 17 | 18 | interface LinterError { 19 | type: string; // 'error' | 'warning' 20 | text?: string; 21 | html?: string; 22 | filePath?: string; 23 | range?: Range; 24 | line?: number; 25 | col?: number; 26 | } 27 | 28 | interface validatorResult { 29 | (data: any, options: any): void; 30 | errors: validatorError[]; 31 | } 32 | 33 | interface validatorError { 34 | field: string; 35 | message: string; 36 | value: any; 37 | } 38 | 39 | function getWordAt(str: string, pos: number) { 40 | var wordLocation = { 41 | start: pos, 42 | end: pos 43 | } 44 | 45 | if (str === undefined) { 46 | return wordLocation; 47 | } 48 | 49 | while (pos < str.length && /\W/.test(str[pos])) { 50 | ++pos; 51 | } 52 | 53 | var left = str.slice(0, pos + 1).search(/\W(?!.*\W)/); 54 | var right = str.slice(pos).search(/(\W|$)/); 55 | 56 | wordLocation.start = left + 1; 57 | wordLocation.end = wordLocation.start + right; 58 | 59 | return wordLocation; 60 | } 61 | 62 | function mapValues(editor: Atom.TextEditor, ranges: { [key: string]: ITokenRange }, error: validatorError): LinterError { 63 | var range = ranges[error.field.replace('data.', '')]; 64 | if (!range) { 65 | // TODO: Should try and figure out some of these failures 66 | return null; 67 | } 68 | var line = range.section.start[0]; 69 | var column = range.section.start[1]; 70 | var text = editor.lineTextForBufferRow(line); 71 | var level = 'error'; 72 | 73 | return { 74 | type: level, 75 | text: `${error.field} - ${error.message}`, 76 | filePath: editor.getPath(), 77 | line: line + 1, 78 | col: column + 1, 79 | range: new Range(range.value.start, range.value.end) 80 | }; 81 | } 82 | 83 | 84 | var makeValidator = _.memoize(schema => { 85 | if (_.isEmpty(schema)) 86 | return null; 87 | return validator(schema); 88 | }); 89 | 90 | export var provider = [ 91 | { 92 | grammarScopes: ['source.json'], 93 | scope: 'file', 94 | lintOnFly: true, 95 | lint: (editor: Atom.TextEditor) => 96 | schemaProvider 97 | .getSchemaForEditor(editor) 98 | .flatMap(schema => schema.content) 99 | .map(schema => makeValidator(schema)) 100 | .map(validate => { 101 | var {ranges} = getRanges(editor); 102 | try { 103 | var text = editor.getText().replace(/\n/g, '').replace(/\r/g, '').replace(/\t/g, '').trim(); 104 | var data = JSON.parse(text); 105 | } catch (e) { 106 | // TODO: Should return a validation error that json is invalid? 107 | return []; 108 | } 109 | 110 | var result = validate(data, { greedy: true }); 111 | if (validate.errors && validate.errors.length) { 112 | return validate.errors.map(error => mapValues(editor, ranges, error)).filter(z => !!z); 113 | } 114 | 115 | return []; 116 | }) 117 | .defaultIfEmpty([]) 118 | .toPromise() 119 | } 120 | ]; 121 | -------------------------------------------------------------------------------- /lib/schema-provider.ts: -------------------------------------------------------------------------------- 1 | import * as _ from "lodash"; 2 | var fetch: (url: string) => Rx.IPromise = require('node-fetch'); 3 | import {Observable} from "rx"; 4 | 5 | interface IResult { 6 | json(): T; 7 | text(): string; 8 | } 9 | 10 | interface SchemaCatalog { 11 | schemas: ISchemaHeader[]; 12 | } 13 | 14 | interface ISchemaHeader { 15 | name: string; 16 | description: string; 17 | fileMatch?: string[]; 18 | url: string; 19 | } 20 | 21 | export interface ISchema { 22 | name: string; 23 | description: string; 24 | fileMatch?: string[]; 25 | url: string; 26 | content: Rx.Observable; 27 | } 28 | 29 | export interface ISchemaInstance { 30 | $ref: string; 31 | enum: string[]; 32 | properties: { [key: string]: ISchemaInstance }; 33 | default: string; 34 | additionalProperties: ISchemaInstance; 35 | definitions: { [key: string]: ISchemaInstance }; 36 | description: string; 37 | type: string | string[]; 38 | } 39 | 40 | class Schema implements ISchema { 41 | public name: string; 42 | public description: string; 43 | public fileMatch: string[]; 44 | public url: string; 45 | 46 | constructor(header: ISchemaHeader) { 47 | this.name = header.name; 48 | this.description = header.description; 49 | this.fileMatch = header.fileMatch || []; 50 | this.url = header.url; 51 | } 52 | 53 | private _content: Rx.Observable; 54 | public get content() { 55 | if (!this._content) 56 | this._content = Observable.fromPromise(fetch(this.url).then(res => res.json())).shareReplay(1); 57 | return this._content; 58 | } 59 | } 60 | 61 | class SchemaProvider { 62 | private _schemas = new Map(); 63 | private _schemasObservable: Rx.Observable; 64 | 65 | public constructor() { 66 | this._schemas.set('JSON', { 67 | name: 'none', 68 | description: 'none', 69 | fileMatch: [], 70 | url: 'none', 71 | content: Observable.just({}) 72 | }); 73 | } 74 | 75 | public get schemas() { 76 | if (!this._schemasObservable) { 77 | this._schemasObservable = this.getSchemas().shareReplay(1); 78 | } 79 | return this._schemasObservable; 80 | } 81 | 82 | private getSchemas() { 83 | //http://schemastore.org/api/json/catalog.json 84 | return Observable.fromPromise(fetch('http://schemastore.org/api/json/catalog.json') 85 | .then(res => res.json())) 86 | .map(({ schemas }) => { 87 | _.each(schemas, schema => { 88 | this.addSchema(schema); 89 | }); 90 | 91 | var iterator = this._schemas.values(); 92 | var result = iterator.next(); 93 | var items: ISchema[] = []; 94 | while (!result.done) { 95 | items.push(result.value); 96 | result = iterator.next(); 97 | } 98 | return items; 99 | }); 100 | } 101 | 102 | private addSchema(header: ISchemaHeader) { 103 | this._schemas.set(header.name, new Schema(header)); 104 | } 105 | 106 | public getSchemaForEditor(editor: Atom.TextEditor) { 107 | if (!editor) return Observable.just({ content: {} }); 108 | 109 | if (_.has(editor, '__json__schema__')) { 110 | if (editor['__json__schema__']) { 111 | return Observable.just(editor['__json__schema__']); 112 | } else { 113 | return Observable.empty(); 114 | } 115 | } 116 | 117 | var fileName = editor.getBuffer().getBaseName(); 118 | return this.schemas 119 | .flatMap(schemas => Observable.from(schemas)) 120 | .firstOrDefault(schema => _.any(schema.fileMatch, match => fileName === match), null) 121 | .tapOnNext(schema => editor['__json__schema__'] = schema) 122 | .where(z => !!z); 123 | } 124 | } 125 | 126 | export var schemaProvider = new SchemaProvider(); 127 | -------------------------------------------------------------------------------- /lib/schema-selector-view.ts: -------------------------------------------------------------------------------- 1 | import {SelectListView, $$} from 'atom-space-pen-views'; 2 | 3 | import {CompositeDisposable, Disposable, Scheduler, Observable} from "rx"; 4 | import _ = require('lodash'); 5 | import React = require('react'); 6 | import {omni} from "./omni"; 7 | import {schemaProvider, ISchema} from "./schema-provider"; 8 | import $ = require('jquery'); 9 | 10 | interface SelectorState { 11 | schemas?: ISchema[]; 12 | activeSchema: ISchema; 13 | alignLeft?: boolean; 14 | } 15 | 16 | export class SelectorComponent extends React.Component<{ alignLeft: boolean }, SelectorState> { 17 | private disposable = new CompositeDisposable(); 18 | 19 | constructor(props?: { alignLeft: boolean }, context?: any) { 20 | super(props, context); 21 | this.state = { schemas: [], activeSchema: {} }; 22 | } 23 | 24 | public componentWillMount() { 25 | this.disposable = new CompositeDisposable(); 26 | } 27 | 28 | public componentDidMount() { 29 | this.disposable.add(schemaProvider.schemas.subscribe(s => this.setState({ schemas: s, activeSchema: s[0] }))); 30 | } 31 | 32 | public componentWillUnmount() { 33 | this.disposable.dispose(); 34 | } 35 | 36 | public render() { 37 | return React.DOM.a({ 38 | href: '#', 39 | onClick: (e) => { 40 | if (e.target !== e.currentTarget) return; 41 | var view = new FrameworkSelectorSelectListView(atom.workspace.getActiveTextEditor(), { 42 | attachTo: '.schema-selector', 43 | alignLeft: this.props.alignLeft, 44 | items: this.state.schemas, 45 | save: (framework: any) => { 46 | omni.activeSchema = framework; 47 | view.hide(); 48 | } 49 | }); 50 | view.appendTo(atom.views.getView(atom.workspace)); 51 | view.setItems(); 52 | view.show(); 53 | }, 54 | }, this.state.activeSchema.name); 55 | } 56 | } 57 | 58 | class FrameworkSelectorSelectListView extends SelectListView { 59 | private panel: Atom.Panel; 60 | 61 | constructor(public editor: Atom.TextEditor, private options: { alignLeft: boolean; attachTo: string; items: any[]; save(item: any): void }) { 62 | super(); 63 | this.$.addClass('code-actions-overlay'); 64 | (this).filterEditorView.model.placeholderText = 'Filter list'; 65 | } 66 | 67 | get $(): JQuery { 68 | return this; 69 | } 70 | 71 | public setItems() { 72 | SelectListView.prototype.setItems.call(this, this.options.items) 73 | } 74 | 75 | public confirmed(item) { 76 | this.cancel(); //will close the view 77 | 78 | this.options.save(item); 79 | return null; 80 | } 81 | 82 | show() { 83 | this.storeFocusedElement(); 84 | setTimeout(() => this.focusFilterEditor(), 100); 85 | var width = 320; 86 | var node = this[0]; 87 | var attachTo = $(document.querySelectorAll(this.options.attachTo)); 88 | var offset = attachTo.offset(); 89 | if (offset) { 90 | if (this.options.alignLeft) { 91 | $(node).css({ 92 | position: 'fixed', 93 | top: offset.top - node.clientHeight - 18, 94 | left: offset.left, 95 | width: width 96 | }); 97 | } else { 98 | $(node).css({ 99 | position: 'fixed', 100 | top: offset.top - node.clientHeight - 18, 101 | left: offset.left - width + attachTo[0].clientWidth, 102 | width: width 103 | }); 104 | } 105 | } 106 | } 107 | 108 | hide() { 109 | this.restoreFocus(); 110 | this.remove(); 111 | } 112 | 113 | cancelled() { 114 | this.hide(); 115 | } 116 | 117 | public getFilterKey() { return 'Name'; } 118 | 119 | public viewForItem(item: ISchema) { 120 | if (!item) { 121 | 122 | } 123 | return $$(function() { 124 | return this.li({ 125 | "class": 'event', 126 | 'data-event-name': item.name 127 | }, () => { 128 | return this.span(_.trunc(`${item.name} - ${item.description}`, 50), { 129 | title: `${item.name} - ${item.description}` 130 | }); 131 | }); 132 | }); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/schema-selector.ts: -------------------------------------------------------------------------------- 1 | import {CompositeDisposable, Observable, Disposable} from "rx"; 2 | import {SelectorComponent} from './schema-selector-view'; 3 | import React = require('react'); 4 | import {omni} from "./omni"; 5 | import {schemaProvider, ISchema} from "./schema-provider"; 6 | import {isEmpty} from "lodash"; 7 | 8 | class SchemaSelector { 9 | private disposable: Rx.CompositeDisposable; 10 | private view: HTMLSpanElement; 11 | private tile: any; 12 | private statusBar: any; 13 | private _active = false; 14 | private _component: SelectorComponent; 15 | 16 | public activate() { 17 | this.disposable = new CompositeDisposable(); 18 | } 19 | 20 | public setup(statusBar) { 21 | this.statusBar = statusBar; 22 | 23 | if (this._active) { 24 | this._attach(); 25 | } 26 | } 27 | 28 | public attach() { 29 | if (this.statusBar) { this._attach(); } 30 | this._active = true; 31 | } 32 | 33 | private _attach() { 34 | this.view = document.createElement("span"); 35 | this.view.classList.add('inline-block'); 36 | this.view.classList.add('schema-selector'); 37 | this.view.style.display = 'none'; 38 | var alignLeft = !atom.config.get('grammar-selector.showOnRightSideOfStatusBar'); 39 | if (!alignLeft) { 40 | var tile = this.statusBar.addRightTile({ 41 | item: this.view, 42 | priority: 9 43 | }); 44 | } else { 45 | var tile = this.statusBar.addLeftTile({ 46 | item: this.view, 47 | priority: 11 48 | }); 49 | } 50 | 51 | this._component = React.render(React.createElement(SelectorComponent, { alignLeft: alignLeft }), this.view); 52 | 53 | this.disposable.add(Disposable.create(() => { 54 | React.unmountComponentAtNode(this.view); 55 | tile.destroy(); 56 | this.view.remove(); 57 | })); 58 | 59 | this.disposable.add(omni.activeEditor 60 | .where(z => !z) 61 | .subscribe(() => this.view.style.display = 'none')); 62 | this.disposable.add(omni.activeEditor 63 | .where(z => !!z) 64 | .subscribe(() => this.view.style.display = '')); 65 | 66 | this.disposable.add(omni.activeEditor 67 | .flatMapLatest(editor => schemaProvider.getSchemaForEditor(editor)) 68 | .defaultIfEmpty({}) 69 | .subscribe(activeSchema => { 70 | omni.activeSchema = activeSchema; 71 | this._component.setState({ activeSchema }); 72 | })); 73 | } 74 | 75 | public dispose() { 76 | this.disposable.dispose(); 77 | } 78 | 79 | public setActiveSchema(activeSchema: ISchema) { 80 | omni.activeSchema = activeSchema; 81 | this._component.setState({ activeSchema }); 82 | } 83 | } 84 | 85 | export var schemaSelector = new SchemaSelector; 86 | -------------------------------------------------------------------------------- /menus/json-schema.cson: -------------------------------------------------------------------------------- 1 | # See https://atom.io/docs/latest/hacking-atom-package-word-count#menus for more details 2 | 'menu': [ 3 | { 4 | 'label': 'Packages' 5 | 'submenu': [ 6 | 'label': 'json-schema' 7 | # 'submenu': [ 8 | # { 9 | # 'label': 'Toggle' 10 | # 'command': 'yo:yeoman' 11 | # } 12 | # ] 13 | ] 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "json-schema", 3 | "main": "./lib/json-schema", 4 | "version": "0.1.15", 5 | "description": "Json Schema enhancements for Atom", 6 | "repository": "https://github.com/OmniSharp/atom-json-schema", 7 | "license": "MIT", 8 | "engines": { 9 | "atom": ">=0.174.0 <2.0.0" 10 | }, 11 | "scripts": { 12 | "postinstall": "./node_modules/.bin/gulp npm-postinstall", 13 | "prepublish": "./node_modules/.bin/gulp npm-prepublish" 14 | }, 15 | "dependencies": { 16 | "atom-space-pen-views": "^2.0.5", 17 | "bluebird": "^2.9.27", 18 | "del": "^1.2.0", 19 | "fuzzaldrin": "^2.1.0", 20 | "gulp": "^3.9.0", 21 | "gulp-util": "^3.0.5", 22 | "is-my-json-valid": "^2.12.0", 23 | "jquery": "^2.1.4", 24 | "lodash": "^3.10.0", 25 | "loopback": "^2.22.2", 26 | "loopback-datasource-juggler": "^2.40.1", 27 | "loophole": "^1.1.0", 28 | "merge-stream": "^0.1.8", 29 | "node-fetch": "^1.3.1", 30 | "react": "^0.13.3", 31 | "rx": "^2.5.3", 32 | "semver": "^5.0.0", 33 | "through2": "^2.0.0", 34 | "tsd": "~0.6.1", 35 | "typescript": "^1.5.0-beta" 36 | }, 37 | "consumedServices": { 38 | "status-bar": { 39 | "versions": { 40 | "^1.0.0": "consumeStatusBar" 41 | } 42 | }, 43 | "jsonschema.provider": { 44 | "versions": { 45 | "0.1.0": "consumeProvider" 46 | } 47 | } 48 | }, 49 | "providedServices": { 50 | "autocomplete.provider": { 51 | "description": "Json Schema based auto completions.", 52 | "versions": { 53 | "2.0.0": "provideAutocomplete" 54 | } 55 | }, 56 | "linter": { 57 | "versions": { 58 | "1.0.0": "provideLinter" 59 | } 60 | } 61 | }, 62 | "package-dependencies": { 63 | "linter": ">=1.0.0" 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /schema.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmniSharp/atom-json-schema/8a6a6b5da3f342922068e369527facf9b809e339/schema.gif -------------------------------------------------------------------------------- /schema2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OmniSharp/atom-json-schema/8a6a6b5da3f342922068e369527facf9b809e339/schema2.gif -------------------------------------------------------------------------------- /styles/json-schema.less: -------------------------------------------------------------------------------- 1 | // The ui-variables file is provided by base themes provided by Atom. 2 | // 3 | // See https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less 4 | // for a full listing of what's available. 5 | @import "ui-variables"; 6 | 7 | .json-schema { 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.4.1", 3 | "compilerOptions": { 4 | "target": "es5", 5 | "module": "commonjs", 6 | "declaration": false, 7 | "noImplicitAny": false, 8 | "removeComments": true, 9 | "noLib": false 10 | }, 11 | "formatCodeOptions": { 12 | "indentSize": 4, 13 | "tabSize": 4, 14 | "newLineCharacter": "\r\n", 15 | "convertTabsToSpaces": true, 16 | "insertSpaceAfterCommaDelimiter": true, 17 | "insertSpaceAfterSemicolonInForStatements": true, 18 | "insertSpaceBeforeAndAfterBinaryOperators": true, 19 | "insertSpaceAfterKeywordsInControlFlowStatements": true, 20 | "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, 21 | "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, 22 | "placeOpenBraceOnNewLineForFunctions": false, 23 | "placeOpenBraceOnNewLineForControlBlocks": false 24 | }, 25 | "compileOnSave": true, 26 | "filesGlob": [ 27 | "./**/*.ts", 28 | "!./typings/**/*.d.ts", 29 | "!./typingsTemp/**/*.d.ts", 30 | "!./node_modules/**/*.ts" 31 | ], 32 | "files": [ 33 | "./es6.d.ts", 34 | "./lib/helpers/get-ranges.ts", 35 | "./lib/json-schema.ts", 36 | "./lib/omni.ts", 37 | "./lib/providers/bower-provider.ts", 38 | "./lib/providers/npm-provider.ts", 39 | "./lib/schema-autocomplete.ts", 40 | "./lib/schema-linter.ts", 41 | "./lib/schema-provider.ts", 42 | "./lib/schema-selector-view.ts", 43 | "./lib/schema-selector.ts", 44 | "./tsd.d.ts" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /tsd.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | 24 | interface IAutocompleteProviderOptions { 25 | editor: Atom.TextEditor; 26 | bufferPosition: TextBuffer.Point; // the position of the cursor 27 | prefix: string; 28 | scopeDescriptor: { scopes: string[] }; 29 | activatedManually: boolean; 30 | path: string; 31 | replacementPrefix: string; 32 | } 33 | 34 | interface IAutocompleteProvider { 35 | fileMatchs: string[]; 36 | pathMatch: (path: string) => boolean; 37 | getSuggestions: (options: IAutocompleteProviderOptions) => Rx.IPromise; 38 | dispose(): void; 39 | } 40 | 41 | 42 | interface Suggestion { 43 | //Either text or snippet is required 44 | text?: string; 45 | snippet?: string; 46 | displayText?: string; 47 | replacementPrefix?: string; 48 | type: string; 49 | leftLabel?: string; 50 | leftLabelHTML?: string; 51 | rightLabel?: string; 52 | rightLabelHTML?: string; 53 | iconHTML?: string; 54 | description?: string; 55 | descriptionMoreURL?: string; 56 | className?: string; 57 | } 58 | -------------------------------------------------------------------------------- /tsd.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v4", 3 | "repo": "borisyankov/DefinitelyTyped", 4 | "ref": "master", 5 | "path": "typings", 6 | "bundle": "tsd.d.ts", 7 | "installed": { 8 | "q/Q.d.ts": { 9 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 10 | }, 11 | "jquery/jquery.d.ts": { 12 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 13 | }, 14 | "bluebird/bluebird.d.ts": { 15 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 16 | }, 17 | "lodash/lodash.d.ts": { 18 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 19 | }, 20 | "node/node.d.ts": { 21 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 22 | }, 23 | "mixto/mixto.d.ts": { 24 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 25 | }, 26 | "semver/semver.d.ts": { 27 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 28 | }, 29 | "jasmine/jasmine.d.ts": { 30 | "commit": "f999dcd9543265848a33fa3bb8379bf0393d33c8" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /typingsTemp/atom-keymap/atom-keymap.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for atom-keymap (v5.1.0) 2 | // Project: https://github.com/atom/atom-keymap 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | /// 10 | declare module AtomKeymap { 11 | /** 12 | * This custom subclass of CustomEvent exists to provide the ::abortKeyBinding 13 | * method, as well as versions of the ::stopPropagation methods that record the 14 | * intent to stop propagation so event bubbling can be properly simulated for 15 | * detached elements. 16 | */ 17 | class CommandEvent /*extends CustomEvent*/ { 18 | /** 19 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 20 | */ 21 | keyBindingAborted: any /* default */; 22 | 23 | /** 24 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 25 | */ 26 | propagationStopped: any /* default */; 27 | 28 | /** 29 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 30 | */ 31 | abortKeyBinding() : KeyBinding; 32 | 33 | /** 34 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 35 | */ 36 | stopPropagation() : any; 37 | 38 | /** 39 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 40 | */ 41 | stopImmediatePropagation() : any; 42 | 43 | } 44 | 45 | /** 46 | * KeyBinding 47 | * This class was not documented by atomdoc, assume it is private. Use with caution. 48 | */ 49 | class KeyBinding { 50 | /** 51 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 52 | */ 53 | static currentIndex: any /* default */; 54 | 55 | /** 56 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 57 | */ 58 | source: any /* default */; 59 | 60 | /** 61 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 62 | */ 63 | command: string; 64 | 65 | /** 66 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 67 | */ 68 | keystrokes: any /* default */; 69 | 70 | /** 71 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 72 | */ 73 | enabled: any /* default */; 74 | 75 | /** 76 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 77 | */ 78 | constructor(source? : any, command? : string, keystrokes? : any, selector? : string); 79 | 80 | /** 81 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 82 | */ 83 | matches(keystroke? : any) : any; 84 | 85 | /** 86 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 87 | */ 88 | compare(keyBinding? : KeyBinding) : any; 89 | 90 | } 91 | 92 | /** 93 | * Allows commands to be associated with keystrokes in a 94 | * context-sensitive way. In Atom, you can access a global instance of this 95 | * object via `atom.keymap`. 96 | */ 97 | export class KeymapManager { 98 | /** 99 | * Create a keydown DOM event for testing purposes. 100 | * @param key? - The key or keyIdentifier of the event. For example, `'a'`, `'1'`, `'escape'`, `'backspace'`, etc. 101 | * @param options? - An {Object} containing any of the following: 102 | */ 103 | static buildKeydownEvent(key? : any, options? : Object) : any; 104 | 105 | /** 106 | * Properties 107 | * This field or method was marked private by atomdoc. Use with caution. 108 | */ 109 | partialMatchTimeout: any /* default */; 110 | 111 | /** 112 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 113 | */ 114 | defaultTarget: any /* default */; 115 | 116 | /** 117 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 118 | */ 119 | pendingPartialMatches: any /* default */; 120 | 121 | /** 122 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 123 | */ 124 | pendingStateTimeoutHandle: any /* default */; 125 | 126 | /** 127 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 128 | */ 129 | dvorakQwertyWorkaroundEnabled: any /* default */; 130 | 131 | /** 132 | * Create a new KeymapManager. 133 | * @param options? - An {Object} containing properties to assign to the keymap. You can pass custom properties to be used by extension methods. The following properties are also supported: 134 | */ 135 | constructor(options? : Object); 136 | 137 | /** 138 | * Unwatch all watched paths. 139 | */ 140 | destroy() : void; 141 | 142 | /** 143 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 144 | */ 145 | enableDvorakQwertyWorkaroundIfNeeded() : any; 146 | 147 | /** 148 | * Invoke the given callback when one or more keystrokes completely 149 | * match a key binding. 150 | * @param callback - {Function} to be called when keystrokes match a binding. 151 | */ 152 | onDidMatchBinding(callback : Function /* needs to be defined */) : EventKit.Disposable; 153 | 154 | /** 155 | * Invoke the given callback when one or more keystrokes partially 156 | * match a binding. 157 | * @param callback - {Function} to be called when keystrokes partially match a binding. 158 | */ 159 | onDidPartiallyMatchBindings(callback : Function /* needs to be defined */) : EventKit.Disposable; 160 | 161 | /** 162 | * Invoke the given callback when one or more keystrokes fail to match 163 | * any bindings. 164 | * @param callback - {Function} to be called when keystrokes fail to match any bindings. 165 | */ 166 | onDidFailToMatchBinding(callback : Function /* needs to be defined */) : EventKit.Disposable; 167 | 168 | /** 169 | * Invoke the given callback when a keymap file is reloaded. 170 | * This field or method was marked private by atomdoc. Use with caution. 171 | * @param callback - {Function} to be called when a keymap file is reloaded. 172 | */ 173 | onDidReloadKeymap(callback : Function /* needs to be defined */) : EventKit.Disposable; 174 | 175 | /** 176 | * Invoke the given callback when a keymap file is unloaded. 177 | * This field or method was marked private by atomdoc. Use with caution. 178 | * @param callback - {Function} to be called when a keymap file is unloaded. 179 | */ 180 | onDidUnloadKeymap(callback : Function /* needs to be defined */) : EventKit.Disposable; 181 | 182 | /** 183 | * Invoke the given callback when a keymap file not able to be loaded. 184 | * @param callback - {Function} to be called when a keymap file is unloaded. 185 | */ 186 | onDidFailToReadFile(callback : Function /* needs to be defined */) : EventKit.Disposable; 187 | 188 | /** 189 | * Add sets of key bindings grouped by CSS selector. 190 | * @param source? - A {String} (usually a path) uniquely identifying the given bindings so they can be removed later. 191 | */ 192 | add(source? : string, keyBindingsBySelector? : ScopedPropertyStore.Selector) : void; 193 | 194 | /** 195 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 196 | */ 197 | removeBindingsFromSource(source? : any) : void; 198 | 199 | /** 200 | * Get all current key bindings. 201 | */ 202 | getKeyBindings() : KeyBinding[]; 203 | 204 | /** 205 | * Get the key bindings for a given command and optional target. 206 | * @param params? - An {Object} whose keys constrain the binding search: 207 | */ 208 | findKeyBindings(params? : Object) : KeyBinding[]; 209 | 210 | /** 211 | * Load the key bindings from the given path. 212 | * @param options? - An {Object} containing the following optional keys: 213 | */ 214 | loadKeymap(bindingsPath? : string, options? : Object) : any; 215 | 216 | /** 217 | * Cause the keymap to reload the key bindings file at the given path 218 | * whenever it changes. 219 | * 220 | * This method doesn't perform the initial load of the key bindings file. If 221 | * that's what you're looking for, call {::loadKeymap} with `watch: true`. 222 | */ 223 | watchKeymap(filePath? : string) : any; 224 | 225 | /** 226 | * Called by the path watcher callback to reload a file at the given path. If 227 | * we can't read the file cleanly, we don't proceed with the reload. 228 | * This field or method was marked private by atomdoc. Use with caution. 229 | */ 230 | reloadKeymap(filePath? : string) : void; 231 | 232 | /** 233 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 234 | */ 235 | readKeymap(filePath? : string, suppressErrors? : any) : any; 236 | 237 | /** 238 | * Determine if the given path should be loaded on this platform. If the 239 | * filename has the pattern '.cson' or 'foo..cson' and 240 | * 241 | * does not match the current platform, returns false. Otherwise 242 | * returns true. 243 | * This field or method was marked private by atomdoc. Use with caution. 244 | */ 245 | filePathMatchesPlatform(filePath? : string) : string; 246 | 247 | /** 248 | * Dispatch a custom event associated with the matching key binding for 249 | * the given `KeyboardEvent` if one can be found. 250 | * 251 | * If a matching binding is found on the event's target or one of its 252 | * ancestors, `.preventDefault()` is called on the keyboard event and the 253 | * binding's command is emitted as a custom event on the matching element. 254 | * 255 | * If the matching binding's command is 'native!', the method will terminate 256 | * without calling `.preventDefault()` on the keyboard event, allowing the 257 | * browser to handle it as normal. 258 | * 259 | * If the matching binding's command is 'unset!', the search will continue from 260 | * the current element's parent. 261 | * 262 | * If the matching binding's command is 'abort!', the search will terminate 263 | * without dispatching a command event. 264 | * 265 | * If the event's target is `document.body`, it will be treated as if its 266 | * target is `.defaultTarget` if that property is assigned on the keymap. 267 | * @param event? - A `KeyboardEvent` of type 'keydown' 268 | */ 269 | handleKeyboardEvent(event? : any, replaying? : any) : void; 270 | 271 | /** 272 | * Translate a keydown event to a keystroke string. 273 | * @param event? - A `KeyboardEvent` of type 'keydown' 274 | * Returns a {String} describing the keystroke. 275 | */ 276 | keystrokeForKeyboardEvent(event? : any) : string; 277 | 278 | /** 279 | * Get the number of milliseconds allowed before pending states caused 280 | * by partial matches of multi-keystroke bindings are terminated. 281 | * Returns a {Number} 282 | */ 283 | getPartialMatchTimeout() : number; 284 | 285 | /** 286 | * For testing purposes 287 | * This field or method was marked private by atomdoc. Use with caution. 288 | */ 289 | getOtherPlatforms() : any; 290 | 291 | /** 292 | * 293 | * This field or method was marked private by atomdoc. Use with caution. 294 | * Private: Finds all key bindings whose keystrokes match the given keystrokes. 295 | * Returns 296 | * both partial and exact matches. 297 | */ 298 | findMatchCandidates(keystrokes? : any) : any; 299 | 300 | /** 301 | * Determine which of the given bindings have selectors matching the target or 302 | * one of its ancestors. This is used by {::handleKeyboardEvent} to determine 303 | * if there are any partial matches for the keyboard event. 304 | * This field or method was marked private by atomdoc. Use with caution. 305 | */ 306 | findPartialMatches(partialMatchCandidates? : any, target? : any) : any; 307 | 308 | /** 309 | * Find the matching bindings among the given candidates for the given target, 310 | * ordered by specificity. Does not traverse up the target's ancestors. This is 311 | * used by {::handleKeyboardEvent} to find a matching binding when there are no 312 | * partially-matching bindings. 313 | * This field or method was marked private by atomdoc. Use with caution. 314 | */ 315 | findExactMatches(exactMatchCandidates? : any, target? : any) : any; 316 | 317 | /** 318 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 319 | */ 320 | clearQueuedKeystrokes() : void; 321 | 322 | /** 323 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 324 | */ 325 | enterPendingState(pendingPartialMatches? : any, enableTimeout? : any) : any; 326 | 327 | /** 328 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 329 | */ 330 | cancelPendingState() : any; 331 | 332 | /** 333 | * This is called by {::handleKeyboardEvent} when no matching bindings are 334 | * found for the currently queued keystrokes or by the pending state timeout. 335 | * It disables the longest of the pending partially matching bindings, then 336 | * replays the queued keyboard events to allow any bindings with shorter 337 | * keystroke sequences to be matched unambiguously. 338 | * This field or method was marked private by atomdoc. Use with caution. 339 | */ 340 | terminatePendingState() : any; 341 | 342 | /** 343 | * After we match a binding, we call this method to dispatch a custom event 344 | * based on the binding's command. 345 | * This field or method was marked private by atomdoc. Use with caution. 346 | */ 347 | dispatchCommandEvent(command? : string, target? : any, keyboardEvent? : any) : CommandEvent; 348 | 349 | /** 350 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 351 | */ 352 | isValidSelector(selector? : string) : ScopedPropertyStore.Selector; 353 | 354 | /** 355 | * Chromium does not bubble events dispatched on detached targets, which makes 356 | * testing a pain in the ass. This method simulates bubbling manually. 357 | * This field or method was marked private by atomdoc. Use with caution. 358 | */ 359 | simulateBubblingOnDetachedTarget(target? : any, commandEvent? : CommandEvent) : any; 360 | 361 | } 362 | 363 | } 364 | declare module "atom-keymap" { 365 | export = AtomKeymap.CommandEvent; 366 | } 367 | -------------------------------------------------------------------------------- /typingsTemp/atom-space-pen-views/atom-space-pen-views.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for atom-space-pen-views (v2.0.5) 2 | // Project: https://github.com/atom/atom-space-pen-views 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | declare module AtomSpacePenViews { 10 | /** 11 | * Represents a view that scrolls. 12 | */ 13 | export class ScrollView extends SpacePen.View { 14 | /** 15 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 16 | */ 17 | initialize() : boolean; 18 | 19 | } 20 | 21 | /** 22 | * SelectListView 23 | * This class was not documented by atomdoc, assume it is private. Use with caution. 24 | */ 25 | export class SelectListView extends SpacePen.View { 26 | /** 27 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 28 | */ 29 | static content() : any; 30 | 31 | /** 32 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 33 | */ 34 | maxItems: any /* default */; 35 | 36 | /** 37 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 38 | */ 39 | scheduleTimeout: any /* default */; 40 | 41 | /** 42 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 43 | */ 44 | inputThrottle: boolean; 45 | 46 | /** 47 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 48 | */ 49 | cancelling: any /* default */; 50 | 51 | /** 52 | * Initialize the select list view. 53 | * 54 | * This method can be overridden by subclasses but `super` should always 55 | * be called. 56 | */ 57 | initialize() : boolean; 58 | 59 | /** 60 | * Create a view for the given model item. 61 | * 62 | * This method must be overridden by subclasses. 63 | * 64 | * This is called when the item is about to appended to the list view. 65 | * @param item? - The model item being rendered. This will always be one of the items previously passed to {::setItems}. 66 | * Returns a String of HTML, DOM element, jQuery object, or View. 67 | */ 68 | viewForItem(item? : any) : any; 69 | 70 | /** 71 | * Callback function for when an item is selected. 72 | * 73 | * This method must be overridden by subclasses. 74 | * @param item? - The selected model item. This will always be one of the items previously passed to {::setItems}. 75 | * Returns a DOM element, jQuery object, or {View}. 76 | */ 77 | confirmed(item? : any) : SpacePen.View; 78 | 79 | /** 80 | * Set the array of items to display in the list. 81 | * 82 | * This should be model items not actual views. {::viewForItem} will be 83 | * called to render the item when it is being appended to the list view. 84 | * @param items? - The {Array} of model items to display in the list (default: []). 85 | */ 86 | setItems(items? : any) : void; 87 | 88 | /** 89 | * Get the model item that is currently selected in the list view. 90 | * Returns a model item. 91 | */ 92 | getSelectedItem() : any; 93 | 94 | /** 95 | * Get the property name to use when filtering items. 96 | * 97 | * This method may be overridden by classes to allow fuzzy filtering based 98 | * on a specific property of the item objects. 99 | * 100 | * For example if the objects you pass to {::setItems} are of the type 101 | * `{"id": 3, "name": "Atom"}` then you would return `"name"` from this method 102 | * to fuzzy filter by that property when text is entered into this view's 103 | * editor. 104 | * Returns the property name to fuzzy filter by. 105 | */ 106 | getFilterKey() : any; 107 | 108 | /** 109 | * Get the filter query to use when fuzzy filtering the visible 110 | * elements. 111 | * 112 | * By default this method returns the text in the mini editor but it can be 113 | * overridden by subclasses if needed. 114 | * Returns a {String} to use when fuzzy filtering the elements to display. 115 | */ 116 | getFilterQuery() : string; 117 | 118 | /** 119 | * Set the maximum numbers of items to display in the list. 120 | * @param maxItems? - The maximum {Number} of items to display. 121 | */ 122 | setMaxItems(maxItems? : number) : void; 123 | 124 | /** 125 | * Populate the list view with the model items previously set by 126 | * calling {::setItems}. 127 | * 128 | * Subclasses may override this method but should always call `super`. 129 | */ 130 | populateList() : any; 131 | 132 | /** 133 | * Set the error message to display. 134 | * @param message? - The {String} error message (default: ''). 135 | */ 136 | setError(message? : string) : void; 137 | 138 | /** 139 | * Set the loading message to display. 140 | * @param message? - The {String} loading message (default: ''). 141 | */ 142 | setLoading(message? : string) : void; 143 | 144 | /** 145 | * Get the message to display when there are no items. 146 | * 147 | * Subclasses may override this method to customize the message. 148 | * @param itemCount? - The {Number} of items in the array specified to {::setItems} 149 | * @param filteredItemCount? - The {Number} of items that pass the fuzzy filter test. 150 | */ 151 | getEmptyMessage(itemCount? : number, filteredItemCount? : number) : string; 152 | 153 | /** 154 | * Cancel and close this select list view. 155 | * 156 | * This restores focus to the previously focused element if 157 | * {::storeFocusedElement} was called prior to this view being attached. 158 | */ 159 | cancel() : any; 160 | 161 | /** 162 | * Focus the fuzzy filter editor view. 163 | */ 164 | focusFilterEditor() : void; 165 | 166 | /** 167 | * Store the currently focused element. This element will be given 168 | * back focus when {::cancel} is called. 169 | */ 170 | storeFocusedElement() : void; 171 | 172 | /** 173 | * Private 174 | * This field or method was marked private by atomdoc. Use with caution. 175 | */ 176 | selectPreviousItemView() : SpacePen.View; 177 | 178 | /** 179 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 180 | */ 181 | selectNextItemView() : SpacePen.View; 182 | 183 | /** 184 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 185 | */ 186 | selectItemView(view? : any) : SpacePen.View; 187 | 188 | /** 189 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 190 | */ 191 | scrollToItemView(view? : any) : SpacePen.View; 192 | 193 | /** 194 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 195 | */ 196 | restoreFocus() : void; 197 | 198 | /** 199 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 200 | */ 201 | getSelectedItemView() : SpacePen.View; 202 | 203 | /** 204 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 205 | */ 206 | confirmSelection() : Atom.Selection; 207 | 208 | /** 209 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 210 | */ 211 | schedulePopulateList() : any; 212 | 213 | } 214 | 215 | /** 216 | * TextEditorView 217 | * This class was not documented by atomdoc, assume it is private. Use with caution. 218 | */ 219 | export class TextEditorView extends SpacePen.View { 220 | /** 221 | * The constructor for setting up an `TextEditorView` instance. 222 | * This field or method was marked private by atomdoc. Use with caution. 223 | */ 224 | constructor(params? : any); 225 | 226 | /** 227 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 228 | */ 229 | setModel(model? : any) : Atom.Model; 230 | 231 | /** 232 | * Get the underlying editor model for this view. 233 | */ 234 | getModel() : Atom.Model; 235 | 236 | /** 237 | * Get the text of the editor. 238 | */ 239 | getText() : string; 240 | 241 | /** 242 | * Set the text of the editor as a `String`. 243 | */ 244 | setText(text? : string) : string; 245 | 246 | /** 247 | * Determine whether the editor is or contains the active element. 248 | * Returns a `Boolean`. 249 | */ 250 | hasFocus() : any; 251 | 252 | } 253 | 254 | } 255 | declare module "atom-space-pen-views" { 256 | class ScrollView extends AtomSpacePenViews.ScrollView {} 257 | class SelectListView extends AtomSpacePenViews.SelectListView {} 258 | class TextEditorView extends AtomSpacePenViews.TextEditorView {} 259 | class View extends SpacePen.View {} 260 | var jQuery : JQueryStatic; 261 | var $ : JQueryStatic; 262 | function $$(fn: Function): JQuery; 263 | function $$$(fn: Function): Node; 264 | } 265 | -------------------------------------------------------------------------------- /typingsTemp/event-kit/event-kit.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for event-kit (v1.1.0) 2 | // Project: https://github.com/atom/event-kit 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | declare module EventKit { 9 | /** 10 | * An object that aggregates multiple {Disposable} instances together 11 | * into a single disposable, so they can all be disposed as a group. 12 | */ 13 | export class CompositeDisposable { 14 | /** 15 | * Construct an instance, optionally with one or more disposables 16 | */ 17 | constructor(); 18 | 19 | /** 20 | * Dispose all disposables added to this composite disposable. 21 | * 22 | * If this object has already been disposed, this method has no effect. 23 | */ 24 | dispose() : void; 25 | 26 | /** 27 | * Add a disposable to be disposed when the composite is disposed. 28 | * 29 | * If this object has already been disposed, this method has no effect. 30 | * @param disposable? - {Disposable} instance or any object with a `.dispose()` method. 31 | */ 32 | add(disposable? : Disposable) : void; 33 | 34 | /** 35 | * Remove a previously added disposable. 36 | * @param disposable? - {Disposable} instance or any object with a `.dispose()` method. 37 | */ 38 | remove(disposable? : Disposable) : void; 39 | 40 | /** 41 | * Clear all disposables. They will not be disposed by the next call 42 | * to dispose. 43 | */ 44 | clear() : void; 45 | 46 | } 47 | 48 | /** 49 | * A handle to a resource that can be disposed. For example, 50 | * {Emitter::on} returns disposables representing subscriptions. 51 | */ 52 | export class Disposable { 53 | /** 54 | * Construct a Disposable 55 | * @param disposalAction? - An action to perform when {::dispose} is called for the first time. 56 | */ 57 | constructor(disposalAction? : any); 58 | 59 | /** 60 | * Perform the disposal action, indicating that the resource associated 61 | * with this disposable is no longer needed. 62 | * 63 | * You can call this method more than once, but the disposal action will only 64 | * be performed the first time. 65 | */ 66 | dispose() : void; 67 | 68 | } 69 | 70 | /** 71 | * Utility class to be used when implementing event-based APIs that 72 | * allows for handlers registered via `::on` to be invoked with calls to 73 | * `::emit`. Instances of this class are intended to be used internally by 74 | * classes that expose an event-based API. 75 | */ 76 | export class Emitter { 77 | /** 78 | * Construct an emitter. 79 | * 80 | * ```coffee 81 | * @emitter = new Emitter() 82 | * ``` 83 | */ 84 | constructor(); 85 | 86 | /** 87 | * Unsubscribe all handlers. 88 | */ 89 | dispose() : void; 90 | 91 | /** 92 | * Register the given handler function to be invoked whenever events by 93 | * the given name are emitted via {::emit}. 94 | * @param eventName - {String} naming the event that you want to invoke the handler when emitted. 95 | * @param handler? - {Function} to invoke when {::emit} is called with the given event name. 96 | * Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. 97 | */ 98 | on(eventName : string, handler? : (...value: any[]) => void, unshift? : any) : Disposable; 99 | 100 | /** 101 | * Register the given handler function to be invoked *before* all 102 | * other handlers existing at the time of subscription whenever events by the 103 | * given name are emitted via {::emit}. 104 | * 105 | * Use this method when you need to be the first to handle a given event. This 106 | * could be required when a data structure in a parent object needs to be 107 | * updated before third-party event handlers registered on a child object via a 108 | * public API are invoked. Your handler could itself be preempted via 109 | * subsequent calls to this method, but this can be controlled by keeping 110 | * methods based on `::preempt` private. 111 | * @param eventName - {String} naming the event that you want to invoke the handler when emitted. 112 | * @param handler? - {Function} to invoke when {::emit} is called with the given event name. 113 | * Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. 114 | */ 115 | preempt(eventName : string, handler? : (...value: any[]) => void) : Disposable; 116 | 117 | /** 118 | * Used by the disposable. 119 | * This field or method was marked private by atomdoc. Use with caution. 120 | */ 121 | off(eventName : string, handlerToRemove? : (...value: any[]) => void) : void; 122 | 123 | /** 124 | * Invoke handlers registered via {::on} for the given event name. 125 | * @param eventName - The name of the event to emit. Handlers registered with {::on} for the same name will be invoked. 126 | * @param ...value - Callbacks will be invoked with this value as an argument. 127 | */ 128 | emit(eventName : string, ...value : any[]) : void; 129 | 130 | } 131 | 132 | } 133 | declare module "event-kit" { 134 | class CompositeDisposable extends EventKit.CompositeDisposable {} 135 | class Disposable extends EventKit.Disposable {} 136 | class Emitter extends EventKit.Emitter {} 137 | } 138 | -------------------------------------------------------------------------------- /typingsTemp/first-mate/first-mate.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for first-mate (v3.1.0) 2 | // Project: https://github.com/atom/first-mate 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | declare module FirstMate { 10 | /** 11 | * Registry containing one or more grammars. 12 | */ 13 | class GrammarRegistry { 14 | /** 15 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 16 | */ 17 | constructor(options? : any); 18 | 19 | /** 20 | * Invoke the given callback when a grammar is added to the registry. 21 | * @param callback - {Function} to call when a grammar is added. 22 | */ 23 | onDidAddGrammar(callback : Function /* needs to be defined */) : EventKit.Disposable; 24 | 25 | /** 26 | * Invoke the given callback when a grammar is updated due to a grammar 27 | * it depends on being added or removed from the registry. 28 | * @param callback - {Function} to call when a grammar is updated. 29 | */ 30 | onDidUpdateGrammar(callback : Function /* needs to be defined */) : EventKit.Disposable; 31 | 32 | /** 33 | * Get all the grammars in this registry. 34 | */ 35 | getGrammars() : Grammar[]; 36 | 37 | /** 38 | * Get a grammar with the given scope name. 39 | * @param scopeName? - A {String} such as `"source.js"`. 40 | */ 41 | grammarForScopeName(scopeName? : string) : string; 42 | 43 | /** 44 | * Add a grammar to this registry. 45 | * 46 | * A 'grammar-added' event is emitted after the grammar is added. 47 | * @param grammar? - The {Grammar} to add. This should be a value previously returned from {::readGrammar} or {::readGrammarSync}. 48 | */ 49 | addGrammar(grammar? : Grammar) : Grammar; 50 | 51 | /** 52 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 53 | */ 54 | removeGrammar(grammar? : Grammar) : Grammar; 55 | 56 | /** 57 | * Remove the grammar with the given scope name. 58 | * @param scopeName? - A {String} such as `"source.js"`. 59 | */ 60 | removeGrammarForScopeName(scopeName? : string) : string; 61 | 62 | /** 63 | * Read a grammar synchronously but don't add it to the registry. 64 | * @param grammarPath? - A {String} absolute file path to a grammar file. 65 | * Returns a {Grammar}. 66 | */ 67 | readGrammarSync(grammarPath? : string) : Grammar; 68 | 69 | /** 70 | * Read a grammar asynchronously but don't add it to the registry. 71 | * @param grammarPath? - A {String} absolute file path to a grammar file. 72 | * @param callback? - A {Function} to call when read with the following arguments: 73 | */ 74 | readGrammar(grammarPath? : string, callback? : Function) : Grammar; 75 | 76 | /** 77 | * Read a grammar synchronously and add it to this registry. 78 | * @param grammarPath? - A {String} absolute file path to a grammar file. 79 | * Returns a {Grammar}. 80 | */ 81 | loadGrammarSync(grammarPath? : string) : Grammar; 82 | 83 | /** 84 | * Read a grammar asynchronously and add it to the registry. 85 | * @param grammarPath? - A {String} absolute file path to a grammar file. 86 | * @param callback? - A {Function} to call when loaded with the following arguments: 87 | */ 88 | loadGrammar(grammarPath? : string, callback? : Function) : Grammar; 89 | 90 | /** 91 | * Get the grammar override for the given file path. 92 | * @param filePath? - A {String} file path. 93 | */ 94 | grammarOverrideForPath(filePath? : string) : string; 95 | 96 | /** 97 | * Set the grammar override for the given file path. 98 | * @param filePath? - A non-empty {String} file path. 99 | * @param scopeName? - A {String} such as `"source.js"`. 100 | */ 101 | setGrammarOverrideForPath(filePath? : string, scopeName? : string) : string; 102 | 103 | /** 104 | * Remove the grammar override for the given file path. 105 | * @param filePath? - A {String} file path. 106 | */ 107 | clearGrammarOverrideForPath(filePath? : string) : string; 108 | 109 | /** 110 | * Remove all grammar overrides. 111 | */ 112 | clearGrammarOverrides() : void; 113 | 114 | /** 115 | * Select a grammar for the given file path and file contents. 116 | * 117 | * This picks the best match by checking the file path and contents against 118 | * each grammar. 119 | * @param filePath? - A {String} file path. 120 | * @param fileContents? - A {String} of text for the file path. 121 | */ 122 | selectGrammar(filePath? : string, fileContents? : string) : Grammar; 123 | 124 | /** 125 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 126 | */ 127 | createToken(value? : any, scopes? : Atom.Scope[]) : Atom.Token; 128 | 129 | /** 130 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 131 | */ 132 | grammarUpdated(scopeName? : string) : any; 133 | 134 | /** 135 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 136 | */ 137 | createGrammar(grammarPath? : string, object? : any) : Grammar; 138 | 139 | } 140 | 141 | /** 142 | * Grammar that tokenizes lines of text. 143 | */ 144 | class Grammar { 145 | /** 146 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 147 | */ 148 | registry: any /* default */; 149 | 150 | /** 151 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 152 | */ 153 | registration: any /* default */; 154 | 155 | /** 156 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 157 | */ 158 | constructor(registry? : any, options? : any); 159 | 160 | /** 161 | * Invoke the given callback when this grammar is updated due to a 162 | * grammar it depends on being added or removed from the registry. 163 | * @param callback - {Function} to call when this grammar is updated. 164 | */ 165 | onDidUpdate(callback : Function /* needs to be defined */) : EventKit.Disposable; 166 | 167 | /** 168 | * Tokenize all lines in the given text. 169 | * @param text? - A {String} containing one or more lines. 170 | */ 171 | tokenizeLines(text? : string) : string[]; 172 | 173 | /** 174 | * Tokenize the line of text. 175 | * @param line? - A {String} of text to tokenize. 176 | * @param ruleStack? - An optional {Array} of rules previously returned from this method. This should be null when tokenizing the first line in the file. 177 | * @param firstLine? - A optional {Boolean} denoting whether this is the first line in the file which defaults to `false`. This should be `true` when tokenizing the first line in the file. 178 | */ 179 | tokenizeLine(line? : string, ruleStack? : any[], firstLine? : boolean) : number; 180 | 181 | /** 182 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 183 | */ 184 | activate() : void; 185 | 186 | /** 187 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 188 | */ 189 | deactivate() : void; 190 | 191 | /** 192 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 193 | */ 194 | clearRules() : Rule[]; 195 | 196 | /** 197 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 198 | */ 199 | getInitialRule() : Rule; 200 | 201 | /** 202 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 203 | */ 204 | getRepository() : any; 205 | 206 | /** 207 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 208 | */ 209 | addIncludedGrammarScope(scope? : Atom.Scope) : Atom.Scope; 210 | 211 | /** 212 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 213 | */ 214 | grammarUpdated(scopeName? : string) : any; 215 | 216 | /** 217 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 218 | */ 219 | getScore(filePath? : string, contents? : any) : any; 220 | 221 | /** 222 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 223 | */ 224 | matchesContents(contents? : any) : any; 225 | 226 | /** 227 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 228 | */ 229 | getPathScore(filePath? : string) : string; 230 | 231 | /** 232 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 233 | */ 234 | createToken(value? : any, scopes? : Atom.Scope[]) : Atom.Token; 235 | 236 | /** 237 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 238 | */ 239 | createRule(options? : any) : Rule; 240 | 241 | /** 242 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 243 | */ 244 | createPattern(options? : any) : Pattern; 245 | 246 | /** 247 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 248 | */ 249 | getMaxTokensPerLine() : number; 250 | 251 | /** 252 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 253 | */ 254 | scopesFromStack(stack? : any, rule? : Rule, endPatternMatch? : any) : any; 255 | 256 | 257 | name: string; 258 | } 259 | 260 | /** 261 | * Injections 262 | * This class was not documented by atomdoc, assume it is private. Use with caution. 263 | */ 264 | class Injections { 265 | /** 266 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 267 | */ 268 | grammar: Grammar; 269 | 270 | /** 271 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 272 | */ 273 | constructor(grammar? : Grammar, injections? : any); 274 | 275 | /** 276 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 277 | */ 278 | getScanner(injection? : any) : Scanner; 279 | 280 | /** 281 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 282 | */ 283 | getScanners(ruleStack? : any) : Scanner[]; 284 | 285 | } 286 | 287 | /** 288 | * A grammar with no patterns that is always available from a {GrammarRegistry} 289 | * even when it is completely empty. 290 | */ 291 | class NullGrammar extends Grammar { 292 | /** 293 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 294 | */ 295 | constructor(registry? : any); 296 | 297 | /** 298 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 299 | */ 300 | getScore() : any; 301 | 302 | } 303 | 304 | /** 305 | * Pattern 306 | * This class was not documented by atomdoc, assume it is private. Use with caution. 307 | */ 308 | class Pattern { 309 | /** 310 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 311 | */ 312 | grammar: Grammar; 313 | 314 | /** 315 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 316 | */ 317 | registry: any /* default */; 318 | 319 | /** 320 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 321 | */ 322 | constructor(grammar? : Grammar, registry? : any, options? : any); 323 | 324 | /** 325 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 326 | */ 327 | getRegex(firstLine? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], anchorPosition? : TextBuffer.Point | { row: number; column: number } | [number, number]) : any; 328 | 329 | /** 330 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 331 | */ 332 | hasAnchor() : any; 333 | 334 | /** 335 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 336 | */ 337 | replaceAnchor(firstLine? : number, offset? : any, anchor? : any) : any; 338 | 339 | /** 340 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 341 | */ 342 | resolveBackReferences(line? : number, beginCaptureIndices? : any) : any; 343 | 344 | /** 345 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 346 | */ 347 | ruleForInclude(baseGrammar? : Grammar, name? : string) : any; 348 | 349 | /** 350 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 351 | */ 352 | getIncludedPatterns(baseGrammar? : Grammar, included? : any) : Pattern[]; 353 | 354 | /** 355 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 356 | */ 357 | resolveScopeName(scopeName? : string, line? : number, captureIndices? : any) : string; 358 | 359 | /** 360 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 361 | */ 362 | handleMatch(stack? : any, line? : number, captureIndices? : any, rule? : Rule, endPatternMatch? : any) : void; 363 | 364 | /** 365 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 366 | */ 367 | getTokensForCaptureRule(rule? : Rule, line? : number, captureStart? : any, captureEnd? : any, scopes? : Atom.Scope[], stack? : any) : Rule; 368 | 369 | /** 370 | * Get the tokens for the capture indices. 371 | * 372 | * line - The string being tokenized. 373 | * currentCaptureIndices - The current array of capture indices being 374 | * processed into tokens. This method is called 375 | * recursively and this array will be modified inside 376 | * this method. 377 | * allCaptureIndices - The array of all capture indices, this array will not 378 | * be modified. 379 | * scopes - An array of scopes. 380 | * stack - An array of rules. 381 | * This field or method was marked private by atomdoc. Use with caution. 382 | * Returns a non-null but possibly empty array of tokens 383 | */ 384 | getTokensForCaptureIndices(line? : number, currentCaptureIndices? : any, allCaptureIndices? : any, scopes? : Atom.Scope[], stack? : any) : any; 385 | 386 | } 387 | 388 | /** 389 | * Rule 390 | * This class was not documented by atomdoc, assume it is private. Use with caution. 391 | */ 392 | class Rule { 393 | /** 394 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 395 | */ 396 | grammar: Grammar; 397 | 398 | /** 399 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 400 | */ 401 | registry: any /* default */; 402 | 403 | /** 404 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 405 | */ 406 | scopeName: string; 407 | 408 | /** 409 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 410 | */ 411 | contentScopeName: string; 412 | 413 | /** 414 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 415 | */ 416 | endPattern: Pattern; 417 | 418 | /** 419 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 420 | */ 421 | applyEndPatternLast: any /* default */; 422 | 423 | /** 424 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 425 | */ 426 | constructor(grammar? : Grammar, registry? : any, options? : (scopeName? : string,contentScopeName? : string,patterns? : Pattern[],endPattern? : Pattern,applyEndPatternLast? : any) => any); 427 | 428 | /** 429 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 430 | */ 431 | getIncludedPatterns(baseGrammar? : Grammar, included? : any) : Pattern[]; 432 | 433 | /** 434 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 435 | */ 436 | clearAnchorPosition() : TextBuffer.Point; 437 | 438 | /** 439 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 440 | */ 441 | getScanner(baseGrammar? : Grammar) : Scanner; 442 | 443 | /** 444 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 445 | */ 446 | scanInjections(ruleStack? : any, line? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], firstLine? : number) : any; 447 | 448 | /** 449 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 450 | */ 451 | normalizeCaptureIndices(line? : number, captureIndices? : any) : any; 452 | 453 | /** 454 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 455 | */ 456 | findNextMatch(ruleStack? : any, line? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], firstLine? : number) : any; 457 | 458 | /** 459 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 460 | */ 461 | getNextTokens(ruleStack? : any, line? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], firstLine? : number) : Atom.Token[]; 462 | 463 | /** 464 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 465 | */ 466 | getRuleToPush(line? : number, beginPatternCaptureIndices? : any) : any; 467 | 468 | } 469 | 470 | /** 471 | * Wrapper class for {OnigScanner} that caches them based on the presence of any 472 | * anchor characters that change based on the current position being scanned. 473 | */ 474 | class Scanner { 475 | /** 476 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 477 | */ 478 | patterns: Pattern[]; 479 | 480 | /** 481 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 482 | */ 483 | constructor(patterns? : Pattern[]); 484 | 485 | /** 486 | * Create a new {OnigScanner} with the given options. 487 | * This field or method was marked private by atomdoc. Use with caution. 488 | */ 489 | createScanner(firstLine? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], anchorPosition? : TextBuffer.Point | { row: number; column: number } | [number, number]) : Scanner; 490 | 491 | /** 492 | * Get the {OnigScanner} for the given position and options. 493 | * This field or method was marked private by atomdoc. Use with caution. 494 | */ 495 | getScanner(firstLine? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], anchorPosition? : TextBuffer.Point | { row: number; column: number } | [number, number]) : Scanner; 496 | 497 | /** 498 | * Find the next match on the line start at the given position 499 | * 500 | * line - the string being scanned. 501 | * firstLine - true if the first line is being scanned. 502 | * position - numeric position to start scanning at. 503 | * anchorPosition - numeric position of the last anchored match. 504 | * Returns an Object with details about the match or null if no match found. 505 | */ 506 | findNextMatch(line? : number, firstLine? : number, position? : TextBuffer.Point | { row: number; column: number } | [number, number], anchorPosition? : TextBuffer.Point | { row: number; column: number } | [number, number]) : any; 507 | 508 | /** 509 | * Handle the given match by calling `handleMatch` on the 510 | * matched {Pattern}. 511 | * 512 | * match - An object returned from a previous call to `findNextMatch`. 513 | * stack - An array of {Rule} objects. 514 | * line - The string being scanned. 515 | * rule - The rule that matched. 516 | * endPatternMatch - true if the rule's end pattern matched. 517 | */ 518 | handleMatch(match? : any, stack? : any, line? : number, rule? : Rule, endPatternMatch? : any) : void; 519 | 520 | } 521 | 522 | /** 523 | * SegmentMatcher 524 | * This class was not documented by atomdoc, assume it is private. Use with caution. 525 | */ 526 | class SegmentMatcher { 527 | /** 528 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 529 | */ 530 | constructor(segments? : any); 531 | 532 | /** 533 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 534 | */ 535 | matches(scope? : Atom.Scope) : any; 536 | 537 | /** 538 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 539 | */ 540 | toCssSelector() : ScopedPropertyStore.Selector; 541 | 542 | } 543 | 544 | /** 545 | * TrueMatcher 546 | * This class was not documented by atomdoc, assume it is private. Use with caution. 547 | */ 548 | class TrueMatcher { 549 | /** 550 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 551 | */ 552 | constructor(); 553 | 554 | /** 555 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 556 | */ 557 | matches() : any; 558 | 559 | /** 560 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 561 | */ 562 | toCssSelector() : ScopedPropertyStore.Selector; 563 | 564 | } 565 | 566 | /** 567 | * ScopeMatcher 568 | * This class was not documented by atomdoc, assume it is private. Use with caution. 569 | */ 570 | class ScopeMatcher { 571 | /** 572 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 573 | */ 574 | constructor(first? : any, others? : any); 575 | 576 | /** 577 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 578 | */ 579 | matches(scope? : Atom.Scope) : any; 580 | 581 | /** 582 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 583 | */ 584 | toCssSelector() : ScopedPropertyStore.Selector; 585 | 586 | } 587 | 588 | /** 589 | * PathMatcher 590 | * This class was not documented by atomdoc, assume it is private. Use with caution. 591 | */ 592 | class PathMatcher { 593 | /** 594 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 595 | */ 596 | constructor(first? : any, others? : any); 597 | 598 | /** 599 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 600 | */ 601 | matches(scopes? : Atom.Scope[]) : any; 602 | 603 | /** 604 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 605 | */ 606 | toCssSelector() : ScopedPropertyStore.Selector; 607 | 608 | } 609 | 610 | /** 611 | * OrMatcher 612 | * This class was not documented by atomdoc, assume it is private. Use with caution. 613 | */ 614 | class OrMatcher { 615 | /** 616 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 617 | */ 618 | left: any /* default */; 619 | 620 | /** 621 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 622 | */ 623 | right: any /* default */; 624 | 625 | /** 626 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 627 | */ 628 | constructor(left? : any, right? : any); 629 | 630 | /** 631 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 632 | */ 633 | matches(scopes? : Atom.Scope[]) : any; 634 | 635 | /** 636 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 637 | */ 638 | toCssSelector() : ScopedPropertyStore.Selector; 639 | 640 | } 641 | 642 | /** 643 | * AndMatcher 644 | * This class was not documented by atomdoc, assume it is private. Use with caution. 645 | */ 646 | class AndMatcher { 647 | /** 648 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 649 | */ 650 | left: any /* default */; 651 | 652 | /** 653 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 654 | */ 655 | right: any /* default */; 656 | 657 | /** 658 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 659 | */ 660 | constructor(left? : any, right? : any); 661 | 662 | /** 663 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 664 | */ 665 | matches(scopes? : Atom.Scope[]) : any; 666 | 667 | /** 668 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 669 | */ 670 | toCssSelector() : ScopedPropertyStore.Selector; 671 | 672 | } 673 | 674 | /** 675 | * NegateMatcher 676 | * This class was not documented by atomdoc, assume it is private. Use with caution. 677 | */ 678 | class NegateMatcher { 679 | /** 680 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 681 | */ 682 | matcher: any /* default */; 683 | 684 | /** 685 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 686 | */ 687 | constructor(matcher? : any); 688 | 689 | /** 690 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 691 | */ 692 | matches(scopes? : Atom.Scope[]) : any; 693 | 694 | /** 695 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 696 | */ 697 | toCssSelector() : ScopedPropertyStore.Selector; 698 | 699 | } 700 | 701 | /** 702 | * CompositeMatcher 703 | * This class was not documented by atomdoc, assume it is private. Use with caution. 704 | */ 705 | class CompositeMatcher { 706 | /** 707 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 708 | */ 709 | constructor(left? : any, operator? : any, right? : any); 710 | 711 | /** 712 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 713 | */ 714 | matches(scopes? : Atom.Scope[]) : any; 715 | 716 | /** 717 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 718 | */ 719 | toCssSelector() : ScopedPropertyStore.Selector; 720 | 721 | } 722 | 723 | /** 724 | * ScopeSelector 725 | * This class was not documented by atomdoc, assume it is private. Use with caution. 726 | */ 727 | class ScopeSelector { 728 | /** 729 | * Create a new scope selector. 730 | * 731 | * source - A {String} to parse as a scope selector. 732 | * This field or method was marked private by atomdoc. Use with caution. 733 | */ 734 | constructor(source? : any); 735 | 736 | /** 737 | * Check if this scope selector matches the scopes. 738 | * 739 | * scopes - An {Array} of {String}s or a single {String}. 740 | * This field or method was marked private by atomdoc. Use with caution. 741 | * Returns a {Boolean}. 742 | */ 743 | matches(scopes? : Atom.Scope[]) : boolean; 744 | 745 | /** 746 | * Convert this TextMate scope selector to a CSS selector. 747 | * This field or method was marked private by atomdoc. Use with caution. 748 | */ 749 | toCssSelector() : ScopedPropertyStore.Selector; 750 | 751 | } 752 | 753 | } 754 | declare module "first-mate" { 755 | class ScopeSelector extends FirstMate.ScopeSelector {} 756 | class GrammarRegistry extends FirstMate.GrammarRegistry {} 757 | class Grammar extends FirstMate.Grammar {} 758 | } 759 | -------------------------------------------------------------------------------- /typingsTemp/linter/linter.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for linter (v0.12.0) 2 | // Project: https://github.com/AtomLinter/Linter 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | declare module Linter { 10 | /** 11 | * linter package initialization, sets up the linter for usages by atom 12 | */ 13 | class LinterInitializer { 14 | /** 15 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 16 | */ 17 | config: Atom.Config; 18 | 19 | /** 20 | * Activate the plugin setting up StatusBarView and dicovering linters 21 | */ 22 | activate() : void; 23 | 24 | /** 25 | * deactivate the plugin and unregister all subscriptions 26 | */ 27 | deactivate() : void; 28 | 29 | } 30 | 31 | /** 32 | * InlineView 33 | * This class was not documented by atomdoc, assume it is private. Use with caution. 34 | */ 35 | class InlineView { 36 | /** 37 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 38 | */ 39 | remove() : void; 40 | 41 | /** 42 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 43 | */ 44 | render(messages? : string, editor? : any) : any; 45 | 46 | } 47 | 48 | /** 49 | * MessageBubble 50 | * This class was not documented by atomdoc, assume it is private. Use with caution. 51 | */ 52 | class MessageBubble extends SpacePen.View { 53 | /** 54 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 55 | */ 56 | static content(messages? : string) : any; 57 | 58 | } 59 | 60 | /** 61 | * The base linter view 62 | */ 63 | class LinterView { 64 | /** 65 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 66 | */ 67 | editor: Atom.TextEditor; 68 | 69 | /** 70 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 71 | */ 72 | statusBarView: SpacePen.View; 73 | 74 | /** 75 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 76 | */ 77 | statusBarSummaryView: SpacePen.View; 78 | 79 | /** 80 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 81 | */ 82 | inlineView: SpacePen.View; 83 | 84 | /** 85 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 86 | */ 87 | allLinters : any /* default */; 88 | 89 | /** 90 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 91 | */ 92 | linters: Linter[]; 93 | 94 | /** 95 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 96 | */ 97 | totalProcessed: any /* default */; 98 | 99 | /** 100 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 101 | */ 102 | tempFile: Pathwatcher.File; 103 | 104 | /** 105 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 106 | */ 107 | messages: string; 108 | 109 | /** 110 | * Instantiate the views 111 | * 112 | * editor - the editor on which to place highlighting and gutter annotations 113 | * statusBarView - shared StatusBarView between all linters 114 | * linters - global linter set to utilize for linting 115 | */ 116 | constructor(editor? : any, statusBarView? : any, statusBarSummaryView? : any, inlineView? : any, allLinters ? : any); 117 | 118 | /** 119 | * Initialize new linters (used on grammar change) 120 | * 121 | * linters - global linter set to utilize for linting 122 | */ 123 | initLinters() : Linter[]; 124 | 125 | /** 126 | * register config modifications handlers 127 | */ 128 | handleConfigChanges() : void; 129 | 130 | /** 131 | * register handlers for editor buffer events 132 | */ 133 | handleEditorEvents() : void; 134 | 135 | /** 136 | * lint the current file in the editor using the live buffer 137 | */ 138 | lint() : any; 139 | 140 | /** 141 | * Process the messages returned by linters and render them. 142 | * 143 | * messages - An array of messages to annotate: 144 | * :level - the annotation error level ('error', 'warning', 'info') 145 | * :range - The buffer range that the annotation should be placed 146 | */ 147 | processMessage(messages? : string, tempFileInfo? : any, linter? : any) : string; 148 | 149 | /** 150 | * Destroy all markers (and associated decorations) 151 | */ 152 | destroyMarkers() : Atom.Marker[]; 153 | 154 | /** 155 | * Create marker from message 156 | */ 157 | createMarker(message? : string) : Atom.Marker; 158 | 159 | /** 160 | * Pidgeonhole messages onto lines. Each line gets only one message, 161 | * the message with the highest level presides. Messages of unrecognizable 162 | * level (or silenced by config) will be skipped. 163 | */ 164 | sortMessagesByLine(messages? : string) : string; 165 | 166 | /** 167 | * Render gutter icons and highlights for all linter messages. 168 | */ 169 | display(messages? : string) : void; 170 | 171 | /** 172 | * Update the views for new messages 173 | */ 174 | updateViews() : SpacePen.View[]; 175 | 176 | /** 177 | * remove this view and unregister all its subscriptions 178 | */ 179 | remove() : void; 180 | 181 | /** 182 | * Invoke the given callback when the editor is destroyed. 183 | * @param callback - {Function} to be called when the editor is destroyed. 184 | */ 185 | onDidDestroy(callback : Function /* needs to be defined */) : EventKit.Disposable; 186 | 187 | } 188 | 189 | /** 190 | * The base class for linters. 191 | * Subclasses must at a minimum define the attributes syntax, cmd, and regex. 192 | */ 193 | class Linter { 194 | /** 195 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 196 | */ 197 | static syntax: any /* default */; 198 | 199 | /** 200 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 201 | */ 202 | editor: Atom.TextEditor; 203 | 204 | /** 205 | * A string or array containing the command line (with arguments) used to 206 | * lint. 207 | * This field or method was marked private by atomdoc. Use with caution. 208 | */ 209 | cmd: any /* default */; 210 | 211 | /** 212 | * A regex pattern used to extract information from the executable's output. 213 | * regex should construct match results for the following keys 214 | * 215 | * message: the message to show in the linter views (required) 216 | * line: the line number on which to mark error (required if not lineStart) 217 | * lineStart: the line number to start the error mark (optional) 218 | * lineEnd: the line number on end the error mark (optional) 219 | * col: the column on which to mark, will utilize syntax scope to higlight the 220 | * closest matching syntax element based on your code syntax (optional) 221 | * colStart: column to on which to start a higlight (optional) 222 | * colEnd: column to end highlight (optional) 223 | * This field or method was marked private by atomdoc. Use with caution. 224 | */ 225 | regex: any /* default */; 226 | 227 | /** 228 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 229 | */ 230 | regexFlags: any /* default */; 231 | 232 | /** 233 | * current working directory, overridden in linters that need it 234 | * This field or method was marked private by atomdoc. Use with caution. 235 | */ 236 | cwd: any /* default */; 237 | 238 | /** 239 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 240 | */ 241 | defaultLevel: any /* default */; 242 | 243 | /** 244 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 245 | */ 246 | linterName: string; 247 | 248 | /** 249 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 250 | */ 251 | executablePath: string; 252 | 253 | /** 254 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 255 | */ 256 | isNodeExecutable: boolean; 257 | 258 | /** 259 | * what does this mean? 260 | */ 261 | errorStream: any /* default */; 262 | 263 | /** 264 | * Construct a linter passing it's base editor 265 | */ 266 | constructor(editor? : any); 267 | 268 | /** 269 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 270 | */ 271 | destroy() : void; 272 | 273 | /** 274 | * Exists mostly so we can use statSync without slowing down linting. 275 | * TODO: Do this at constructor time? 276 | * This field or method was marked private by atomdoc. Use with caution. 277 | */ 278 | _cachedStatSync(path? : string) : any; 279 | 280 | /** 281 | * get command and args for atom.BufferedProcess for execution 282 | * This field or method was marked private by atomdoc. Use with caution. 283 | */ 284 | getCmdAndArgs(filePath? : string) : any; 285 | 286 | /** 287 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 288 | */ 289 | getReportFilePath(filePath? : string) : string; 290 | 291 | /** 292 | * Provide the node executable path for use when executing a node 293 | * linter 294 | * This field or method was marked private by atomdoc. Use with caution. 295 | */ 296 | getNodeExecutablePath() : string; 297 | 298 | /** 299 | * Primary entry point for a linter, executes the linter then calls 300 | * processMessage in order to handle standard output 301 | * 302 | * Override this if you don't intend to use base command execution logic 303 | */ 304 | lintFile(filePath? : string, callback? : any) : Pathwatcher.File; 305 | 306 | /** 307 | * process the string result of a linter execution using the regex 308 | * as the message builder 309 | * 310 | * Override this in order to handle message processing in a different manner 311 | * for instance if the linter returns json or xml data 312 | * This field or method was marked private by atomdoc. Use with caution. 313 | */ 314 | processMessage(message? : string, callback? : any) : string; 315 | 316 | /** 317 | * create a message from the regex match return 318 | * 319 | * match - Options used to configure linting messages 320 | * message: the message to show in the linter views (required) 321 | * line: the line number on which to mark error (required if not lineStart) 322 | * lineStart: the line number to start the error mark (optional) 323 | * lineEnd: the line number on end the error mark (optional) 324 | * col: the column on which to mark, will utilize syntax scope to higlight 325 | * the closest matching syntax element based on your code syntax 326 | * (optional) 327 | * colStart: column to on which to start a higlight (optional) 328 | * colEnd: column to end highlight (optional) 329 | * This field or method was marked private by atomdoc. Use with caution. 330 | */ 331 | createMessage(match? : any) : string; 332 | 333 | /** 334 | * This is the method to override if you want to set a custom message 335 | * not only the match.message but maybe concatenate an error|warning code 336 | * 337 | * By default it returns the message field. 338 | */ 339 | formatMessage(match? : any) : string; 340 | 341 | /** 342 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 343 | */ 344 | lineLengthForRow(row? : number) : number; 345 | 346 | /** 347 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 348 | */ 349 | getEditorScopesForPosition(position? : TextBuffer.Point | { row: number; column: number } | [number, number]) : TextBuffer.Point; 350 | 351 | /** 352 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 353 | */ 354 | getGetRangeForScopeAtPosition(innerMostScope? : Atom.Scope, position? : TextBuffer.Point | { row: number; column: number } | [number, number]) : TextBuffer.Range; 355 | 356 | /** 357 | * This is the logic by which we automatically determine the range 358 | * in the buffer that we should highlight for various combinations 359 | * of line, lineStart, lineEnd, col, colStart, and colEnd values 360 | * passed by the regex match. 361 | * 362 | * It is highly recommended that you utilize this logic if you are not managing 363 | * your own range construction logic in your linter 364 | * 365 | * match - Options used to configure linting messages 366 | * message: the message to show in the linter views (required) 367 | * line: the line number on which to mark error (required if not lineStart) 368 | * lineStart: the line number to start the error mark (optional) 369 | * lineEnd: the line number on end the error mark (optional) 370 | * col: the column on which to mark, will utilize syntax scope to higlight 371 | * the closest matching syntax element based on your code syntax 372 | * (optional) 373 | * colStart: column to on which to start a higlight (optional) 374 | * colEnd: column to end highlight (optional) 375 | * This field or method was marked private by atomdoc. Use with caution. 376 | */ 377 | computeRange(match? : any) : Atom.Range; 378 | 379 | } 380 | 381 | /** 382 | * Status Bar View 383 | */ 384 | class StatusBarSummaryView { 385 | /** 386 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 387 | */ 388 | remove() : void; 389 | 390 | /** 391 | * Render the view 392 | * This field or method was marked private by atomdoc. Use with caution. 393 | */ 394 | render(messages? : string, editor? : any) : any; 395 | 396 | } 397 | 398 | /** 399 | * StatusBarSummary 400 | * This class was not documented by atomdoc, assume it is private. Use with caution. 401 | */ 402 | class StatusBarSummary extends SpacePen.View { 403 | /** 404 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 405 | */ 406 | static content(messages? : string, editor? : any, info? : any, warning? : any, error? : any) : any; 407 | 408 | /** 409 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 410 | */ 411 | initialize(messages? : string, editor? : boolean) : boolean; 412 | 413 | /** 414 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 415 | */ 416 | detached() : any; 417 | 418 | } 419 | 420 | /** 421 | * Status Bar View 422 | */ 423 | class StatusBarView extends SpacePen.View { 424 | /** 425 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 426 | */ 427 | static content() : any; 428 | 429 | /** 430 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 431 | */ 432 | initialize() : boolean; 433 | 434 | /** 435 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 436 | */ 437 | highlightLines(currentLine? : number) : string[]; 438 | 439 | /** 440 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 441 | */ 442 | detached() : any; 443 | 444 | /** 445 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 446 | */ 447 | computeMessages(messages? : string, position? : TextBuffer.Point | { row: number; column: number } | [number, number], currentLine? : number, limitOnErrorRange? : TextBuffer.Range) : string; 448 | 449 | /** 450 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 451 | */ 452 | filterInfoMessages(messages? : string, config? : any) : string; 453 | 454 | /** 455 | * Render the view 456 | * This field or method was marked private by atomdoc. Use with caution. 457 | */ 458 | render(messages? : string, editor? : any) : any; 459 | 460 | } 461 | 462 | } 463 | declare module "linter" { 464 | export = Linter.Linter; 465 | } 466 | -------------------------------------------------------------------------------- /typingsTemp/pathwatcher/pathwatcher.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for pathwatcher (v4.4.0) 2 | // Project: https://github.com/atom/node-pathwatcher 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | /// 10 | declare module Pathwatcher { 11 | /** 12 | * Represents a directory on disk that can be watched for changes. 13 | */ 14 | export class Directory { 15 | /** 16 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 17 | */ 18 | symlink: any /* default */; 19 | 20 | /** 21 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 22 | */ 23 | realPath: string; 24 | 25 | /** 26 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 27 | */ 28 | subscriptionCount: number; 29 | 30 | /** 31 | * Configures a new Directory instance, no files are accessed. 32 | * @param directoryPath? - A {String} containing the absolute path to the directory 33 | * @param symlink? - A {Boolean} indicating if the path is a symlink. (default: false) 34 | */ 35 | constructor(directoryPath? : string, symlink? : boolean); 36 | 37 | /** 38 | * Creates the directory on disk that corresponds to `::getPath()` if 39 | * no such directory already exists. 40 | */ 41 | create(mode? : any) : any; 42 | 43 | /** 44 | * Invoke the given callback when the directory's contents change. 45 | * @param callback - {Function} to be called when the directory's contents change. 46 | */ 47 | onDidChange(callback : Function /* needs to be defined */) : EventKit.Disposable; 48 | 49 | /** 50 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 51 | */ 52 | willAddSubscription() : any; 53 | 54 | /** 55 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 56 | */ 57 | didRemoveSubscription() : any; 58 | 59 | /** 60 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 61 | */ 62 | trackUnsubscription(subscription? : any) : any; 63 | 64 | isFile() : File; 65 | 66 | isDirectory() : Directory; 67 | 68 | exists() : boolean; 69 | 70 | existsSync() : boolean; 71 | 72 | /** 73 | * Return a {Boolean}, true if this {Directory} is the root directory 74 | * of the filesystem, or false if it isn't. 75 | */ 76 | isRoot() : boolean; 77 | 78 | /** 79 | * 80 | * 81 | * This may include unfollowed symlinks or relative directory entries. Or it 82 | * may be fully resolved, it depends on what you give it. 83 | */ 84 | getPath() : string; 85 | 86 | /** 87 | * 88 | * 89 | * All relative directory entries are removed and symlinks are resolved to 90 | * their final destination. 91 | */ 92 | getRealPathSync() : string; 93 | 94 | getBaseName() : string; 95 | 96 | relativize(fullPath? : string) : string; 97 | 98 | /** 99 | * Given a relative path, this resolves it to an absolute path relative to this 100 | * directory. If the path is already absolute or prefixed with a URI scheme, it 101 | * is returned unchanged. 102 | * This field or method was marked private by atomdoc. Use with caution. 103 | * Returns a {String} containing an absolute path or `` if the given 104 | * URI is falsy. 105 | */ 106 | resolve(relativePath? : string) : string; 107 | 108 | /** 109 | * Traverse to the parent directory. 110 | * Returns a {Directory}. 111 | */ 112 | getParent() : Directory; 113 | 114 | /** 115 | * Traverse within this Directory to a child File. This method doesn't 116 | * actually check to see if the File exists, it just creates the File object. 117 | */ 118 | getFile(filename? : string) : File; 119 | 120 | /** 121 | * Traverse within this a Directory to a child Directory. This method 122 | * doesn't actually check to see if the Directory exists, it just creates the 123 | * Directory object. 124 | */ 125 | getSubdirectory(dirname? : string) : Directory; 126 | 127 | /** 128 | * Reads file entries in this directory from disk synchronously. 129 | * Returns an {Array} of {File} and {Directory} objects. 130 | */ 131 | getEntriesSync() : File[]; 132 | 133 | /** 134 | * Reads file entries in this directory from disk asynchronously. 135 | * @param callback? - A {Function} to call with the following arguments: 136 | */ 137 | getEntries(callback? : Function) : any; 138 | 139 | contains(pathToCheck? : string) : any; 140 | 141 | /** 142 | * Private 143 | * This field or method was marked private by atomdoc. Use with caution. 144 | */ 145 | subscribeToNativeChangeEvents() : any; 146 | 147 | /** 148 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 149 | */ 150 | unsubscribeFromNativeChangeEvents() : any; 151 | 152 | /** 153 | * Does given full path start with the given prefix? 154 | * This field or method was marked private by atomdoc. Use with caution. 155 | */ 156 | isPathPrefixOf(prefix? : boolean, fullPath? : string) : string; 157 | 158 | } 159 | 160 | /** 161 | * Represents an individual file that can be watched, read from, and 162 | * written to. 163 | */ 164 | export class File { 165 | /** 166 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 167 | */ 168 | symlink: any /* default */; 169 | 170 | /** 171 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 172 | */ 173 | encoding: string; 174 | 175 | /** 176 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 177 | */ 178 | realPath: string; 179 | 180 | /** 181 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 182 | */ 183 | subscriptionCount: number; 184 | 185 | /** 186 | * Configures a new File instance, no files are accessed. 187 | * @param filePath? - A {String} containing the absolute path to the file 188 | * @param symlink? - A {Boolean} indicating if the path is a symlink (default: false). 189 | */ 190 | constructor(filePath? : string, symlink? : boolean); 191 | 192 | /** 193 | * Creates the file on disk that corresponds to `::getPath()` if no 194 | * such file already exists. 195 | * Returns a {Promise} that resolves once the file is created on disk. It 196 | * resolves to a boolean value that is true if the file was created or false if 197 | * it already existed. 198 | */ 199 | create() : Q.Promise; 200 | 201 | /** 202 | * Invoke the given callback when the file's contents change. 203 | * @param callback - {Function} to be called when the file's contents change. 204 | */ 205 | onDidChange(callback : Function /* needs to be defined */) : EventKit.Disposable; 206 | 207 | /** 208 | * Invoke the given callback when the file's path changes. 209 | * @param callback - {Function} to be called when the file's path changes. 210 | */ 211 | onDidRename(callback : Function /* needs to be defined */) : EventKit.Disposable; 212 | 213 | /** 214 | * Invoke the given callback when the file is deleted. 215 | * @param callback - {Function} to be called when the file is deleted. 216 | */ 217 | onDidDelete(callback : Function /* needs to be defined */) : EventKit.Disposable; 218 | 219 | /** 220 | * Invoke the given callback when there is an error with the watch. 221 | * When your callback has been invoked, the file will have unsubscribed from 222 | * the file watches. 223 | * @param callback - {Function} callback 224 | */ 225 | onWillThrowWatchError(callback : Function) : EventKit.Disposable; 226 | 227 | /** 228 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 229 | */ 230 | willAddSubscription() : any; 231 | 232 | /** 233 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 234 | */ 235 | didRemoveSubscription() : any; 236 | 237 | /** 238 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 239 | */ 240 | trackUnsubscription(subscription? : any) : any; 241 | 242 | isFile() : File; 243 | 244 | isDirectory() : Directory; 245 | 246 | exists() : boolean; 247 | 248 | existsSync() : boolean; 249 | 250 | /** 251 | * Get the SHA-1 digest of this file 252 | * Returns a promise that resolves to a {String}. 253 | */ 254 | getDigest() : string; 255 | 256 | /** 257 | * Get the SHA-1 digest of this file 258 | * Returns a {String}. 259 | */ 260 | getDigestSync() : string; 261 | 262 | /** 263 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 264 | */ 265 | setDigest(contents? : any) : void; 266 | 267 | /** 268 | * Sets the file's character set encoding name. 269 | * @param encoding? - The {String} encoding to use (default: 'utf8') 270 | */ 271 | setEncoding(encoding? : string) : string; 272 | 273 | getEncoding() : string; 274 | 275 | getPath() : string; 276 | 277 | /** 278 | * Sets the path for the file. 279 | * This field or method was marked private by atomdoc. Use with caution. 280 | */ 281 | setPath(path? : string) : string; 282 | 283 | getRealPathSync() : string; 284 | 285 | getRealPath() : string; 286 | 287 | /** 288 | * Return the {String} filename without any directory information. 289 | */ 290 | getBaseName() : string; 291 | 292 | /** 293 | * Return the {Directory} that contains this file. 294 | */ 295 | getParent() : any; 296 | 297 | /** 298 | * Reading and Writing 299 | * This field or method was marked private by atomdoc. Use with caution. 300 | */ 301 | readSync(flushCache? : any) : any; 302 | 303 | /** 304 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 305 | */ 306 | writeFileSync(filePath? : string, contents? : any) : any; 307 | 308 | /** 309 | * Reads the contents of the file. 310 | * @param flushCache? - A {Boolean} indicating whether to require a direct read or if a cached copy is acceptable. 311 | * Returns a promise that resovles to a String. 312 | */ 313 | read(flushCache? : boolean) : any; 314 | 315 | /** 316 | * Overwrites the file with the given text. 317 | * @param text? - The {String} text to write to the underlying file. 318 | * Returns a {Promise} that resolves when the file has been written. 319 | */ 320 | write(text? : string) : Q.Promise; 321 | 322 | /** 323 | * Overwrites the file with the given text. 324 | * @param text? - The {String} text to write to the underlying file. 325 | * Returns . 326 | */ 327 | writeSync(text? : string) : any; 328 | 329 | /** 330 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 331 | */ 332 | writeFile(filePath? : string, contents? : any) : File; 333 | 334 | /** 335 | * Writes the text to specified path. 336 | * 337 | * Privilege escalation would be asked when current user doesn't have 338 | * permission to the path. 339 | * This field or method was marked private by atomdoc. Use with caution. 340 | */ 341 | writeFileWithPrivilegeEscalationSync(filePath? : string, text? : string) : any; 342 | 343 | /** 344 | * Private 345 | * This field or method was marked private by atomdoc. Use with caution. 346 | */ 347 | handleNativeChangeEvent(eventType? : any, eventPath? : string) : void; 348 | 349 | /** 350 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 351 | */ 352 | detectResurrectionAfterDelay() : any; 353 | 354 | /** 355 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 356 | */ 357 | detectResurrection() : any; 358 | 359 | /** 360 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 361 | */ 362 | subscribeToNativeChangeEvents() : any; 363 | 364 | /** 365 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 366 | */ 367 | unsubscribeFromNativeChangeEvents() : any; 368 | 369 | } 370 | 371 | /** 372 | * HandleWatcher 373 | * This class was not documented by atomdoc, assume it is private. Use with caution. 374 | */ 375 | class HandleWatcher /*extends NodeJS.EventEmitter*/ { 376 | /** 377 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 378 | */ 379 | path: string; 380 | 381 | /** 382 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 383 | */ 384 | constructor(path? : string); 385 | 386 | /** 387 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 388 | */ 389 | onEvent(event? : any, filePath? : string, oldFilePath? : string) : any; 390 | 391 | /** 392 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 393 | */ 394 | start() : void; 395 | 396 | /** 397 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 398 | */ 399 | closeIfNoListener() : void; 400 | 401 | /** 402 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 403 | */ 404 | close() : void; 405 | 406 | } 407 | 408 | /** 409 | * PathWatcher 410 | * This class was not documented by atomdoc, assume it is private. Use with caution. 411 | */ 412 | class PathWatcher /*extends NodeJS.EventEmitter*/ { 413 | /** 414 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 415 | */ 416 | isWatchingParent: boolean; 417 | 418 | /** 419 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 420 | */ 421 | path: string; 422 | 423 | /** 424 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 425 | */ 426 | handleWatcher: HandleWatcher; 427 | 428 | /** 429 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 430 | */ 431 | constructor(filePath? : string, callback? : any); 432 | 433 | /** 434 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 435 | */ 436 | close() : void; 437 | 438 | } 439 | 440 | } 441 | declare module "pathwatcher" { 442 | class Directory extends Pathwatcher.Directory {} 443 | class File extends Pathwatcher.File {} 444 | function watch(path:string, callback?: (event: any, newFilePath: string) => void ) : any; 445 | function closeAllWatchers() : void; 446 | function getWatchedPaths() : string[]; 447 | } 448 | -------------------------------------------------------------------------------- /typingsTemp/property-accessors/property-accessors.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for property-accessors (v1.1.3) 2 | // Project: https://github.com/atom/property-accessors 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | declare module PropertyAccessors { 9 | /** 10 | * PropertyAccessors 11 | * This class was not documented by atomdoc, assume it is private. Use with caution. 12 | */ 13 | class PropertyAccessors { 14 | /** 15 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 16 | */ 17 | accessor(name? : string, definition? : any) : any; 18 | 19 | /** 20 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 21 | */ 22 | advisedAccessor(name? : string, definition? : any) : any; 23 | 24 | /** 25 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 26 | */ 27 | lazyAccessor(name? : string, definition? : any) : any; 28 | 29 | } 30 | 31 | } 32 | declare module "property-accessors" { 33 | export = PropertyAccessors.PropertyAccessors; 34 | } 35 | -------------------------------------------------------------------------------- /typingsTemp/scandal/scandal.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for scandal (v2.0.0) 2 | // Project: https://github.com/atom/scandal 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | declare module Scandal { 9 | /** 10 | * {ChunkedExecutor} will execute on an {Array} paths in a pathQueue only 11 | * running a max of 20 of them concurrently. 12 | */ 13 | class ChunkedExecutor { 14 | /** 15 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 16 | */ 17 | execPathFn: string; 18 | 19 | /** 20 | * Construct a {ChunkedExecutor} 21 | * This field or method was marked private by atomdoc. Use with caution. 22 | * @param pathQueue? - {Array} of paths 23 | * @param execPathFn? - {Function} that will execute on each path 24 | */ 25 | constructor(pathQueue? : string, execPathFn? : string); 26 | 27 | /** 28 | * Begin execution of the `pathQueue` 29 | * @param doneCallback? - {Function} callback that will be called when execution is finished. 30 | */ 31 | execute(doneCallback? : Function) : any; 32 | 33 | /** 34 | * Push a new path on the queue 35 | * 36 | * May or may not execute immediately. 37 | * @param filePath? - {String} path to a file 38 | */ 39 | push(filePath? : string) : any; 40 | 41 | /** 42 | * Lifecycle Methods 43 | * This field or method was marked private by atomdoc. Use with caution. 44 | */ 45 | executeNextPathIfPossible() : string; 46 | 47 | /** 48 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 49 | */ 50 | executePath(filePath? : string) : string; 51 | 52 | /** 53 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 54 | */ 55 | checkIfFinished() : any; 56 | 57 | } 58 | 59 | /** 60 | * Will ensure data will be read on a line boundary. So this will always do the 61 | * right thing: 62 | */ 63 | class ChunkedLineReader /*extends .Readable*/ { 64 | /** 65 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 66 | */ 67 | static CHUNK_SIZE: any /* default */; 68 | 69 | /** 70 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 71 | */ 72 | static chunkedBuffer: any /* default */; 73 | 74 | /** 75 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 76 | */ 77 | static headerBuffer() : any; 78 | 79 | /** 80 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 81 | */ 82 | filePath: string; 83 | 84 | /** 85 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 86 | */ 87 | constructor(filePath? : string); 88 | 89 | /** 90 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 91 | */ 92 | isBinaryFile() : Pathwatcher.File; 93 | 94 | /** 95 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 96 | */ 97 | _read() : any; 98 | 99 | } 100 | 101 | /** 102 | * ChunkedScanner 103 | * This class was not documented by atomdoc, assume it is private. Use with caution. 104 | */ 105 | class ChunkedScanner extends ChunkedExecutor { 106 | /** 107 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 108 | */ 109 | scanner: FirstMate.Scanner; 110 | 111 | /** 112 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 113 | */ 114 | constructor(scanner? : FirstMate.Scanner, execPathFn? : string); 115 | 116 | /** 117 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 118 | */ 119 | execute(doneCallback? : any) : any; 120 | 121 | /** 122 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 123 | */ 124 | onFinishedScanning() : any; 125 | 126 | /** 127 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 128 | */ 129 | checkIfFinished() : any; 130 | 131 | } 132 | 133 | /** 134 | * {PathFilter} makes testing for path inclusion easy. 135 | */ 136 | class PathFilter { 137 | /** 138 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 139 | */ 140 | static MINIMATCH_OPTIONS: boolean; 141 | 142 | /** 143 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 144 | */ 145 | static escapeRegExp(str? : any) : any; 146 | 147 | /** 148 | * Construct a {PathFilter} 149 | * @param rootPath? - {String} top level directory to scan. eg. `/Users/ben/somedir` 150 | * @param options? - {Object} options hash 151 | * @param inclusions? - {Array} of patterns to include. Uses minimatch with a couple additions: `['dirname']` and `['dirname/']` will match all paths in directory dirname. 152 | * @param exclusions? - {Array} of patterns to exclude. Same matcher as inclusions. 153 | * @param includeHidden? - {Boolean} default false; true includes hidden files 154 | * @param excludeVcsIgnores? - {Boolean}; default false; true to exclude paths defined in a .gitignore. Uses git-utils to check ignred files. 155 | */ 156 | constructor(rootPath? : string, options? : { inclusions? : any[],exclusions? : any[],includeHidden? : boolean,excludeVcsIgnores? : boolean }); 157 | 158 | /** 159 | * Test if the `filepath` is accepted as a file based on the 160 | * constructing options. 161 | * @param filepath? - {String} path to a file. File should be a file and should exist 162 | */ 163 | isFileAccepted(filepath? : string) : boolean; 164 | 165 | /** 166 | * Test if the `filepath` is accepted as a directory based on the 167 | * constructing options. 168 | * @param filepath? - {String} path to a directory. File should be a directory and should exist 169 | */ 170 | isDirectoryAccepted(filepath? : string) : boolean; 171 | 172 | /** 173 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 174 | */ 175 | isPathAccepted(fileOrDirectory? : Pathwatcher.Directory, filepath? : string) : string; 176 | 177 | /** 178 | * Private Methods 179 | * This field or method was marked private by atomdoc. Use with caution. 180 | */ 181 | isPathIgnored(fileOrDirectory? : Pathwatcher.Directory, filepath? : string) : string; 182 | 183 | /** 184 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 185 | */ 186 | isPathIncluded(fileOrDirectory? : Pathwatcher.Directory, filepath? : string) : string; 187 | 188 | /** 189 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 190 | */ 191 | excludeHidden() : any; 192 | 193 | /** 194 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 195 | */ 196 | createMatchers(patterns? : FirstMate.Pattern[], deepMatch? : any) : any; 197 | 198 | } 199 | 200 | /** 201 | * Scans a directory and emits events when paths matching input options 202 | * have been found. 203 | */ 204 | class PathScanner /*extends NodeJS.EventEmitter*/ { 205 | /** 206 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 207 | */ 208 | rootPath: string; 209 | 210 | /** 211 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 212 | */ 213 | options: any /* default */; 214 | 215 | /** 216 | * Create a {PathScanner} object. 217 | * @param rootPath? - {String} top level directory to scan. eg. `/Users/ben/somedir` 218 | * @param options? - {Object} options hash 219 | */ 220 | constructor(rootPath? : string, options? : Object); 221 | 222 | /** 223 | * Begin the scan 224 | */ 225 | scan() : any; 226 | 227 | /** 228 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 229 | */ 230 | readDir(filePath? : string) : any; 231 | 232 | /** 233 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 234 | */ 235 | relativize(filePath? : string) : any; 236 | 237 | /** 238 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 239 | */ 240 | processFile(filePath? : string) : Pathwatcher.File; 241 | 242 | /** 243 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 244 | */ 245 | stat(filePath? : string) : any; 246 | 247 | /** 248 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 249 | */ 250 | asyncCallStarting() : any; 251 | 252 | /** 253 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 254 | */ 255 | asyncCallDone() : any; 256 | 257 | } 258 | 259 | /** 260 | * Will search through paths specified for a regex. 261 | */ 262 | class PathSearcher /*extends NodeJS.EventEmitter*/ { 263 | /** 264 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 265 | */ 266 | maxLineLength: number; 267 | 268 | /** 269 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 270 | */ 271 | wordBreakRegex: any /* default */; 272 | 273 | /** 274 | * Construct a {PathSearcher} object. 275 | */ 276 | constructor({ maxLineLength, wordBreakRegex } : { maxLineLength? : number; wordBreakRegex? : any }); 277 | 278 | /** 279 | * Search an array of paths. 280 | * 281 | * Will search with a {ChunkedExecutor} so as not to immediately exhaust all 282 | * the available file descriptors. The {ChunkedExecutor} will execute 20 paths 283 | * concurrently. 284 | * @param regex? - {RegExp} search pattern 285 | * @param paths? - {Array} of {String} file paths to search 286 | * @param doneCallback? - called when searching the entire array of paths has finished 287 | */ 288 | searchPaths(regex? : RegExp, paths? : string, doneCallback? : any) : string; 289 | 290 | /** 291 | * Search a file path for a regex 292 | * @param regex? - {RegExp} search pattern 293 | * @param filePath? - {String} file path to search 294 | * @param doneCallback? - called when searching the entire array of paths has finished 295 | */ 296 | searchPath(regex? : RegExp, filePath? : string, doneCallback? : any) : string; 297 | 298 | /** 299 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 300 | */ 301 | searchLine(regex? : any, line? : number, lineNumber? : any) : number; 302 | 303 | /** 304 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 305 | */ 306 | findWordBreak(line? : number, offset? : any, increment? : any) : any; 307 | 308 | } 309 | 310 | } 311 | declare module "scandal" { 312 | var main: any; 313 | var replace: any; 314 | class PathSearcher extends Scandal.PathSearcher {} 315 | class PathScanner extends Scandal.PathScanner {} 316 | var PathReplacer: any; 317 | export = Serializable.Serializable; 318 | } 319 | -------------------------------------------------------------------------------- /typingsTemp/scoped-property-store/scoped-property-store.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for scoped-property-store (v0.17.0) 2 | // Project: https://github.com/atom/scoped-property-store 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | declare module ScopedPropertyStore { 10 | /** 11 | * PropertySet 12 | * This class was not documented by atomdoc, assume it is private. Use with caution. 13 | */ 14 | class PropertySet { 15 | /** 16 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 17 | */ 18 | source: any /* default */; 19 | 20 | /** 21 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 22 | */ 23 | selector: Selector; 24 | 25 | /** 26 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 27 | */ 28 | properties: any /* default */; 29 | 30 | /** 31 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 32 | */ 33 | constructor(source? : any, selector? : Selector, properties? : any); 34 | 35 | /** 36 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 37 | */ 38 | matches(scope? : Atom.Scope) : any; 39 | 40 | /** 41 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 42 | */ 43 | compare(other? : any) : any; 44 | 45 | /** 46 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 47 | */ 48 | merge(other? : any) : any; 49 | 50 | /** 51 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 52 | */ 53 | has(keyPath? : string) : any; 54 | 55 | /** 56 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 57 | */ 58 | get(keyPath? : string) : any; 59 | 60 | } 61 | 62 | /** 63 | * 64 | */ 65 | class ScopedPropertyStore { 66 | /** 67 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 68 | */ 69 | constructor(); 70 | 71 | /** 72 | * Add scoped properties to be queried with {::get} 73 | * @param source? - A string describing these properties to allow them to be removed later. 74 | * @param propertiesBySelector? - An {Object} containing CSS-selectors mapping to {Objects} containing properties. For example: `{'.foo .bar': {x: 1, y: 2}` 75 | */ 76 | addProperties(source? : any, propertiesBySelector? : Selector, options? : any) : void; 77 | 78 | /** 79 | * Get the value of a previously stored key-path in a given scope. 80 | * @param scopeChain? - This describes a location in the document. It uses the same syntax as selectors, with each space-separated component representing one element. 81 | * @param keyPath? - A `.` separated string of keys to traverse in the properties. 82 | * @param options? - {Object} 83 | * Returns the property value or `` if none is found. 84 | */ 85 | getPropertyValue(scopeChain? : any, keyPath? : string, options? : Object) : any; 86 | 87 | /** 88 | * Get *all* values for the given key-path in a given scope. 89 | */ 90 | getAll(scopeChain? : any, keyPath? : string, options? : any) : any; 91 | 92 | /** 93 | * Get *all* properties for a given source. 94 | * @param source? - {String} 95 | * Returns an {Object} in the format {scope: {property: value}} 96 | */ 97 | propertiesForSource(source? : string) : Object; 98 | 99 | /** 100 | * Get *all* properties matching the given source and scopeSelector. 101 | * @param source? - {String} 102 | * @param scopeSelector? - {String} `scopeSelector` is matched exactly. 103 | */ 104 | propertiesForSourceAndSelector(source? : string, scopeSelector? : string) : Selector; 105 | 106 | /** 107 | * Get *all* properties matching the given scopeSelector. 108 | * @param scopeSelector? - {String} `scopeSelector` is matched exactly. 109 | */ 110 | propertiesForSelector(scopeSelector? : string) : Selector; 111 | 112 | /** 113 | * Remove all properties for a given source. 114 | * @param source? - {String} 115 | */ 116 | removePropertiesForSource(source? : string) : void; 117 | 118 | /** 119 | * Remove all properties for a given source. 120 | * @param source? - {String} 121 | * @param scopeSelector? - {String} `scopeSelector` is matched exactly. 122 | */ 123 | removePropertiesForSourceAndSelector(source? : string, scopeSelector? : string) : Selector; 124 | 125 | /** 126 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 127 | */ 128 | mergeMatchingPropertySets(propertySets? : PropertySet[]) : PropertySet[]; 129 | 130 | /** 131 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 132 | */ 133 | bustCache() : any; 134 | 135 | /** 136 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 137 | */ 138 | withCaching(cacheKey? : any, skipCache? : any, callback? : any) : any; 139 | 140 | /** 141 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 142 | */ 143 | addPropertySet(propertySet? : PropertySet) : PropertySet; 144 | 145 | /** 146 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 147 | */ 148 | parseScopeChain(scopeChain? : any) : any; 149 | 150 | } 151 | 152 | /** 153 | * Selector 154 | * This class was not documented by atomdoc, assume it is private. Use with caution. 155 | */ 156 | class Selector { 157 | /** 158 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 159 | */ 160 | static create(source? : any, options? : any) : any; 161 | 162 | /** 163 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 164 | */ 165 | static parsePseudoSelectors(selectorComponent? : any) : Selector[]; 166 | 167 | /** 168 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 169 | */ 170 | selector: Selector; 171 | 172 | /** 173 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 174 | */ 175 | constructor(selector? : Selector, options? : any); 176 | 177 | /** 178 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 179 | */ 180 | matches(scopeChain? : any) : any; 181 | 182 | /** 183 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 184 | */ 185 | selectorComponentMatchesScope(selectorComponent? : any, scope? : Atom.Scope) : Atom.Scope; 186 | 187 | /** 188 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 189 | */ 190 | compare(other? : any) : any; 191 | 192 | /** 193 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 194 | */ 195 | isEqual(other? : boolean) : boolean; 196 | 197 | /** 198 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 199 | */ 200 | calculateSpecificity() : any; 201 | 202 | /** 203 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 204 | */ 205 | toString() : any; 206 | 207 | } 208 | 209 | } 210 | declare module "scoped-property-store" { 211 | export = ScopedPropertyStore.ScopedPropertyStore; 212 | } 213 | -------------------------------------------------------------------------------- /typingsTemp/serializable/serializable.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for serializable (v1.0.0) 2 | // Project: https://github.com/atom/serializable 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | declare module Serializable { 9 | /** 10 | * Serializable 11 | * This class was not documented by atomdoc, assume it is private. Use with caution. 12 | */ 13 | class Serializable { 14 | /** 15 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 16 | */ 17 | static registerDeserializers(deserializers? : any) : any; 18 | 19 | /** 20 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 21 | */ 22 | static registerDeserializer(deserializer? : any) : any; 23 | 24 | /** 25 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 26 | */ 27 | static deserialize(state? : any, params? : any) : any; 28 | 29 | /** 30 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 31 | */ 32 | deserializers: any /* default */; 33 | 34 | /** 35 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 36 | */ 37 | serialize() : any; 38 | 39 | /** 40 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 41 | */ 42 | testSerialization(params? : any) : any; 43 | 44 | } 45 | 46 | } 47 | declare module "serializable" { 48 | } 49 | -------------------------------------------------------------------------------- /typingsTemp/status-bar/status-bar.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for status-bar (v0.67.0) 2 | // Project: https://github.com/atom/status-bar 3 | // Definitions by: david-driscoll 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | // Generated by: https://github.com/david-driscoll/atom-typescript-generator 7 | // Generation tool by david-driscoll 8 | /// 9 | declare module StatusBar { 10 | /** 11 | * CursorPositionView 12 | * This class was not documented by atomdoc, assume it is private. Use with caution. 13 | */ 14 | class CursorPositionView /*extends HTMLElement*/ { 15 | /** 16 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 17 | */ 18 | initialize() : boolean; 19 | 20 | /** 21 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 22 | */ 23 | destroy() : void; 24 | 25 | /** 26 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 27 | */ 28 | subscribeToActiveTextEditor() : Atom.TextEditor; 29 | 30 | /** 31 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 32 | */ 33 | getActiveTextEditor() : Atom.TextEditor; 34 | 35 | /** 36 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 37 | */ 38 | updatePosition() : TextBuffer.Point; 39 | 40 | } 41 | 42 | /** 43 | * FileInfoView 44 | * This class was not documented by atomdoc, assume it is private. Use with caution. 45 | */ 46 | class FileInfoView /*extends HTMLElement*/ { 47 | /** 48 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 49 | */ 50 | initialize() : boolean; 51 | 52 | /** 53 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 54 | */ 55 | subscribeToActiveItem() : any; 56 | 57 | /** 58 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 59 | */ 60 | destroy() : void; 61 | 62 | /** 63 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 64 | */ 65 | getActiveItem() : any; 66 | 67 | /** 68 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 69 | */ 70 | update() : void; 71 | 72 | /** 73 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 74 | */ 75 | updateBufferHasModifiedText(isModified? : any) : string; 76 | 77 | /** 78 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 79 | */ 80 | updatePathText() : string; 81 | 82 | } 83 | 84 | /** 85 | * GitView 86 | * This class was not documented by atomdoc, assume it is private. Use with caution. 87 | */ 88 | class GitView /*extends HTMLElement*/ { 89 | /** 90 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 91 | */ 92 | initialize() : boolean; 93 | 94 | /** 95 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 96 | */ 97 | createBranchArea() : any; 98 | 99 | /** 100 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 101 | */ 102 | createCommitsArea() : any; 103 | 104 | /** 105 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 106 | */ 107 | createStatusArea() : any; 108 | 109 | /** 110 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 111 | */ 112 | subscribeToActiveItem() : any; 113 | 114 | /** 115 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 116 | */ 117 | subscribeToRepositories() : any; 118 | 119 | /** 120 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 121 | */ 122 | destroy() : void; 123 | 124 | /** 125 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 126 | */ 127 | getActiveItemPath() : string; 128 | 129 | /** 130 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 131 | */ 132 | getRepositoryForActiveItem() : any; 133 | 134 | /** 135 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 136 | */ 137 | getActiveItem() : any; 138 | 139 | /** 140 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 141 | */ 142 | update() : void; 143 | 144 | /** 145 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 146 | */ 147 | updateBranchText(repo? : any) : string; 148 | 149 | /** 150 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 151 | */ 152 | showBranchInformation() : any; 153 | 154 | /** 155 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 156 | */ 157 | updateAheadBehindCount(repo? : any) : number; 158 | 159 | /** 160 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 161 | */ 162 | updateStatusText(repo? : any) : string; 163 | 164 | } 165 | 166 | /** 167 | * LaunchModeView 168 | * This class was not documented by atomdoc, assume it is private. Use with caution. 169 | */ 170 | class LaunchModeView /*extends HTMLElement*/ { 171 | /** 172 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 173 | */ 174 | initialize({ safeMode, devMode } : { safeMode? : boolean; devMode? : boolean }) : boolean; 175 | 176 | /** 177 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 178 | */ 179 | detachedCallback() : any; 180 | 181 | } 182 | 183 | /** 184 | * SelectionCountView 185 | * This class was not documented by atomdoc, assume it is private. Use with caution. 186 | */ 187 | class SelectionCountView /*extends HTMLElement*/ { 188 | /** 189 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 190 | */ 191 | initialize() : boolean; 192 | 193 | /** 194 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 195 | */ 196 | destroy() : void; 197 | 198 | /** 199 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 200 | */ 201 | subscribeToActiveTextEditor() : Atom.TextEditor; 202 | 203 | /** 204 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 205 | */ 206 | getActiveTextEditor() : Atom.TextEditor; 207 | 208 | /** 209 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 210 | */ 211 | updateCount() : number; 212 | 213 | } 214 | 215 | /** 216 | * StatusBarView 217 | * This class was not documented by atomdoc, assume it is private. Use with caution. 218 | */ 219 | class StatusBarView /*extends HTMLElement*/ { 220 | /** 221 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 222 | */ 223 | createdCallback() : any; 224 | 225 | /** 226 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 227 | */ 228 | initialize(state? : boolean) : boolean; 229 | 230 | /** 231 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 232 | */ 233 | destroy() : void; 234 | 235 | /** 236 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 237 | */ 238 | addLeftTile(options? : any) : Tile; 239 | 240 | /** 241 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 242 | */ 243 | addRightTile(options? : any) : Tile; 244 | 245 | /** 246 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 247 | */ 248 | getLeftTiles() : Tile[]; 249 | 250 | /** 251 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 252 | */ 253 | getRightTiles() : Tile[]; 254 | 255 | /** 256 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 257 | */ 258 | appendLeft(view? : any) : any; 259 | 260 | /** 261 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 262 | */ 263 | prependLeft(view? : any) : any; 264 | 265 | /** 266 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 267 | */ 268 | appendRight(view? : any) : any; 269 | 270 | /** 271 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 272 | */ 273 | prependRight(view? : any) : any; 274 | 275 | /** 276 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 277 | */ 278 | getActiveBuffer() : any; 279 | 280 | /** 281 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 282 | */ 283 | getActiveItem() : any; 284 | 285 | /** 286 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 287 | */ 288 | storeActiveBuffer() : void; 289 | 290 | /** 291 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 292 | */ 293 | subscribeToBuffer(event? : any, callback? : any) : any; 294 | 295 | /** 296 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 297 | */ 298 | subscribeAllToBuffer() : any; 299 | 300 | /** 301 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 302 | */ 303 | unsubscribeAllFromBuffer() : any; 304 | 305 | } 306 | 307 | /** 308 | * Tile 309 | * This class was not documented by atomdoc, assume it is private. Use with caution. 310 | */ 311 | class Tile { 312 | /** 313 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 314 | */ 315 | item: any /* default */; 316 | 317 | /** 318 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 319 | */ 320 | priority: any /* default */; 321 | 322 | /** 323 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 324 | */ 325 | collection: any /* default */; 326 | 327 | /** 328 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 329 | */ 330 | constructor(item? : any, priority? : any, collection? : any); 331 | 332 | /** 333 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 334 | */ 335 | getItem() : any; 336 | 337 | /** 338 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 339 | */ 340 | getPriority() : any; 341 | 342 | /** 343 | * This field or method was not documented by atomdoc, assume it is private. Use with caution. 344 | */ 345 | destroy() : void; 346 | 347 | } 348 | 349 | } 350 | 351 | // Found @ https://github.com/atom/status-bar/blob/master/lib/main.coffee 352 | declare module "status-bar" { 353 | function activate(state?: any); 354 | function activate(); 355 | } 356 | --------------------------------------------------------------------------------