@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
152 lines (151 loc) • 6.96 kB
TypeScript
import type { IFileSystemAccess } from './file-system-access';
export declare class FileSystemAccess implements IFileSystemAccess {
private _pathSeparator;
getLastModified(path: string): Date;
getFileSize(path: string): number;
getParent(path: string, onError?: (error: any) => any): {
path: string;
name: string;
};
getFile(path: string, onError?: (error: any) => any): {
path: string;
name: string;
extension: string;
};
getFolder(path: string, onError?: (error: any) => any): {
path: string;
name: string;
};
eachEntity(path: string, onEntity: (file: {
path: string;
name: string;
extension: string;
}) => boolean, onError?: (error: any) => any): void;
getEntities(path: string, onError?: (error: any) => any): Array<{
path: string;
name: string;
extension: string;
}>;
fileExists(path: string): boolean;
folderExists(path: string): boolean;
deleteFile(path: string, onError?: (error: any) => any): void;
deleteFolder(path: string, onError?: (error: any) => any): void;
emptyFolder(path: string, onError?: (error: any) => any): void;
rename(path: string, newPath: string, onError?: (error: any) => any): void;
getDocumentsFolderPath(): string;
getExternalDocumentsFolderPath(): string;
getLogicalRootPath(): string;
getTempFolderPath(): string;
getCurrentAppPath(): string;
copy: any;
copySync(src: string, dest: string, onError?: (error: any) => any): boolean;
copyAsync(src: string, dest: string): Promise<boolean>;
readBuffer: any;
readBufferAsync(path: string): Promise<ArrayBuffer>;
readBufferSync(path: string, onError?: (error: any) => any): ArrayBuffer;
read: any;
readAsync(path: string): Promise<number[]>;
readSync(path: string, onError?: (error: any) => any): any;
static getBuffer(buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray): any;
appendBuffer: any;
appendBufferAsync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray): Promise<void>;
appendBufferSync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray, onError?: (error: any) => any): void;
append: any;
appendAsync(path: string, bytes: androidNative.Array<number>): Promise<void>;
appendSync(path: string, bytes: androidNative.Array<number>, onError?: (error: any) => any): void;
writeBuffer: any;
writeBufferAsync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray): Promise<void>;
writeBufferSync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray, onError?: (error: any) => any): void;
write: any;
writeAsync(path: string, bytes: androidNative.Array<number>): Promise<void>;
writeSync(path: string, bytes: androidNative.Array<number>, onError?: (error: any) => any): void;
readText: any;
readTextAsync(path: string, encoding?: any): Promise<string>;
readTextSync(path: string, onError?: (error: any) => any, encoding?: any): string;
private static _removeUtf8Bom;
appendText: any;
appendTextAsync(path: string, content: string, encoding?: any): Promise<void>;
appendTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
writeText: any;
writeTextAsync(path: string, content: string, encoding?: any): Promise<void>;
writeTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
private deleteFolderContent;
private ensureFile;
getFileExtension(path: string): string;
private enumEntities;
getPathSeparator(): string;
normalizePath(path: string): string;
joinPath(left: string, right: string): string;
joinPaths(paths: string[]): string;
}
export declare class FileSystemAccess29 extends FileSystemAccess {
__skip: boolean;
getLastModified(path: string): Date;
getFileSize(path: string): number;
getParent(path: string, onError?: (error: any) => any): {
path: string;
name: string;
};
getFile(path: string, onError?: (error: any) => any): {
path: string;
name: string;
extension: string;
};
getFolder(path: string, onError?: (error: any) => any): {
path: string;
name: string;
};
getEntities(path: string, onError?: (error: any) => any): {
path: string;
name: string;
extension: string;
}[];
eachEntity(path: string, onEntity: (entity: {
path: string;
name: string;
extension: string;
}) => boolean, onError?: (error: any) => any): any;
fileExists(path: string): boolean;
folderExists(path: string): boolean;
deleteFile(path: string, onError?: (error: any) => any): void;
deleteFolder(path: string, onError?: (error: any) => any): void;
emptyFolder(path: string, onError?: (error: any) => any): void;
rename(path: string, newPath: string, onError?: (error: any) => any): void;
renameAsync(path: string, newPath: string): Promise<any>;
getDocumentsFolderPath(): string;
getTempFolderPath(): string;
getLogicalRootPath(): string;
getCurrentAppPath(): string;
appendBuffer: any;
appendBufferAsync(path: string, content: any): Promise<void>;
appendBufferSync(path: string, content: any, onError?: (error: any) => any): void;
append: any;
appendAsync(path: string, content: any): Promise<void>;
appendSync(path: string, content: any, onError?: (error: any) => any): void;
appendText: any;
appendTextAsync(path: string, content: string, encoding?: any): Promise<void>;
appendTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
readText: any;
readTextAsync(path: string, encoding?: any): Promise<string>;
readTextSync(path: string, onError?: (error: any) => any, encoding?: any): string;
readBuffer: any;
readBufferAsync(path: string): Promise<any>;
readBufferSync(path: string, onError?: (error: any) => any): any;
read: any;
readAsync(path: string): Promise<any>;
readSync(path: string, onError?: (error: any) => any): any;
writeText: any;
writeTextAsync(path: string, content: string, encoding?: any): Promise<void>;
writeTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
writeBuffer: any;
writeBufferAsync(path: string, content: any): Promise<void>;
writeBufferSync(path: string, content: any, onError?: (error: any) => any): void;
write: any;
writeAsync(path: string, content: any): Promise<void>;
writeSync(path: string, content: any, onError?: (error: any) => any): void;
getFileExtension(path: string): string;
getPathSeparator(): string;
normalizePath(path: string): string;
joinPath(left: string, right: string): string;
joinPaths(paths: string[]): string;
}