improve atom/atom.d.ts and pathwatcher/pathwatcher.d.ts

This commit is contained in:
vvakame 2014-05-11 01:32:28 +09:00 committed by AdaskoTheBeAsT
parent 1a9fbf4e1e
commit 8ef3356a35
2 changed files with 65 additions and 24 deletions

45
atom/atom.d.ts vendored
View File

@ -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 {

View File

@ -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;
}