feat(filepath): add cordova-plugin-filepath (#714)

This commit is contained in:
Colin Frick 2016-10-18 12:05:19 +02:00 committed by Ibrahim Hadeed
parent 96776567eb
commit 0660a3bc67
2 changed files with 37 additions and 0 deletions

View File

@ -44,6 +44,7 @@ import { Facebook } from './plugins/facebook';
import { File } from './plugins/file';
import { FileChooser } from './plugins/file-chooser';
import { FileOpener } from './plugins/file-opener';
import { FilePath } from './plugins/filepath';
import { Transfer } from './plugins/filetransfer';
import { Flashlight } from './plugins/flashlight';
import { Geofence } from './plugins/geofence';
@ -153,6 +154,7 @@ export * from './plugins/file';
export * from './plugins/file-chooser';
export * from './plugins/file-opener';
export * from './plugins/filetransfer';
export * from './plugins/filepath';
export * from './plugins/flashlight';
export * from './plugins/geofence';
export * from './plugins/geolocation';
@ -262,6 +264,7 @@ window['IonicNative'] = {
File,
FileChooser,
FileOpener,
FilePath,
Flashlight,
Geofence,
Geolocation,

34
src/plugins/filepath.ts Normal file
View File

@ -0,0 +1,34 @@
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({
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.
*/
@Cordova()
static resolveNativePath(path: string): Promise<string> {return; }
}