mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
improve atom/atom.d.ts and pathwatcher/pathwatcher.d.ts
This commit is contained in:
parent
1a9fbf4e1e
commit
8ef3356a35
45
atom/atom.d.ts
vendored
45
atom/atom.d.ts
vendored
@ -7,6 +7,7 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="../space-pen/space-pen.d.ts" />
|
||||
/// <reference path="../emissary/emissary.d.ts" />
|
||||
/// <reference path="../pathwatcher/pathwatcher.d.ts" />
|
||||
/// <reference path="../text-buffer/text-buffer.d.ts" />
|
||||
/// <reference path="../status-bar/status-bar.d.ts" />
|
||||
|
||||
@ -41,7 +42,7 @@ declare module AtomCore {
|
||||
|
||||
// delegate to model property's method
|
||||
open(uri:string, options:any):Q.Promise<View>;
|
||||
openSync(uri:string, options:any):any;
|
||||
openSync(uri:string, options?:any):any;
|
||||
saveActivePaneItem():any;
|
||||
saveActivePaneItemAs():any;
|
||||
saveAll():void;
|
||||
@ -823,8 +824,46 @@ declare module AtomCore {
|
||||
height:number;
|
||||
}
|
||||
|
||||
interface IProject {
|
||||
// TBD
|
||||
interface IProjectStatic {
|
||||
pathForRepositoryUrl(repoUrl:string):string;
|
||||
|
||||
new (arg?:{path:any; buffers:any[];}):IProject;
|
||||
}
|
||||
|
||||
interface IProject /* extends Theorist.Model */ {
|
||||
// Serializable.includeInto(Project);
|
||||
|
||||
path:string;
|
||||
rootDirectory:PathWatcher.IDirectory;
|
||||
|
||||
serializeParams():any;
|
||||
deserializeParams(params:any):any;
|
||||
destroyed():any;
|
||||
destroyRepo():any;
|
||||
destroyUnretainedBuffers():any;
|
||||
getRepo():IGit;
|
||||
getPath():string;
|
||||
setPath(projectPath:string):any;
|
||||
getRootDirectory():PathWatcher.IDirectory;
|
||||
resolve(uri:string):string;
|
||||
relativize(fullPath:string):string;
|
||||
contains(pathToCheck:string):boolean;
|
||||
open(filePath:string, options?:any):Q.Promise<IEditor>;
|
||||
openSync(filePath:string, options?:any):IEditor;
|
||||
getBuffers():TextBuffer.ITextBuffer;
|
||||
isPathModified(filePath:string):boolean;
|
||||
findBufferForPath(filePath:string):TextBuffer.ITextBuffer;
|
||||
bufferForPathSync(filePath:string):TextBuffer.ITextBuffer;
|
||||
bufferForPath(filePath:string):Q.Promise<TextBuffer.ITextBuffer>;
|
||||
bufferForId(id:any):TextBuffer.ITextBuffer;
|
||||
buildBufferSync(absoluteFilePath:string):TextBuffer.ITextBuffer;
|
||||
buildBuffer(absoluteFilePath:string):Q.Promise<TextBuffer.ITextBuffer>;
|
||||
addBuffer(buffer:TextBuffer.ITextBuffer, options?:any):any;
|
||||
addBufferAtIndex(buffer:TextBuffer.ITextBuffer, index:number, options?:any):any;
|
||||
scan(regex:any, options:any, iterator:any):Q.Promise<any>;
|
||||
replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise<any>;
|
||||
buildEditorForBuffer(buffer:any, editorOptions:any):IEditor;
|
||||
eachBuffer(...args:any[]):any;
|
||||
}
|
||||
|
||||
interface IWorkspaceStatic {
|
||||
|
||||
44
pathwatcher/pathwatcher.d.ts
vendored
44
pathwatcher/pathwatcher.d.ts
vendored
@ -6,25 +6,7 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
|
||||
declare module "pathwatcher" {
|
||||
|
||||
import events = require("events");
|
||||
|
||||
interface IHandleWatcher extends events.EventEmitter {
|
||||
onEvent(event:any, filePath:any, oldFilePath:any):any;
|
||||
start():void;
|
||||
closeIfNoListener():void;
|
||||
close():void;
|
||||
}
|
||||
|
||||
interface IPathWatcher {
|
||||
isWatchingParent:boolean;
|
||||
path:any;
|
||||
handleWatcher:IHandleWatcher;
|
||||
|
||||
close():void;
|
||||
}
|
||||
|
||||
declare module PathWatcher {
|
||||
interface IFileStatic {
|
||||
new (path:string, symlink?:boolean):IFile;
|
||||
}
|
||||
@ -75,6 +57,26 @@ declare module "pathwatcher" {
|
||||
unsubscribeFromNativeChangeEvents():void;
|
||||
isPathPrefixOf(prefix:string, fullPath:string):boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "pathwatcher" {
|
||||
|
||||
import events = require("events");
|
||||
|
||||
interface IHandleWatcher extends events.EventEmitter {
|
||||
onEvent(event:any, filePath:any, oldFilePath:any):any;
|
||||
start():void;
|
||||
closeIfNoListener():void;
|
||||
close():void;
|
||||
}
|
||||
|
||||
interface IPathWatcher {
|
||||
isWatchingParent:boolean;
|
||||
path:any;
|
||||
handleWatcher:IHandleWatcher;
|
||||
|
||||
close():void;
|
||||
}
|
||||
|
||||
function watch(path:string, callback:Function):IPathWatcher;
|
||||
|
||||
@ -82,6 +84,6 @@ declare module "pathwatcher" {
|
||||
|
||||
function getWatchedPaths():string[];
|
||||
|
||||
var File:IFileStatic;
|
||||
var Directory:IDirectoryStatic;
|
||||
var File:PathWatcher.IFileStatic;
|
||||
var Directory:PathWatcher.IDirectoryStatic;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user