├── .gitignore ├── README.md ├── haxelib.json └── js ├── Cordova.hx └── cordova └── plugin ├── AdMob.hx ├── BluetoothLE.hx ├── BluetoothSerial.hx ├── Calendar.hx ├── Camera.hx ├── Clipboard.hx ├── DatePicker.hx ├── Device.hx ├── EmailComposer.hx ├── FacebookConnect.hx ├── FileTransfer.hx ├── Globalization.hx ├── InAppBrowser.hx ├── IonicKeyboard.hx ├── ListPicker.hx ├── LocalNotification.hx ├── Media.hx ├── NetworkInformation.hx ├── Opener.hx ├── PushNotification.hx ├── Pushwoosh.hx ├── ScreenOrientation.hx ├── SocialSharing.hx ├── Splashscreen.hx ├── StatusBar.hx ├── StreamingPlayer.hx ├── Toast.hx ├── YouTubeVideoPlayer.hx └── fs ├── DirectoryEntry.hx ├── DirectoryEntrySync.hx ├── DirectoryReader.hx ├── DirectoryReaderSync.hx ├── EntriesCallback.hx ├── Entry.hx ├── EntryCallback.hx ├── EntrySync.hx ├── ErrorCallback.hx ├── FileCallback.hx ├── FileEntry.hx ├── FileEntrySync.hx ├── FileError.hx ├── FileException.hx ├── FileReader.hx ├── FileSystem.hx ├── FileSystemCallback.hx ├── FileSystemSync.hx ├── FileWriter.hx ├── FileWriterCallback.hx ├── FileWriterSync.hx ├── Metadata.hx ├── MetadataCallback.hx └── VoidCallback.hx /.gitignore: -------------------------------------------------------------------------------- 1 | Thumbs.db 2 | *.DS_Store 3 | *.sublime-project 4 | *.sublime-workspace 5 | *.bak 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Haxe js externs for Apache Cordova / PhoneGap 2 | 3 | Compatible with Haxe 3.2+. 4 | 5 | ### List of supported externs 6 | 7 | * [cordova-plugin-file](https://github.com/apache/cordova-plugin-file), 8 | * [cordova-admob-pro](https://github.com/floatinghotpot/cordova-admob-pro), 9 | * [cordova-plugin-ble-central](https://github.com/don/cordova-plugin-ble-central), 10 | * [cordova-plugin-bluetooth-serial](https://github.com/don/BluetoothSerial), 11 | * [cordova-plugin-calendar](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin), 12 | * [cordova-plugin-camera](https://github.com/apache/cordova-plugin-camera), 13 | * [com.verso.cordova.clipboard](https://github.com/VersoSolutions/CordovaClipboard), 14 | * [cordova-plugin-datepicker](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker), 15 | * [cordova-plugin-device](https://github.com/apache/cordova-plugin-device), 16 | * [cordova-plugin-email-composer](https://github.com/katzer/cordova-plugin-email-composer.git), 17 | * [phonegap-facebook-plugin](https://github.com/Wizcorp/phonegap-facebook-plugin), 18 | * [cordova-plugin-globalization](https://github.com/apache/cordova-plugin-globalization), 19 | * [cordova-plugin-inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser), 20 | * [ionic-plugin-keyboard](https://github.com/driftyco/ionic-plugin-keyboard), 21 | * [cordova-plugin-listpicker](https://github.com/roberthovhannisyan/PhoneGap-Plugin-ListPicker), 22 | * [cordova-plugin-local-notifications](https://github.com/katzer/cordova-plugin-local-notifications), 23 | * [cordova-plugin-media](https://github.com/apache/cordova-plugin-media), 24 | * [cordova-plugin-network-information](https://github.com/apache/cordova-plugin-network-information), 25 | * [cordova-open](https://github.com/disusered/cordova-open), 26 | * [phonegap-plugin-push](https://github.com/phonegap/phonegap-plugin-push), 27 | * [pushwoosh-cordova-plugin](https://github.com/Pushwoosh/pushwoosh-phonegap-plugin), 28 | * [cordova-plugin-screen-orientation](https://github.com/gbenvenuti/cordova-plugin-screen-orientation), 29 | * [cordova-plugin-x-socialsharing](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin), 30 | * [cordova-plugin-splashscreen](https://github.com/apache/cordova-plugin-splashscreen), 31 | * [cordova-plugin-statusbar](https://github.com/apache/cordova-plugin-statusbar), 32 | * [cordova-plugin-streaming-media](https://github.com/nchutchind/cordova-plugin-streaming-media), 33 | * [cordova-plugin-x-toast](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin), 34 | * [com.bunkerpalace.cordova.YoutubeVideoPlayer](https://github.com/Glitchbone/CordovaYoutubeVideoPlayer). 35 | 36 | And more to come... 37 | 38 | ## API 39 | 40 | Use example with the Camera plugin: 41 | ``` 42 | // hybrid app that differenciates cordova builds from web builds 43 | #if cordova 44 | js.cordova.plugin.Camera.getPicture( 45 | 46 | function(pd : String) { 47 | 48 | // then send pd to server 49 | }, 50 | 51 | function(e : String) { 52 | 53 | // display error to user 54 | }, 55 | 56 | { 57 | allowEdit : true, 58 | targetWidth : 400, 59 | targetHeight : 400 60 | }); 61 | #else 62 | trace("camera not available on this platform"); 63 | #end 64 | ``` 65 | 66 | ## Contributions 67 | 68 | Those externs can sometimes partially cover their original lib. Do not hesitate to contribute with new externs, updates to existing externs or even better approaches for those externs. 69 | -------------------------------------------------------------------------------- /haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cordova", 3 | "license": "MIT", 4 | "tags": ["js","javascript","cordova","phonegap","android","ios","windows","phone","tablet","extern"], 5 | "description": "Set of externs to use Apache Cordova plugins with Haxe js.", 6 | "contributors": [ 7 | "zabojad" 8 | ], 9 | "releasenote": "See https://github.com/tokomlabs/haxe-cordova/blob/master/README.md", 10 | "version": "0.0.2", 11 | "url": "https://github.com/tokomlabs/haxe-cordova", 12 | "dependencies": { } 13 | } 14 | -------------------------------------------------------------------------------- /js/Cordova.hx: -------------------------------------------------------------------------------- 1 | package js; 2 | 3 | @:native('cordova') 4 | extern class Cordova{ 5 | static public function require(id:String):Dynamic; 6 | } -------------------------------------------------------------------------------- /js/cordova/plugin/AdMob.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | // listen on window.document 4 | @:enum 5 | abstract AdMobEvent(String) from String to String { 6 | var AdLoaded = "onAdLoaded"; 7 | var AdFailLoad = "onAdFailLoad"; 8 | var AdPresent = "onAdPresent"; 9 | var AdDismiss = "onAdDismiss"; 10 | var AdLeaveApp = "onAdLeaveApp"; 11 | // for banner Ad 12 | var BannerFailedToReceive = "onBannerFailedToReceive"; 13 | var BannerReceive = "onBannerReceive"; 14 | var BannerPresent = "onBannerPresent"; 15 | var BannerLeaveApp = "onBannerLeaveApp"; 16 | var BannerDismiss = "onBannerDismiss"; 17 | // for interstitial Ad 18 | var InterstitialFailedToReceive = "onInterstitialFailedToReceive"; 19 | var InterstitialReceive = "onInterstitialReceive"; 20 | var InterstitialPresent = "onInterstitialPresent"; 21 | var InterstitialLeaveApp = "onInterstitialLeaveApp"; 22 | var InterstitialDismiss = "onInterstitialDismiss"; 23 | } 24 | 25 | @:enum 26 | abstract AdSize(String) from String to String { 27 | var SmartBanner = 'SMART_BANNER'; 28 | var Banner = 'BANNER'; 29 | var MediumRectangle = 'MEDIUM_RECTANGLE'; 30 | var FullBanner = 'FULL_BANNER'; 31 | var Leaderboard = 'LEADERBOARD'; 32 | var Skyscraper = 'SKYSCRAPER'; 33 | var Custom = 'CUSTOM'; 34 | } 35 | 36 | @:enum 37 | abstract AdPosition(Int) from Int to Int { 38 | var NoChange = 0; 39 | var TopLeft = 1; 40 | var TopCenter = 2; 41 | var TopRight = 3; 42 | var Left = 4; 43 | var Center = 5; 44 | var Right = 6; 45 | var BottomLeft = 7; 46 | var BottomCenter = 8; 47 | var BottomRight = 9; 48 | var PosXy = 10; 49 | } 50 | 51 | typedef AdExtras = { 52 | color_bg : String, 53 | color_bg_top : String, 54 | color_border : String, 55 | color_link : String, 56 | color_text : String, 57 | color_url : String 58 | } 59 | 60 | typedef AdMobOptions = { 61 | ? adId : String, 62 | ? adSize : AdSize, 63 | ? width : Int, 64 | ? height : Int, 65 | ? overlap : Bool, 66 | ? position : AdPosition, 67 | ? x : Int, 68 | ? y : Int, 69 | ? isTesting : Bool, 70 | ? autoShow : Bool, 71 | ? orientationRenew : Bool, 72 | ? adExtras : AdExtras 73 | } 74 | 75 | typedef AdSettings = { 76 | adId : String, 77 | adTrackingEnabled : Bool 78 | } 79 | 80 | /** 81 | Extern for the [cordova-plugin-admobpro](https://github.com/floatinghotpot/cordova-admob-pro) plugin. 82 | **/ 83 | @:native("AdMob") 84 | extern class AdMob { 85 | // use banner 86 | static public function createBanner(? ad : haxe.extern.EitherType, 87 | ? success : Void -> Void, 88 | ? fail : Void -> Void) : Void; 89 | static public function removeBanner() : Void; 90 | static public function showBanner(position : AdPosition) : Void; 91 | static public function showBannerAtXY(x : Int, y : Int) : Void; 92 | static public function hideBanner() : Void; 93 | 94 | // use interstitial 95 | static public function prepareInterstitial(ad : haxe.extern.EitherType, 96 | ? success : Void -> Void, 97 | ? fail : Void -> Void) : Void; 98 | static public function requestInterstitial() : Void; 99 | static public function showInterstitial() : Void; 100 | @:deprecated 101 | static public function isInterstitialReady(cb : Bool -> Void) : Void; 102 | 103 | // use reward video 104 | static public function prepareRewardVideoAd(ad : haxe.extern.EitherType, 105 | ? success : Void -> Void, 106 | ? fail : Void -> Void) : Void; 107 | static public function showRewardVideoAd() : Void; 108 | 109 | // set values for configuration and targeting 110 | static public function setOptions(options : AdMobOptions, ? success : Void -> Void, ? fail : Void -> Void) : Void; 111 | 112 | // get user ad settings 113 | static public function getAdSettings(success : AdSettings -> Void, ? fail : Void -> Void) : Void; 114 | } 115 | -------------------------------------------------------------------------------- /js/cordova/plugin/BluetoothLE.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:enum 4 | abstract BTState(String) from String to String { 5 | var On = "on"; 6 | var Off = "off"; 7 | var TurningOn = "turningOn"; // (Android Only) 8 | var TurningOff = "turningOff"; // (Android Only) 9 | var Unknown = "unknown"; // (iOS Only) 10 | var Resetting = "resetting"; // (iOS Only) 11 | var Unsupported = "unsupported"; // (iOS Only) 12 | var Unauthorized = "unauthorized"; // (iOS Only) 13 | } 14 | 15 | typedef BluetoothLEPeripheral = { 16 | name : String, 17 | id : String, 18 | rssi : Int, 19 | #if ios 20 | advertising : { 21 | kCBAdvDataChannel : Int, 22 | kCBAdvDataServiceData : Dynamic, 23 | kCBAdvDataLocalName : String, 24 | kCBAdvDataServiceUUIDs : Array, 25 | kCBAdvDataManufacturerData : Dynamic, 26 | kCBAdvDataTxPowerLevel : Int, 27 | kCBAdvDataIsConnectable : Bool 28 | } 29 | #elseif android 30 | advertising : js.html.ArrayBuffer 31 | #end 32 | } 33 | 34 | /** 35 | Extern for the [cordova-plugin-ble-central](https://github.com/don/cordova-plugin-ble-central) plugin. 36 | **/ 37 | @:native("window.ble") 38 | extern class BluetoothLE { 39 | public static function scan(services : Array, seconds : Int, onSuccess : BluetoothLEPeripheral -> Void, onError : String -> Void) : Void; 40 | public static function startScan(services : Array, onSuccess : BluetoothLEPeripheral -> Void, onError : String -> Void) : Void; 41 | public static function stopScan(onSuccess : Void -> Void, onError : String -> Void) : Void; 42 | public static function connect(id : String, onSuccess : BluetoothLEPeripheral -> Void, onError : String -> Void) : Void; 43 | public static function disconnect(id : String, onSuccess : Void -> Void, onError : String -> Void) : Void; 44 | public static function write(deviceId : String, serviceUuid : String, characteristicUuid : String, data : js.html.ArrayBuffer, ? onSuccess : Dynamic -> Void, ? onError : String -> Void) : Void; 45 | public static function writeWithoutResponse(deviceId : String, serviceUuid : String, characteristicUuid : String, data : js.html.ArrayBuffer, onSuccess : Dynamic -> Void, onError : String -> Void) : Void; 46 | public static function startStateNotifications(success : BTState -> Void, failure : String -> Void) : Void; 47 | public static function stopStateNotifications(success : Void -> Void, failure : String -> Void) : Void; 48 | public static function startNotification(deviceId : String, serviceUuid : String, characteristicUuid : String, success : js.html.ArrayBuffer -> Void, failure : String -> Void) : Void; 49 | public static function read(deviceId : String, serviceUuid : String, characteristicUuid : String, success : js.html.ArrayBuffer -> Void, failure : String -> Void) : Void; 50 | public static function stopNotification(deviceId : String, serviceUuid : String, characteristicUuid : String, ? success : Void -> Void, ? failure : String -> Void) : Void; 51 | public static function isEnabled(success : Bool -> Void, ? failure : String -> Void) : Void; 52 | public static function isConnected(deviceId : String, success : Bool -> Void, ? failure : String -> Void) : Void; 53 | #if android 54 | public static function showBluetoothSettings(success : Dynamic -> Void, ? failure : String -> Void) : Void; 55 | public static function enable(success : Void -> Void, failure : String -> Void) : Void; 56 | #end 57 | } -------------------------------------------------------------------------------- /js/cordova/plugin/BluetoothSerial.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef BluetoothSerialDevice = { 4 | id: String, 5 | name: String, 6 | // #if ios 7 | ? uuid: String, 8 | ? rssi: Int, 9 | // #elseif android 10 | ? address: String, 11 | //class: String 12 | // #end 13 | } 14 | 15 | /** 16 | Extern for the [cordova-plugin-bluetooth-serial](https://github.com/don/BluetoothSerial) plugin. 17 | **/ 18 | @:native("window.bluetoothSerial") 19 | extern class BluetoothSerial { 20 | public static function list(success : Array -> Void, failure : String -> Void) : Void; 21 | #if (!ios) 22 | public static function discoverUnpaired(success : Array -> Void, failure : String -> Void) : Void; 23 | #end 24 | public static function setDeviceDiscoveredListener(cb : BluetoothSerialDevice -> Void) : Void; 25 | public static function clearDeviceDiscoveredListener() : Void; 26 | public static function connect(macAddress_or_uuid : String, connectSuccess : Void -> Void, connectFailure : String -> Void) : Void; 27 | public static function disconnect(connectSuccess : Void -> Void, connectFailure : String -> Void) : Void; 28 | public static function write(data : haxe.extern.EitherType,js.html.ArrayBuffer>, success : Void -> Void, failure : String -> Void) : Void; 29 | 30 | public static function subscribeRawData(success : js.html.ArrayBuffer -> Void, failure : String -> Void) : Void; 31 | public static function unsubscribeRawData(success : Void -> Void, failure : String -> Void) : Void; 32 | public static function isConnected(success : Void -> Void, failure : Void -> Void) : Void; 33 | public static function isEnabled(success : Void -> Void, failure : Void -> Void) : Void; 34 | public static function enable(success : Void -> Void, failure : String -> Void) : Void; 35 | } 36 | // TODO 37 | // bluetoothSerial.connectInsecure 38 | // bluetoothSerial.available 39 | // bluetoothSerial.read 40 | // bluetoothSerial.readUntil 41 | // bluetoothSerial.subscribe 42 | // bluetoothSerial.unsubscribe 43 | // bluetoothSerial.clear 44 | // bluetoothSerial.readRSSI 45 | // bluetoothSerial.showBluetoothSettings 46 | // bluetoothSerial.setName 47 | // bluetoothSerial.setDiscoverable -------------------------------------------------------------------------------- /js/cordova/plugin/Calendar.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:enum 4 | abstract CalendarRecurrence(String) from String to String { 5 | var Daily = "daily"; 6 | var Weekly = "weekly"; 7 | var Monthly = "monthly"; 8 | var Yearly = "yearly"; 9 | } 10 | 11 | typedef CalendarOptions = { 12 | ? id : String, // iOS only 13 | ? calendarId : Int, // Android only 14 | ? calendarName : String, // iOS only 15 | ? firstReminderMinutes : Int, 16 | ? recurrence : CalendarRecurrence, 17 | ? recurrenceEndDate : Date, 18 | ? recurrenceInterval : Int, 19 | ? secondReminderMinutes : Int, 20 | ? url : String 21 | } 22 | 23 | /** 24 | Extern for the [cordova-plugin-calendar](https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin) plugin. 25 | **/ 26 | @:native("window.plugins.calendar") 27 | extern class Calendar { 28 | static public function createCalendar(name : String, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 29 | static public function deleteCalendar(name : String, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 30 | static public function getCalendarOptions() : CalendarOptions; 31 | static public function createEvent(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 32 | static public function createEventWithOptions(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, options : CalendarOptions, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 33 | static public function createEventInteractively(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 34 | static public function createEventInteractivelyWithOptions(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 35 | static public function findEvent(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 36 | static public function findEventWithOptions(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, options : CalendarOptions, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 37 | static public function listCalendars(success : Array<{id : String, name : String}>, error : Dynamic -> Void) : Void; 38 | static public function findAllEventsInNamedCalendars(calendarName : String, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 39 | static public function modifyEvent(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, newTitle : String, newEventLocation : String, newNotes : String, newStartDate : Date, newEndDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 40 | static public function modifyEventWithOptions(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, newTitle : String, newEventLocation : String, newNotes : String, newStartDate : Date, newEndDate : Date, filterOptions : CalendarOptions, newOptions : CalendarOptions, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 41 | static public function deleteEvent(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 42 | static public function deleteEventFromNamedCalendar(title : String, eventLocation : String, notes : String, startDate : Date, endDate : Date, calendarName : String, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 43 | static public function openCalendar(? date : Date, ? success : Dynamic -> Void, ? error : Dynamic -> Void) : Void; 44 | // Android only 45 | static public function listEventsInRange(startDate : Date, endDate : Date, success : Dynamic -> Void, error : Dynamic -> Void) : Void; 46 | } 47 | -------------------------------------------------------------------------------- /js/cordova/plugin/Camera.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:enum 4 | abstract CameraDirection(Int) { 5 | var Back = 0; 6 | var Front = 1; 7 | } 8 | 9 | @:enum 10 | abstract CameraPopoverArrowDirection(Int) { 11 | var ArrowUp = 1; 12 | var ArrowDown = 2; 13 | var ArrowLeft = 4; 14 | var ArrowRight = 8; 15 | var ArrowAny = 15; 16 | } 17 | 18 | @:enum 19 | abstract CameraSourceType(Int) { 20 | var PhotoLibrary = 0; 21 | var Camera = 1; 22 | var SavedPhotoAlbum = 2; 23 | } 24 | 25 | @:enum 26 | abstract CameraMediaType(Int) { 27 | var Picture = 0; 28 | var Video = 1; 29 | var All = 2; 30 | } 31 | 32 | @:enum 33 | abstract CameraEncodingType(Int) { 34 | var JPEG = 0; 35 | var PNG = 1; 36 | } 37 | 38 | @:enum 39 | abstract CameraDestinationType(Int) { 40 | var DataUrl = 0; 41 | var FileUri = 1; 42 | var NativeUri = 2; 43 | } 44 | 45 | typedef CameraOptions = { 46 | ? quality : Int, 47 | ? destinationType : CameraDestinationType, 48 | ? sourceType : CameraSourceType, 49 | ? allowEdit : Bool, 50 | ? encodingType : CameraEncodingType, 51 | ? targetWidth : Int, 52 | ? targetHeight : Int, 53 | ? mediaType : CameraMediaType, 54 | ? correctOrientation : Bool, 55 | ? saveToPhotoAlbum : Bool, 56 | ? popoverOptions : CameraPopoverOptions, 57 | ? cameraDirection : CameraDirection, 58 | } 59 | 60 | @:native("CameraPopoverOptions") 61 | extern class CameraPopoverOptions { 62 | public function new(x : Int, y : Int, width : Int, height : Int, arrowDir : CameraPopoverArrowDirection); 63 | } 64 | 65 | /** 66 | Extern for the [cordova-plugin-camera](https://github.com/apache/cordova-plugin-camera) plugin. 67 | **/ 68 | @:native("navigator.camera") 69 | extern class Camera { 70 | static function getPicture(successCb : String -> Void, errorCb : String -> Void, options : CameraOptions) : Void; 71 | static function cleanup(successCb : Void -> Void, errorCb : String -> Void) : Void; 72 | } 73 | -------------------------------------------------------------------------------- /js/cordova/plugin/Clipboard.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [com.verso.cordova.clipboard](https://github.com/VersoSolutions/CordovaClipboard) plugin. 5 | **/ 6 | @:native("window.cordova.plugins.clipboard") 7 | extern class Clipboard { 8 | 9 | static public function copy(text : String) : Void; 10 | 11 | static public function paste(cb : String -> Void) : Void; 12 | } 13 | -------------------------------------------------------------------------------- /js/cordova/plugin/DatePicker.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:enum 4 | abstract DatePickerMode(String) from String to String { 5 | var DateMode = "date"; 6 | var TimeMode = "time"; 7 | var DatetimeMode = "datetime"; 8 | } 9 | 10 | @:enum 11 | abstract DatePickerPopoverArrowDirection(String) from String to String { 12 | var UpArrowDir = "up"; 13 | var DownArrowDir = "down"; 14 | var LeftArrowDir = "left"; 15 | var RightArrowDir = "right"; 16 | var AnyArrowDir = "any"; 17 | } 18 | 19 | @:enum 20 | abstract DatePickerAndroidTheme(Int) from Int to Int { 21 | var TraditionalTheme = 1; 22 | var HoloDarkTheme = 2; 23 | var HoloLightTheme = 3; 24 | var DefaultDarkTheme = 4; 25 | var DefaultLightTheme = 5; 26 | } 27 | 28 | typedef DatePickerOptions = { 29 | ? mode : DatePickerMode, // default: DatePickerMode.DateMode 30 | ? date : Dynamic, // Date | empty String, default: Date.now() 31 | ? minDate : Dynamic, // minDate is a Date object for iOS and a millisecond precision unix timestamp for Android, so you need to account for that when using the plugin. Also, on Android, only the date is enforced (time is not). 32 | ? maxDate : Dynamic, // Date | empty String, default: (empty String) 33 | ? titleText : String, 34 | ? okText : String, 35 | ? cancelText : String, 36 | ? todayText : String, 37 | ? nowText : String, 38 | ? is24Hour : Bool, // default: false 39 | ? androidTheme : DatePickerAndroidTheme, // default: DatePickerAndroidTheme.Traditional 40 | ? allowOldDates : Bool, // default: true 41 | ? allowFutureDates : Bool, // default: true 42 | ? doneButtonLabel : String, // default: "Done" 43 | ? doneButtonColor : String, // default: #0000FF 44 | ? cancelButtonLabel : String, // default: Cancel 45 | ? cancelButtonColor : String, // default: #000000 46 | ? x : String, // default: 0 47 | ? y : String, // default: 0 48 | ? minuteInterval : Int, // default: 1 49 | ? popoverArrowDirection : DatePickerPopoverArrowDirection, // default: DatePickerPopoverArrowDirection.Any 50 | ? locale : String // default: en_us 51 | } 52 | 53 | /** 54 | Extern for the [cordova-plugin-datepicker](https://github.com/VitaliiBlagodir/cordova-plugin-datepicker) plugin. 55 | **/ 56 | @:native("datePicker") 57 | extern class DatePicker { 58 | 59 | static public function show(options : DatePickerOptions, successCb : Date -> Void, errorCb : String -> Void) : Void; 60 | } 61 | -------------------------------------------------------------------------------- /js/cordova/plugin/Device.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-plugin-device](https://github.com/apache/cordova-plugin-device) plugin. 5 | **/ 6 | @:native("window.device") 7 | extern class Device { 8 | static public var cordova : String; 9 | static public var model : String; 10 | static public var platform : String; 11 | static public var uuid : String; 12 | static public var version : String; 13 | static public var manufacturer : String; 14 | static public var isVirtual : Bool; 15 | static public var serial : String; 16 | } -------------------------------------------------------------------------------- /js/cordova/plugin/EmailComposer.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef EmailData = { 4 | @:optional var to : Array; 5 | @:optional var cc : Array; 6 | @:optional var bcc : Array; 7 | /** 8 | * paths to the files you want to attach or base64 encoded data streams 9 | */ 10 | @:optional var attachments : Array; 11 | @:optional var subject : String; 12 | @:optional var body : String; 13 | @:optional var isHtml : Bool; 14 | } 15 | 16 | /** 17 | Extern for the [cordova-plugin-email-composer](https://github.com/katzer/cordova-plugin-email-composer.git) plugin. 18 | **/ 19 | @:native("window.plugin.email") 20 | extern class EmailComposer { 21 | public static function isAvailable(isAvailable : Bool -> Void) : Void; 22 | public static function open(email : EmailData, ? cb : Void -> Void) : Void; 23 | } 24 | -------------------------------------------------------------------------------- /js/cordova/plugin/FacebookConnect.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef FacebookConnectOAuthResponse = { 4 | session_key : Bool, 5 | accessToken : String, 6 | expiresIn : Int, 7 | sig : String, 8 | ? secret : String, 9 | userID : String 10 | } 11 | 12 | typedef FacebookConnectStatus = { 13 | status : String, // "connected", ... 14 | authResponse : FacebookConnectOAuthResponse 15 | } 16 | 17 | typedef FacebookConnectDialogOptions = { 18 | method : String, 19 | ? href : String, 20 | ? link : String, 21 | ? caption : String, 22 | ? description : String, 23 | ? picture : String, 24 | ? message : String, 25 | ? hashtag : String, 26 | ? share_feedWeb : Bool, // ios only 27 | } 28 | typedef FacebookConnectDialogResult = { 29 | ? postId : String, 30 | ? from : String, 31 | ? to : String 32 | } 33 | 34 | /** 35 | Extern for the [phonegap-facebook-plugin](https://github.com/Wizcorp/phonegap-facebook-plugin) plugin. 36 | **/ 37 | @:native("window.facebookConnectPlugin") 38 | extern class FacebookConnect { 39 | public static function login(permissions : Array, ? onSuccess : FacebookConnectStatus -> Void, ? onFailure : String -> Void) : Void; 40 | public static function getAccessToken(? onSuccess : String -> Void, ? onFailure : String -> Void) : Void; 41 | public static function logout(? onSuccess : Void -> Void, ? onFailure : String -> Void) : Void; 42 | public static function getLoginStatus(? onSuccess : FacebookConnectStatus -> Void, ? onFailure : String -> Void) : Void; 43 | public static function showDialog(options : FacebookConnectDialogOptions, ? onSuccess : FacebookConnectDialogResult -> Void, ? onFailure : String -> Void) : Void; 44 | public static function api(requestPath : String, permissions : Array, ? onSuccess : Dynamic -> Void, ? onFailure : String -> Void) : Void; 45 | public static function logEvent(name : String, params : Dynamic, valueToSum : Float, ? onSuccess : Dynamic -> Void, ? onFailure : String -> Void) : Void; 46 | public static function logPurchase(value : Float, currency : String, ? onSuccess : Dynamic -> Void, ? onFailure : String -> Void) : Void; 47 | } 48 | -------------------------------------------------------------------------------- /js/cordova/plugin/FileTransfer.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | import js.cordova.plugin.fs.FileEntry; 4 | 5 | @:enum 6 | abstract FileTransferErrorCode(Int) from Int to Int { 7 | var FILE_NOT_FOUND_ERR = 1; 8 | var INVALID_URL_ERR = 2; 9 | var CONNECTION_ERR = 3; 10 | var ABORT_ERR = 4; 11 | var NOT_MODIFIED_ERR = 5; 12 | } 13 | 14 | typedef FileTransferError = { 15 | code : FileTransferErrorCode, 16 | source : String, 17 | target : String, 18 | http_status : Int, 19 | body : String, 20 | exception : String 21 | } 22 | 23 | typedef FileUploadResult = { 24 | bytesSent : Int, 25 | responseCode : Int, 26 | response : String, 27 | headers : haxe.DynamicAccess // ios only 28 | } 29 | 30 | typedef FileTransferUploadOptions = { 31 | ? fileKey : String, 32 | ? fileName : String, 33 | ? httpMethod : String, 34 | ? mimeType : String, 35 | ? params : String, 36 | ? chunkedMode : Bool, 37 | ? headers : haxe.DynamicAccess 38 | } 39 | 40 | typedef FileTransferDownloadOptions = { 41 | ? header : haxe.DynamicAccess 42 | } 43 | 44 | /** 45 | Extern for the [cordova-plugin-file-transfer](https://github.com/apache/cordova-plugin-file-transfer) plugin. 46 | **/ 47 | @:native("window.FileTransfer") 48 | extern class FileTransfer { 49 | public function new(); 50 | public function upload(fileURL : String, server : String, successCallback : FileUploadResult -> Void, errorCallback : FileTransferError -> Void, ? options : FileTransferUploadOptions, ? trustAllHosts : Bool) : Void; 51 | public function download(source : String, target : String, successCallback : FileEntry -> Void, errorCallback : FileTransferError -> Void, ? trustAllHosts : Bool, ? options : FileTransferDownloadOptions) : Void; 52 | public function abort() : Void; 53 | } 54 | -------------------------------------------------------------------------------- /js/cordova/plugin/Globalization.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef GlobalizationResult = { 4 | value : String 5 | } 6 | @:enum 7 | abstract GlobalizationErrorCode(Int) from Int to Int { 8 | var UnknownError = 0; 9 | var FormattingError = 1; 10 | var ParsingError = 2; 11 | var PatternError = 3; 12 | } 13 | typedef GlobalizationError = { 14 | code : GlobalizationErrorCode, 15 | message : String 16 | } 17 | 18 | @:enum 19 | abstract DateTimeFormatLength(String) from String to String { 20 | var Short = "short"; 21 | var Medium = "medium"; 22 | var Long = "long"; 23 | var Full = "full"; 24 | } 25 | @:enum 26 | abstract DateTimeSelector(String) from String to String { 27 | var Date = "date"; 28 | var Time = "time"; 29 | var DateAndTime = "date and time"; 30 | } 31 | typedef DateToStringOptions = { 32 | formatLength : DateTimeFormatLength, 33 | selector : DateTimeSelector 34 | } 35 | 36 | /** 37 | Extern for the [cordova-plugin-globalization](https://github.com/apache/cordova-plugin-globalization) plugin. 38 | **/ 39 | @:native('navigator.globalization') 40 | extern class Globalization { 41 | static public function getPreferredLanguage(successCb : GlobalizationResult -> Void, errorCb : GlobalizationError -> Void) : Void; 42 | static public function getLocaleName(successCb : GlobalizationResult -> Void, errorCb : GlobalizationError -> Void) : Void; 43 | static public function dateToString(date : Date, successCallback : GlobalizationResult -> Void, errorCallback : GlobalizationError -> Void, options : DateToStringOptions) : Void; 44 | 45 | // TODO... 46 | // static public function stringToDate() : Void; 47 | 48 | // static public function getDatePattern() : Void; 49 | 50 | // static public function getDateNames() : Void; 51 | 52 | // static public function isDayLightSavingsTime() : Void; 53 | 54 | // static public function getFirstDayOfWeek() : Void; 55 | 56 | // static public function numberToString() : Void; 57 | 58 | // static public function stringToNumber() : Void; 59 | 60 | // static public function getNumberPattern() : Void; 61 | 62 | // static public function getCurrencyPattern() : Void; 63 | } 64 | -------------------------------------------------------------------------------- /js/cordova/plugin/InAppBrowser.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef InAppBrowserEvent = { 4 | type : String, // either "loadstart", "loadstop", "loaderror", or "exit". 5 | url : String, 6 | ? code : Int, 7 | ? message : String 8 | } 9 | 10 | /** 11 | Extern for the [cordova-plugin-inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser) plugin. 12 | **/ 13 | @:native("window.cordova.InAppBrowser") 14 | extern class InAppBrowser { 15 | 16 | public static function open(url : String, target : String, ? options : String) : InAppBrowser; 17 | 18 | public function addEventListener(eventName : String, cb : InAppBrowserEvent -> Void) : Void; 19 | 20 | public function removeEventListener(eventName : String, cb : InAppBrowserEvent -> Void) : Void; 21 | 22 | public function executeScript(details : { ? file : String, ? code : String }, cb : Dynamic -> Void) : Void; 23 | 24 | public function insertCSS(details : { ? file : String, ? code : String }, cb : Void -> Void) : Void; 25 | 26 | public function show() : Void; 27 | 28 | public function close() : Void; 29 | } 30 | -------------------------------------------------------------------------------- /js/cordova/plugin/IonicKeyboard.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-plugin-ionic-keyboard](https://github.com/ionic-team/cordova-plugin-ionic-keyboard) plugin. 5 | **/ 6 | @:native("Keyboard") 7 | extern class IonicKeyboard { 8 | static public function hideKeyboardAccessoryBar(value : Bool) : Void; 9 | static public function hideFormAccessoryBar(value : Bool, ? success : Bool -> Void) : Void; 10 | static public function close() : Void; 11 | static public function hide() : Void; 12 | static public function show() : Void; 13 | } 14 | -------------------------------------------------------------------------------- /js/cordova/plugin/ListPicker.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef ListPickerItem = { 4 | text : String, 5 | value : T 6 | } 7 | 8 | typedef ListPickerOptions = { 9 | title : String, 10 | items : Array>, 11 | selectedValue : T, 12 | doneButtonLabel : String, 13 | cancelButtonLabel : String 14 | } 15 | 16 | /** 17 | Extern for the [cordova-plugin-listpicker](https://github.com/roberthovhannisyan/PhoneGap-Plugin-ListPicker) plugin. 18 | **/ 19 | @:native("window.plugins.listpicker") 20 | extern class ListPicker { 21 | public static function showPicker(opts : ListPickerOptions, onSuccess : T -> Void, onError : String -> Void) : Void; 22 | } 23 | -------------------------------------------------------------------------------- /js/cordova/plugin/LocalNotification.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef LocalNotificationData = { 4 | ? id : Int, 5 | ? title : String, 6 | ? text : String, 7 | ? every : haxe.extern.EitherType, // "second", "minute", "hour", "day", "week", "month" or "year" 8 | ? at : haxe.extern.EitherType, 9 | ? firstAt : haxe.extern.EitherType, 10 | ? badge : Int, 11 | ? sound : String, 12 | ? data : String, 13 | /// 14 | // Android only 15 | ? icon : String, 16 | ? smallIcon : String, 17 | ? ongoing : Bool, 18 | ? led : String 19 | } 20 | 21 | @:enum 22 | abstract LocalNotificationEvent(String) from String to String { 23 | var Schedule = "schedule"; 24 | var Trigger = "trigger"; 25 | var Click = "click"; 26 | var Update = "update"; 27 | var Clear = "clear"; 28 | var ClearAll = "clearall"; 29 | var Cancel = "cancel"; 30 | var CancelAll = "cancelall"; 31 | } 32 | 33 | /** 34 | Extern for the [de.appplant.cordova.plugin.local-notification](https://github.com/katzer/cordova-plugin-local-notifications) plugin. 35 | **/ 36 | @:native("cordova.plugins.notification.local") 37 | extern class LocalNotification { 38 | static public function schedule(n : haxe.extern.EitherType>, ? callback : Void -> Void) : Void; 39 | static public function update(n : haxe.extern.EitherType>, ? callback : Void -> Void) : Void; 40 | static public function on(evt : LocalNotificationEvent, callback : LocalNotificationData -> Void) : Void; 41 | static public function clear(ids : haxe.extern.EitherType>, ? callback : Void -> Void) : Void; 42 | static public function clearAll(callback : Void -> Void) : Void; 43 | static public function cancel(ids : haxe.extern.EitherType>, ? callback : Void -> Void) : Void; 44 | static public function cancelAll(callback : Void -> Void) : Void; 45 | static public function isPresent(id : Int, callback : Bool -> Void) : Void; 46 | static public function isScheduled(id : Int, callback : Bool -> Void) : Void; 47 | static public function isTriggered(id : Int, callback : Bool -> Void) : Void; 48 | static public function getIds(callback : Array -> Void) : Void; 49 | static public function getAllIds(callback : Array -> Void) : Void; 50 | static public function getScheduledIds(callback : Array -> Void) : Void; 51 | static public function getTriggeredIds(callback : Array -> Void) : Void; 52 | static public function get(id : haxe.extern.EitherType>, callback : haxe.extern.EitherType> -> Void) : Void; 53 | static public function getScheduled(? id : Int, callback : haxe.extern.EitherType> -> Void) : Void; 54 | static public function getTriggered(? id : Int, callback : haxe.extern.EitherType> -> Void) : Void; 55 | static public function getAll(callback : Array -> Void) : Void; 56 | } 57 | -------------------------------------------------------------------------------- /js/cordova/plugin/Media.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-plugin-media](https://github.com/apache/cordova-plugin-media) plugin. 5 | **/ 6 | @:native("Media") 7 | extern class Media { 8 | public function new(src : String, mediaSuccess : Void -> Void, ? mediaError : String -> Void, ? mediaStatus : Int -> Void); 9 | public function getCurrentAmplitude(mediaSuccess : Float -> Void, ? mediaError : String -> Void) : Void; 10 | public function getCurrentPosition(mediaSuccess : Int -> Void, ? mediaError : String -> Void) : Void; 11 | public function getDuration() : Int; 12 | public function play() : Void; 13 | public function pause() : Void; 14 | public function pauseRecord() : Void; 15 | public function release() : Void; 16 | public function resumeRecord() : Void; 17 | public function seekTo(ms : Int) : Void; 18 | public function setVolume(v : Float) : Void; 19 | public function startRecord() : Void; 20 | public function stopRecord() : Void; 21 | public function stop() : Void; 22 | } 23 | -------------------------------------------------------------------------------- /js/cordova/plugin/NetworkInformation.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:native("Connection") 4 | extern class ConnectionType { 5 | static public var UNKNOWN : ConnectionType; 6 | static public var ETHERNET : ConnectionType; 7 | static public var WIFI : ConnectionType; 8 | static public var CELL_2G : ConnectionType; 9 | static public var CELL_3G : ConnectionType; 10 | static public var CELL_4G : ConnectionType; 11 | static public var CELL : ConnectionType; 12 | static public var NONE : ConnectionType; 13 | } 14 | 15 | /** 16 | Extern for the [cordova-plugin-network-information](https://github.com/apache/cordova-plugin-network-information) plugin. 17 | **/ 18 | @:native("navigator.connection") 19 | extern class NetworkInformation { 20 | 21 | @:native("type") 22 | static public var type : ConnectionType; 23 | } 24 | -------------------------------------------------------------------------------- /js/cordova/plugin/Opener.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-open](https://github.com/disusered/cordova-open) plugin. 5 | **/ 6 | @:native("cordova.plugins.disusered") 7 | extern class Opener { 8 | static public function open(uri : String, onSuccess : Void -> Void, onError : Int -> Void) : Void; 9 | } 10 | -------------------------------------------------------------------------------- /js/cordova/plugin/PushNotification.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | import haxe.extern.EitherType; 4 | 5 | typedef PushNotificationOptionsIOS = { 6 | ? alert : Bool, 7 | ? badge : Bool, 8 | ? sound : Bool, 9 | ? clearBadge : Bool, 10 | ? fcmSandbox : Bool, 11 | ? categories : Dynamic, // The data required in order to enabled Action Buttons for iOS. See Action Buttons on iOS for more details. 12 | ? topics : Array 13 | } 14 | 15 | typedef PushNotificationOptionsAndroid = { 16 | ? icon : String, 17 | ? iconColor : String, 18 | ? sound : Bool, 19 | ? vibrate : Bool, 20 | ? clearBadge : Bool, 21 | ? clearNotifications : Bool, 22 | ? forceShow : Bool, 23 | ? topics : Array, 24 | ? messageKey : String, 25 | ? titleKey : String, 26 | } 27 | 28 | typedef PushNotificationOptions = { 29 | ? android : PushNotificationOptionsAndroid, 30 | ? ios : PushNotificationOptionsIOS 31 | } 32 | 33 | typedef RegistrationData = { 34 | registrationId : String, 35 | registrationType : String 36 | } 37 | 38 | typedef NotificationData = { 39 | message : String, 40 | ? title : String, 41 | count : String, 42 | sound : String, 43 | image : String, 44 | ? additionalData : Dynamic //{ ? coldstart : Bool, ? dismissed : Bool, ? foreground : Bool } 45 | } 46 | 47 | /** 48 | Extern for the [phonegap-plugin-push](https://github.com/phonegap/phonegap-plugin-push) plugin. 49 | **/ 50 | @:native("window.PushNotification") 51 | extern class PushNotification { 52 | public static function init(options : PushNotificationOptions) : PushNotification; 53 | public function on(ev : String, cb : EitherType> -> Void) : Void; 54 | public function finish(? successCb : Void -> Void, ? errorCb : String -> Void) : Void; 55 | public function unregister(? successCb : Void -> Void, ? errorCb : String -> Void) : Void; 56 | public function subscribe(topic : String, ? successCb : Void -> Void, ? errorCb : js.Error -> Void) : Void; 57 | public function unsubscribe(topic : String, ? successCb : Void -> Void, ? errorCb : js.Error -> Void) : Void; 58 | } -------------------------------------------------------------------------------- /js/cordova/plugin/Pushwoosh.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef PushwooshNotification = { 4 | collapse_key : String, // "do_not_collapse", 5 | foreground : Bool, // true, 6 | message_id : Int, // 1001, 7 | onStart : Bool, // false, 8 | p : String, // "[", 9 | pri : String, // "", 10 | pw_msg : String, // "1", 11 | title : String, // "test send push thomas number 2", 12 | u : String, // "{\"type\":\"go-to\",\"specific\":{\"url\":\"/journeys\"}}", 13 | userdata : Dynamic, 14 | vib : String // "0" 15 | } 16 | 17 | typedef PushwooshConfig = { 18 | appid : String, 19 | ? projectid : String, 20 | ? serviceName : String 21 | } 22 | 23 | @:enum 24 | abstract PushwooshEvent(String) to String { 25 | var PushReceive = 'push-receive'; 26 | var PushNotification = 'push-notification'; 27 | } 28 | 29 | /** 30 | Extern for the [pushwoosh-cordova-plugin](https://github.com/Pushwoosh/pushwoosh-phonegap-plugin) plugin. 31 | **/ 32 | // @:native("cordova.require('pushwoosh-cordova-plugin.PushNotification')") 33 | extern class Pushwoosh { 34 | /* 35 | Call this to register for push notifications and retreive a push Token 36 | */ 37 | public function registerDevice(? onSuccess : Dynamic -> Void, ? onError : String -> Void) : Void; 38 | /* 39 | Call this to set tags for the device 40 | */ 41 | public function setTags(tags : Dynamic, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 42 | /* 43 | Call this to get push token if it is available. 44 | */ 45 | public function getPushToken(onSuccess : String -> Void) : Void; 46 | /* 47 | Call this to get Pushwoosh HWID used for communications with Pushwoosh API 48 | */ 49 | public function getPushwooshHWID(onSuccess : String -> Void) : Void; 50 | /* 51 | Call this first thing with your Pushwoosh App ID (pw_appid parameter) and Google Project ID for Android (projectid parameter) 52 | */ 53 | public function onDeviceReady(config : PushwooshConfig) : Void; 54 | /* 55 | Call this to get tags for the device 56 | */ 57 | public function getTags(onSuccess : Dynamic -> Void, ? onError : String -> Void) : Void; 58 | /* 59 | Unregisters device from push notifications 60 | */ 61 | public function unregisterDevice(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 62 | /* 63 | Starts geolocation based push notifications. 64 | */ 65 | public function startLocationTracking(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 66 | /* 67 | Stops geolocation based push notifications 68 | */ 69 | public function stopLocationTracking(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 70 | /* 71 | Android only, Creates local notification, config params: {msg:”message”, seconds:30, userData:”optional”} 72 | */ 73 | public function createLocalNotification(msg : Dynamic, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 74 | /* 75 | Android only, Clears pending local notifications created by createLocalNotification 76 | */ 77 | public function clearLocalNotification() : Void; 78 | /* 79 | Android only, Clears all notifications presented in Android Notification Center 80 | */ 81 | public function clearNotificationCenter() : Void; 82 | /* 83 | Android only, Deprecated, use startLocationTracking and stopLocationTracking 84 | */ 85 | @:deprecated("use startLocationTracking and stopLocationTracking") 86 | public function startGeoPushes(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 87 | /* 88 | Android only, Deprecated, use startLocationTracking and stopLocationTracking 89 | */ 90 | @:deprecated("use startLocationTracking and stopLocationTracking") 91 | public function stopGeoPushes(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 92 | /* 93 | Android only, iOS available per request, Call this to start beacon tracking 94 | */ 95 | public function startBeaconPushes(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 96 | /* 97 | Android only, iOS available per request, Call this to stop beacon tracking 98 | */ 99 | public function stopBeaconPushes(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 100 | /* 101 | Android only, let the plugin know that the app went to background mode (or vise versa). 102 | */ 103 | public function setBeaconBackgroundMode(on : Bool, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 104 | /* 105 | Android only, Allows multiple notifications to be displayed in the Android Notification Center 106 | */ 107 | public function setMultiNotificationMode(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 108 | /* 109 | Android only, Allows only the last one notification to be displayed in the Android Notification Center 110 | */ 111 | public function setSingleNotificationMode(? onSuccess : String -> Void, ? onError : String -> Void) : Void; 112 | /* 113 | Android only, Sets default sound to play when push notification arrive. 114 | */ 115 | public function setSoundType(type : Int, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 116 | /* 117 | Android only, Sets default vibration mode when push notification arrive. 118 | */ 119 | public function setVibrateType(type : Int, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 120 | /* 121 | Android only, Should the screen be lit up when push notification arrive 122 | */ 123 | public function setLightScreenOnNotification(on : Bool, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 124 | /* 125 | Android only, Set to enable led blinking when notification arrives and display is off 126 | */ 127 | public function setEnableLED(on : Bool, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 128 | /* 129 | Android only, Gets push history, returns array of push notifications received. 130 | */ 131 | public function getPushHistory(onSuccess : Dynamic -> Void) : Void; 132 | /* 133 | Android only, Clears push history 134 | */ 135 | public function clearPushHistory() : Void; 136 | /* 137 | iOS only, Call this to get a detailed status of push notification permissions. 138 | */ 139 | public function getRemoteNotificationStatus(onSuccess : Array -> Void) : Void; 140 | /* 141 | iOS only, Call this to set the application icon badge 142 | */ 143 | public function setApplicationIconBadgeNumber(v : Int) : Void; 144 | /* 145 | iOS only, Call this to get the application icon badge 146 | */ 147 | public function getApplicationIconBadgeNumber(onSuccess : Int -> Void) : Void; 148 | /* 149 | iOS only, Call this to add value to the application icon badge 150 | */ 151 | public function addToApplicationIconBadgeNumber(v : Int) : Void; 152 | /* 153 | iOS only, Call this to clear all notifications from the notification center 154 | */ 155 | public function cancelAllLocalNotifications(onSuccess : Void -> Void) : Void; 156 | /* 157 | Returns push notification payload if the app was started in response to push notification or null otherwise 158 | */ 159 | public function getLaunchNotification(onSuccess : Dynamic -> Void) : Void; 160 | /* 161 | iOS, Android Set User indentifier. 162 | */ 163 | public function setUserId(userId : String) : Void; 164 | /* 165 | iOS, Android Post events for In-App Messages. 166 | */ 167 | public function postEvent(event : String, attributes : Dynamic) : Void; 168 | } 169 | -------------------------------------------------------------------------------- /js/cordova/plugin/ScreenOrientation.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:enum @:forward 4 | abstract Orientation(String) from String to String { 5 | var PortraitPrimary = "portrait-primary"; 6 | var PortraitSecondary = "portrait-secondary"; 7 | var LandscapePrimary = "landscape-primary"; 8 | var LandscapeSecondary = "landscape-secondary"; 9 | var Portrait = "portrait"; 10 | var Landscape = "landscape"; 11 | var Any = "any"; 12 | } 13 | 14 | /** 15 | Extern for the [cordova-plugin-screen-orientation](https://github.com/apache/cordova-plugin-screen-orientation) plugin. 16 | **/ 17 | @:native("window.screen.orientation") 18 | extern class ScreenOrientation { 19 | static public function lock(v : Orientation) : Void; 20 | static public function unlock() : Void; 21 | static public function addEventListener(type : String, cb : Void -> Void) : Void; 22 | static public var onchange : Void -> Void; 23 | static public var type : Orientation; 24 | } 25 | -------------------------------------------------------------------------------- /js/cordova/plugin/SocialSharing.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-plugin-x-socialsharing](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin) plugin. 5 | **/ 6 | @:native("window.plugins.socialsharing") 7 | extern class SocialSharing { 8 | public static function canShareVia(srvId : String, msg : String, ? subject : String, ? fileUri : String, ? url : String, ? successCb : Void -> Void, ? errorCb : String -> Void) : Void; 9 | public static function share(msg : String, ? subject : String, ? fileUri : String, ? url : String, ? successCb : Void -> Void, ? errorCb : String -> Void) : Void; 10 | public static function shareWithOptions(options : Dynamic, ? successCb : Dynamic -> Void, ? errorCb : String -> Void) : Void; 11 | public static function shareViaTwitter(msg : String, ? fileUri : String, ? url : String, ? successCb : Void -> Void, ? errorCb : String -> Void) : Void; 12 | public static function shareViaFacebook(msg : String, ? fileUri : String, ? url : String, ? successCb : Void -> Void, ? errorCb : String -> Void) : Void; 13 | public static function shareViaEmail(msg : String, subject : String, to : Array, ? cc : Null>, ? bcc : Null>, ? files : Null>, ? onSuccess : Void -> Void, ? onError : String -> Void) : Void; 14 | 15 | // TODO add (iOS only) : 16 | public static function shareViaSMS(msg : String, phoneNumbers : String, ? onSuccess : String -> Void, ? onError : String -> Void) : Void; 17 | // TODO rest 18 | } -------------------------------------------------------------------------------- /js/cordova/plugin/Splashscreen.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-plugin-splashscreen](https://github.com/apache/cordova-plugin-splashscreen) plugin. 5 | **/ 6 | @:native("navigator.splashscreen") 7 | extern class Splashscreen { 8 | public static function show() : Void; 9 | public static function hide() : Void; 10 | } 11 | -------------------------------------------------------------------------------- /js/cordova/plugin/StatusBar.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [cordova-plugin-statusbar](https://github.com/apache/cordova-plugin-statusbar) plugin. 5 | **/ 6 | @:native("StatusBar") 7 | extern class StatusBar { 8 | static public function overlaysWebView(v : Bool) : Void; 9 | static public function styleDefault() : Void; 10 | static public function styleLightContent() : Void; 11 | static public function styleBlackTranslucent() : Void; 12 | static public function styleBlackOpaque() : Void; 13 | static public function backgroundColorByName(v : String) : Void; 14 | static public function backgroundColorByHexString(v : String) : Void; 15 | static public function hide() : Void; 16 | static public function show() : Void; 17 | static public var isVisible : Bool; 18 | } 19 | -------------------------------------------------------------------------------- /js/cordova/plugin/StreamingPlayer.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | typedef StreamingVideoOptions = { 4 | successCallback : Void -> Void, 5 | errorCallback : String -> Void, 6 | orientation : String // 'landscape', 'portrait'... 7 | } 8 | 9 | typedef StreamingAudioOptions = { 10 | bgColor : String, 11 | bgImage : String, 12 | bgImageScale : String, // valid values: "fit", "stretch" 13 | initFullscreen : Bool, // true(default)/false iOS only 14 | successCallback : Void -> Void, 15 | errorCallback : String -> Void 16 | } 17 | 18 | /** 19 | Extern for the [cordova-plugin-streaming-media](https://github.com/nchutchind/cordova-plugin-streaming-media) plugin. 20 | **/ 21 | @:native("window.plugins.streamingMedia") 22 | extern class StreamingPlayer { 23 | public static function playVideo(url : String, ? options : StreamingVideoOptions) : Void; 24 | public static function playAudio(url : String, ? options : StreamingAudioOptions) : Void; 25 | public static function stopAudio() : Void; 26 | public static function pauseAudio() : Void; 27 | public static function resumeAudio() : Void; 28 | } 29 | -------------------------------------------------------------------------------- /js/cordova/plugin/Toast.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | @:enum 4 | abstract ToastPosition(String) from String to String { 5 | var Top = "top"; 6 | var Center = "center"; 7 | var Bottom = "bottom"; 8 | } 9 | 10 | /** 11 | Extern for the [cordova-plugin-x-toast](https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin) plugin. 12 | **/ 13 | @:native("window.plugins.toast") 14 | extern class Toast { 15 | 16 | // duration: 'short', 'long', '3000', 900 (the latter are milliseconds) 17 | static public function show(message : String, duration : haxe.extern.EitherType, position : ToastPosition, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 18 | 19 | static public function showShortTop(message : String, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 20 | 21 | static public function showShortCenter(message : String, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 22 | 23 | static public function showShortBottom(message : String, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 24 | 25 | static public function showLongTop(message : String, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 26 | 27 | static public function showLongCenter(message : String, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 28 | 29 | static public function showLongBottom(message : String, ? successCb : String -> Void, ? errorCb : String -> Void) : Void; 30 | 31 | // TODO showWithOptions 32 | 33 | static public function hide(? successCb : String -> Void) : Void; 34 | } 35 | -------------------------------------------------------------------------------- /js/cordova/plugin/YouTubeVideoPlayer.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin; 2 | 3 | /** 4 | Extern for the [com.bunkerpalace.cordova.YoutubeVideoPlayer](https://github.com/Glitchbone/CordovaYoutubeVideoPlayer) plugin. 5 | **/ 6 | @:native("window.YoutubeVideoPlayer") 7 | extern class YouTubeVideoPlayer { 8 | public static function openVideo(youTubeVideoId : String) : Void; 9 | } 10 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/DirectoryEntry.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("DirectoryEntry") 7 | extern class DirectoryEntry extends Entry 8 | { 9 | function createReader() : DirectoryReader; 10 | 11 | function getDirectory( path : String, ?options : Dynamic, ?successCallback : EntryCallback, ?errorCallback : ErrorCallback ) : Void; 12 | 13 | function getFile( path : String, ?options : Dynamic, ?successCallback : EntryCallback, ?errorCallback : ErrorCallback ) : Void; 14 | 15 | function removeRecursively( successCallback : js.cordova.plugin.fs.VoidCallback, ?errorCallback : ErrorCallback ) : Void; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/DirectoryEntrySync.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("DirectoryEntrySync") 7 | extern class DirectoryEntrySync extends EntrySync 8 | { 9 | function createReader() : DirectoryReaderSync; 10 | 11 | function getDirectory( path : String, flags : Dynamic ) : DirectoryEntrySync; 12 | 13 | function getFile( path : String, flags : Dynamic ) : FileEntrySync; 14 | 15 | function removeRecursively() : Void; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/DirectoryReader.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("DirectoryReader") 7 | extern class DirectoryReader 8 | { 9 | function readEntries( successCallback : EntriesCallback, ?errorCallback : ErrorCallback ) : Void; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/DirectoryReaderSync.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("DirectoryReaderSync") 7 | extern class DirectoryReaderSync 8 | { 9 | function readEntries() : Array; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/EntriesCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef EntriesCallback = Array -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/Entry.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("Entry") 7 | extern class Entry 8 | { 9 | /** The file system on which the entry resides. */ 10 | var filesystem(default,null) : FileSystem; 11 | 12 | var fullPath(default,null) : String; 13 | 14 | /** The entry is a directory. */ 15 | var isDirectory(default,null) : Bool; 16 | 17 | /** The entry is a file. */ 18 | var isFile(default,null) : Bool; 19 | 20 | /** The name of the entry, excluding the path leading to it. */ 21 | var name(default,null) : String; 22 | 23 | function copyTo( parent : DirectoryEntry, ?name : String, ?successCallback : EntryCallback, ?errorCallback : ErrorCallback ) : Void; 24 | 25 | function getMetadata( successCallback : MetadataCallback, ?errorCallback : ErrorCallback ) : Void; 26 | 27 | function getParent( ?successCallback : EntryCallback, ?errorCallback : ErrorCallback ) : Void; 28 | 29 | function moveTo( parent : DirectoryEntry, ?name : String, ?successCallback : EntryCallback, ?errorCallback : ErrorCallback ) : Void; 30 | 31 | function remove( successCallback : js.cordova.plugin.fs.VoidCallback, ?errorCallback : ErrorCallback ) : Void; 32 | 33 | function toURL() : String; 34 | 35 | function toInternalURL() : String; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/EntryCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef EntryCallback = Entry -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/EntrySync.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("EntrySync") 7 | extern class EntrySync 8 | { 9 | var filesystem(default,null) : FileSystemSync; 10 | 11 | var fullPath(default,null) : String; 12 | 13 | var isDirectory(default,null) : Bool; 14 | 15 | var isFile(default,null) : Bool; 16 | 17 | var name(default,null) : String; 18 | 19 | function copyTo( parent : DirectoryEntrySync, name : String ) : EntrySync; 20 | 21 | function getMetadata() : Metadata; 22 | 23 | function getParent() : DirectoryEntrySync; 24 | 25 | function moveTo( parent : DirectoryEntrySync, name : String ) : EntrySync; 26 | 27 | function remove() : Void; 28 | 29 | function toURL() : String; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/ErrorCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef ErrorCallback = FileError -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef FileCallback = js.html.File -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileEntry.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileEntry") 7 | extern class FileEntry extends Entry 8 | { 9 | function createWriter( successCallback : FileWriterCallback, ?errorCallback : ErrorCallback ) : Void; 10 | 11 | function file( successCallback : FileCallback, ?errorCallback : ErrorCallback ) : Void; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileEntrySync.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileEntrySync") 7 | extern class FileEntrySync extends EntrySync 8 | { 9 | function createWriter() : FileWriterSync; 10 | 11 | function file() : js.html.File; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileError.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileError") 7 | extern class FileError 8 | { 9 | /** The file operation was aborted, probably due to a call to the FileReader abort() method. */ 10 | static inline var ABORT_ERR : Int = 3; 11 | 12 | /** The file data cannot be accurately represented in a data URL. */ 13 | static inline var ENCODING_ERR : Int = 5; 14 | 15 | static inline var INVALID_MODIFICATION_ERR : Int = 9; 16 | 17 | static inline var INVALID_STATE_ERR : Int = 7; 18 | 19 | /** File not found. */ 20 | static inline var NOT_FOUND_ERR : Int = 1; 21 | 22 | /** File could not be read. */ 23 | static inline var NOT_READABLE_ERR : Int = 4; 24 | 25 | static inline var NO_MODIFICATION_ALLOWED_ERR : Int = 6; 26 | 27 | static inline var PATH_EXISTS_ERR : Int = 12; 28 | 29 | static inline var QUOTA_EXCEEDED_ERR : Int = 10; 30 | 31 | /** The file could not be accessed for security reasons. */ 32 | static inline var SECURITY_ERR : Int = 2; 33 | 34 | static inline var SYNTAX_ERR : Int = 8; 35 | 36 | static inline var TYPE_MISMATCH_ERR : Int = 11; 37 | 38 | /** The error code. */ 39 | var code(default,null) : Int; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileException.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileException") 7 | extern class FileException 8 | { 9 | static inline var ABORT_ERR : Int = 3; 10 | 11 | static inline var ENCODING_ERR : Int = 5; 12 | 13 | static inline var INVALID_MODIFICATION_ERR : Int = 9; 14 | 15 | static inline var INVALID_STATE_ERR : Int = 7; 16 | 17 | static inline var NOT_FOUND_ERR : Int = 1; 18 | 19 | static inline var NOT_READABLE_ERR : Int = 4; 20 | 21 | static inline var NO_MODIFICATION_ALLOWED_ERR : Int = 6; 22 | 23 | static inline var PATH_EXISTS_ERR : Int = 12; 24 | 25 | static inline var QUOTA_EXCEEDED_ERR : Int = 10; 26 | 27 | static inline var SECURITY_ERR : Int = 2; 28 | 29 | static inline var SYNTAX_ERR : Int = 8; 30 | 31 | static inline var TYPE_MISMATCH_ERR : Int = 11; 32 | 33 | var code(default,null) : Int; 34 | 35 | var message(default,null) : String; 36 | 37 | var name(default,null) : String; 38 | 39 | function toString() : String; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileReader.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileReader") 7 | extern class FileReader extends js.html.EventTarget 8 | { 9 | var readyState(default,null) : Int; 10 | 11 | var error(default,null) : Dynamic; 12 | 13 | var result(default,null) : Dynamic; 14 | 15 | var onloadstart : js.html.Event -> Void; 16 | 17 | var onprogress : js.html.Event -> Void; 18 | 19 | var onload : js.html.Event -> Void; 20 | 21 | var onerror : js.html.Event -> Void; 22 | 23 | var onloadend : js.html.Event -> Void; 24 | 25 | var onabort : js.html.Event -> Void; 26 | 27 | function new(); 28 | 29 | function abort() : Void; 30 | 31 | function readAsText( file : js.html.File, encoding : String ) : Void; 32 | 33 | function readAsDataURL( file : js.html.File ) : Void; 34 | 35 | function readAsBinaryString( file : js.html.File ) : Void; 36 | 37 | function readAsArrayBuffer( file : js.html.File ) : Void; 38 | } 39 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileSystem.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("DOMFileSystem") 7 | extern class FileSystem 8 | { 9 | var name(default,null) : String; 10 | 11 | var root(default,null) : DirectoryEntry; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileSystemCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef FileSystemCallback = FileSystem -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileSystemSync.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("DOMFileSystemSync") 7 | extern class FileSystemSync 8 | { 9 | var name(default,null) : String; 10 | 11 | var root(default,null) : DirectoryEntrySync; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileWriter.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileWriter") 7 | extern class FileWriter extends js.html.EventTarget 8 | { 9 | static inline var DONE : Int = 2; 10 | 11 | static inline var INIT : Int = 0; 12 | 13 | static inline var WRITING : Int = 1; 14 | 15 | var error(default,null) : FileError; 16 | 17 | var length(default,null) : Int; 18 | 19 | var onabort : js.html.Event -> Void; 20 | 21 | var onerror : js.html.Event -> Void; 22 | 23 | var onprogress : js.html.Event -> Void; 24 | 25 | var onwrite : js.html.Event -> Void; 26 | 27 | var onwriteend : js.html.Event -> Void; 28 | 29 | var onwritestart : js.html.Event -> Void; 30 | 31 | var position(default,null) : Int; 32 | 33 | var readyState(default,null) : Int; 34 | 35 | function abort() : Void; 36 | 37 | function seek( position : Int ) : Void; 38 | 39 | function truncate( size : Int ) : Void; 40 | 41 | function write( data : js.html.Blob ) : Void; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileWriterCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef FileWriterCallback = FileWriter -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/FileWriterSync.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("FileWriterSync") 7 | extern class FileWriterSync 8 | { 9 | var length(default,null) : Int; 10 | 11 | var position(default,null) : Int; 12 | 13 | function seek( position : Int ) : Void; 14 | 15 | function truncate( size : Int ) : Void; 16 | 17 | function write( data : js.html.Blob ) : Void; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/Metadata.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | @:native("Metadata") 7 | extern class Metadata 8 | { 9 | var modificationTime(default,null) : Date; 10 | 11 | var size(default,null) : Int; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /js/cordova/plugin/fs/MetadataCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef MetadataCallback = Metadata -> Bool; -------------------------------------------------------------------------------- /js/cordova/plugin/fs/VoidCallback.hx: -------------------------------------------------------------------------------- 1 | package js.cordova.plugin.fs; 2 | 3 | /** 4 | This file is part of the Haxe externs for the [cordova-plugin-file](https://github.com/apache/cordova-plugin-file) plugin. 5 | **/ 6 | typedef VoidCallback = Void -> Void; 7 | --------------------------------------------------------------------------------