2016-10-18 18:05:19 +08:00
|
|
|
import { Plugin, Cordova } from './plugin';
|
|
|
|
|
|
|
|
declare var window: any;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name FilePath
|
|
|
|
* @description
|
|
|
|
*
|
|
|
|
* This plugin allows you to resolve the native filesystem path for Android content URIs and is based on code in the aFileChooser library.
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* ```
|
|
|
|
* import {FilePath} from 'ionic-native';
|
|
|
|
*
|
|
|
|
* FilePath.resolveNativePath(path)
|
|
|
|
* .then(filePath => console.log(filePath);
|
|
|
|
* .catch(err => console.log(err);
|
|
|
|
*
|
|
|
|
* ```
|
|
|
|
*/
|
|
|
|
@Plugin({
|
2016-10-28 01:48:50 +08:00
|
|
|
pluginName: 'FilePath',
|
2016-10-18 18:05:19 +08:00
|
|
|
plugin: 'cordova-plugin-filepath',
|
|
|
|
pluginRef: 'window.FilePath',
|
|
|
|
repo: 'https://github.com/hiddentao/cordova-plugin-filepath',
|
|
|
|
platforms: ['Android']
|
|
|
|
})
|
|
|
|
export class FilePath {
|
|
|
|
/**
|
|
|
|
* Resolve native path for given content URL/path.
|
|
|
|
* @param {String} path Content URL/path.
|
2016-11-30 06:40:50 +08:00
|
|
|
* @returns {Promise<string>}
|
2016-10-18 18:05:19 +08:00
|
|
|
*/
|
|
|
|
@Cordova()
|
|
|
|
static resolveNativePath(path: string): Promise<string> {return; }
|
|
|
|
}
|