mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +08:00
feat(filepath): add cordova-plugin-filepath (#714)
This commit is contained in:
parent
96776567eb
commit
0660a3bc67
@ -44,6 +44,7 @@ import { Facebook } from './plugins/facebook';
|
|||||||
import { File } from './plugins/file';
|
import { File } from './plugins/file';
|
||||||
import { FileChooser } from './plugins/file-chooser';
|
import { FileChooser } from './plugins/file-chooser';
|
||||||
import { FileOpener } from './plugins/file-opener';
|
import { FileOpener } from './plugins/file-opener';
|
||||||
|
import { FilePath } from './plugins/filepath';
|
||||||
import { Transfer } from './plugins/filetransfer';
|
import { Transfer } from './plugins/filetransfer';
|
||||||
import { Flashlight } from './plugins/flashlight';
|
import { Flashlight } from './plugins/flashlight';
|
||||||
import { Geofence } from './plugins/geofence';
|
import { Geofence } from './plugins/geofence';
|
||||||
@ -153,6 +154,7 @@ export * from './plugins/file';
|
|||||||
export * from './plugins/file-chooser';
|
export * from './plugins/file-chooser';
|
||||||
export * from './plugins/file-opener';
|
export * from './plugins/file-opener';
|
||||||
export * from './plugins/filetransfer';
|
export * from './plugins/filetransfer';
|
||||||
|
export * from './plugins/filepath';
|
||||||
export * from './plugins/flashlight';
|
export * from './plugins/flashlight';
|
||||||
export * from './plugins/geofence';
|
export * from './plugins/geofence';
|
||||||
export * from './plugins/geolocation';
|
export * from './plugins/geolocation';
|
||||||
@ -262,6 +264,7 @@ window['IonicNative'] = {
|
|||||||
File,
|
File,
|
||||||
FileChooser,
|
FileChooser,
|
||||||
FileOpener,
|
FileOpener,
|
||||||
|
FilePath,
|
||||||
Flashlight,
|
Flashlight,
|
||||||
Geofence,
|
Geofence,
|
||||||
Geolocation,
|
Geolocation,
|
||||||
|
34
src/plugins/filepath.ts
Normal file
34
src/plugins/filepath.ts
Normal 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; }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user