docs(file): fix methods private exposed (#509)

This commit is contained in:
Ibrahim Hadeed 2016-08-30 23:49:20 -04:00 committed by GitHub
commit 04b24d255e

View File

@ -950,11 +950,16 @@ export class File {
// these private methods help avoid cascading error handling // these private methods help avoid cascading error handling
// in the public ones, primarily simply wrapping callback // in the public ones, primarily simply wrapping callback
// operations to return Promises that can then be chained. // operations to return Promises that can then be chained.
/**
* @private
*/
private static fillErrorMessage(err: FileError): void { private static fillErrorMessage(err: FileError): void {
err.message = File.cordovaFileError[err.code]; err.message = File.cordovaFileError[err.code];
} }
/**
* @private
*/
private static resolveLocalFilesystemUrl(furl: string): Promise<Entry> { private static resolveLocalFilesystemUrl(furl: string): Promise<Entry> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
@ -971,6 +976,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static resolveDirectoryUrl(durl: string): Promise<DirectoryEntry> { private static resolveDirectoryUrl(durl: string): Promise<DirectoryEntry> {
return File.resolveLocalFilesystemUrl(durl) return File.resolveLocalFilesystemUrl(durl)
.then((de) => { .then((de) => {
@ -984,6 +992,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static getDirectory(fse: DirectoryEntry, dn: string, flags: Flags): Promise<DirectoryEntry> { private static getDirectory(fse: DirectoryEntry, dn: string, flags: Flags): Promise<DirectoryEntry> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
@ -1000,6 +1011,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static getFile(fse: DirectoryEntry, fn: string, flags: Flags): Promise<FileEntry> { private static getFile(fse: DirectoryEntry, fn: string, flags: Flags): Promise<FileEntry> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
@ -1016,6 +1030,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static remove(fe: Entry): Promise<RemoveResult> { private static remove(fe: Entry): Promise<RemoveResult> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fe.remove(() => { fe.remove(() => {
@ -1027,6 +1044,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static move(srce: Entry, destdir: DirectoryEntry, newName: string): Promise<Entry> { private static move(srce: Entry, destdir: DirectoryEntry, newName: string): Promise<Entry> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
srce.moveTo(destdir, newName, (deste) => { srce.moveTo(destdir, newName, (deste) => {
@ -1038,6 +1058,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static copy(srce: Entry, destdir: DirectoryEntry, newName: string): Promise<Entry> { private static copy(srce: Entry, destdir: DirectoryEntry, newName: string): Promise<Entry> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
srce.copyTo(destdir, newName, (deste) => { srce.copyTo(destdir, newName, (deste) => {
@ -1049,6 +1072,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static readEntries(dr: DirectoryReader): Promise<Entry[]> { private static readEntries(dr: DirectoryReader): Promise<Entry[]> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
dr.readEntries((entries) => { dr.readEntries((entries) => {
@ -1060,6 +1086,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static rimraf(de: DirectoryEntry): Promise<RemoveResult> { private static rimraf(de: DirectoryEntry): Promise<RemoveResult> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
de.removeRecursively(() => { de.removeRecursively(() => {
@ -1071,6 +1100,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static createWriter(fe: FileEntry): Promise<FileWriter> { private static createWriter(fe: FileEntry): Promise<FileWriter> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fe.createWriter((writer) => { fe.createWriter((writer) => {
@ -1082,6 +1114,9 @@ export class File {
}); });
} }
/**
* @private
*/
private static write(writer: FileWriter, gu: string | Blob): Promise<void> { private static write(writer: FileWriter, gu: string | Blob): Promise<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
writer.onwriteend = (evt) => { writer.onwriteend = (evt) => {