Skip to content

Commit

Permalink
Update atom' flow definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
GauthierPLM committed Dec 17, 2018
1 parent bc170fe commit a99d35a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion flow-libs/atom.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ declare class atom$Package {
getType(): 'atom' | 'textmate' | 'theme',
hasActivationCommands(): boolean,
hasActivationHooks(): boolean,
initializeTime: number,
getActivationHooks(): Array<string>,
onDidDeactivate(cb: () => mixed): IDisposable,
activateNow(): void,
Expand Down Expand Up @@ -296,6 +297,7 @@ declare class atom$Disposable {
}

declare class atom$Emitter {
static onEventHandlerException(error: any): IDisposable,
dispose(): void,
on(name: string, callback: (v: any) => mixed): IDisposable,
once(name: string, callback: (v: any) => mixed): IDisposable,
Expand Down Expand Up @@ -403,6 +405,7 @@ declare class atom$PackageManager {
getLoadedPackage(name: string): ?atom$Package,
getLoadedPackages(): Array<atom$Package>,
isPackageLoaded(name: string): boolean,
hasLoadedInitialPackages(): boolean,

// Accessing available packages
getAvailablePackageNames(): Array<string>,
Expand All @@ -413,6 +416,7 @@ declare class atom$PackageManager {
deactivatePackages(): Promise<void>,
deactivatePackage(name: string, suppressSerialization?: boolean): Promise<void>,
emitter: atom$Emitter,
loadedPackages: {[packageName: string]: atom$Package},
loadPackage(name: string): void,
loadPackages(): void,
serializePackage(pkg: atom$Package): void,
Expand Down Expand Up @@ -531,6 +535,7 @@ declare class atom$Pane {
setActiveItem(item: Object): Object,
setFlexScale(flexScale: number): number,
getContainer(): atom$PaneContainer,
getActiveEditor(): ?atom$TextEditor,

element: HTMLElement,
}
Expand Down Expand Up @@ -648,12 +653,19 @@ declare class atom$Range {
object: atom$RangeLike,
copy?: boolean,
): atom$Range,
static fromPointWithDelta(
startPoint: atom$PointLike,
rowDelta: number,
columnDelta: number
): atom$Range,

constructor(pointA: atom$PointLike, pointB: atom$PointLike): void,
compare(other: atom$Range): number,
start: atom$Point,
end: atom$Point,
isEmpty(): boolean,
isEqual(otherRange: atom$RangeLike): boolean,
isSingleLine(): boolean,
intersectsWith(otherRange: atom$RangeLike, exclusive?: boolean): boolean,
containsPoint(point: atom$PointLike, exclusive?: boolean): boolean,
containsRange(other: atom$Range, exclusive?: boolean): boolean,
Expand Down Expand Up @@ -853,6 +865,7 @@ declare class atom$TextEditor extends atom$Model {
onDidChangeSoftWrapped(callback: (softWrapped: boolean) => mixed): IDisposable,
onDidChangeSelectionRange(callback: (event: atom$ChangeSelectionRangeEvent) => mixed): IDisposable,
observeSelections(callback: (selection: atom$Selection) => mixed): IDisposable,
onDidAddSelection(callback: (selection: atom$Selection) => mixed): IDisposable,

// File Details
getTitle: () => string,
Expand Down Expand Up @@ -932,6 +945,7 @@ declare class atom$TextEditor extends atom$Model {
getVisibleRowRange(): [number, number],
bufferRowForScreenRow(screenRow: number): number,
screenRangeForBufferRange(bufferRange: atom$RangeLike): atom$Range,
bufferRangeForBufferRow(bufferRow: number): atom$Range,

// Decorations
decorateMarker(marker: atom$Marker, decorationParams: DecorateMarkerParams): atom$Decoration,
Expand Down Expand Up @@ -982,6 +996,7 @@ declare class atom$TextEditor extends atom$Model {
unfoldBufferRow(bufferRow: number): void,

// Selections
getLastSelection(): atom$Selection,
getSelectedText(): string,
selectAll(): void,
getSelectedBufferRange(): atom$Range,
Expand Down Expand Up @@ -1023,7 +1038,7 @@ declare class atom$TextEditor extends atom$Model {
scan(
regex: RegExp,
iterator: (foundMatch: {
match: mixed,
match: RegExp$matchResult,
matchText: string,
range: atom$Range,
stop: () => mixed,
Expand Down Expand Up @@ -1746,6 +1761,7 @@ declare class atom$Project {
onDidAddBuffer(callback: (buffer: atom$TextBuffer) => mixed): IDisposable,
onDidReplace((settings: atom$ProjectSpecification) => mixed): IDisposable,
observeBuffers(callback: (buffer: atom$TextBuffer) => mixed): IDisposable,
observeRepositories(callback: (repository: atom$Repository)=> mixed): IDisposable,
replace?: (newSettings: atom$ProjectSpecification) => void,
// Accessing the git repository
getRepositories(): Array<?atom$Repository>,
Expand Down Expand Up @@ -2221,6 +2237,7 @@ declare class atom$Selection {
undo?: boolean,
},
): string,
isEmpty(): boolean,
}

declare class atom$PanelContainer {
Expand Down

0 comments on commit a99d35a

Please sign in to comment.