mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +08:00
refractor(file): remove pluginMeta variable
This commit is contained in:
parent
a5e591cfa6
commit
55b6ab9c54
@ -337,12 +337,6 @@ declare var FileError: {
|
|||||||
PATH_EXISTS_ERR: number;
|
PATH_EXISTS_ERR: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
let pluginMeta = {
|
|
||||||
name: 'File',
|
|
||||||
plugin: 'cordova-plugin-file',
|
|
||||||
pluginRef: 'cordova.file',
|
|
||||||
repo: 'https://github.com/apache/cordova-plugin-file'
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name File
|
* @name File
|
||||||
@ -365,7 +359,12 @@ let pluginMeta = {
|
|||||||
* Although most of the plugin code was written when an earlier spec was current: http://www.w3.org/TR/2011/WD-file-system-api-20110419/
|
* Although most of the plugin code was written when an earlier spec was current: http://www.w3.org/TR/2011/WD-file-system-api-20110419/
|
||||||
* It also implements the FileWriter spec : http://dev.w3.org/2009/dap/file-system/file-writer.html
|
* It also implements the FileWriter spec : http://dev.w3.org/2009/dap/file-system/file-writer.html
|
||||||
*/
|
*/
|
||||||
@Plugin(pluginMeta)
|
@Plugin({
|
||||||
|
name: 'File',
|
||||||
|
plugin: 'cordova-plugin-file',
|
||||||
|
pluginRef: 'cordova.file',
|
||||||
|
repo: 'https://github.com/apache/cordova-plugin-file'
|
||||||
|
})
|
||||||
export class File {
|
export class File {
|
||||||
static cordovaFileError: {} = {
|
static cordovaFileError: {} = {
|
||||||
1: 'NOT_FOUND_ERR',
|
1: 'NOT_FOUND_ERR',
|
||||||
@ -391,7 +390,10 @@ export class File {
|
|||||||
static getFreeDiskSpace(): Promise<number> {
|
static getFreeDiskSpace(): Promise<number> {
|
||||||
return new Promise<any>((resolve, reject) => {
|
return new Promise<any>((resolve, reject) => {
|
||||||
if (!cordova || !cordova.exec) {
|
if (!cordova || !cordova.exec) {
|
||||||
pluginWarn(pluginMeta);
|
pluginWarn({
|
||||||
|
name: 'File',
|
||||||
|
plugin: 'cordova-plugin-file'
|
||||||
|
});
|
||||||
reject({ error: 'plugin_not_installed' });
|
reject({ error: 'plugin_not_installed' });
|
||||||
} else {
|
} else {
|
||||||
cordova.exec(resolve, reject, 'File', 'getFreeDiskSpace', []);
|
cordova.exec(resolve, reject, 'File', 'getFreeDiskSpace', []);
|
||||||
|
Loading…
Reference in New Issue
Block a user