Kotlin bindings for core Apache Cordova API.
object Battery
Main object for Cordova battery. |
|
external class BatteryStatus
Battery status. |
|
external class Browser
InAppBrowser reference object. |
|
object Camera
Main object for Cordova camera. |
|
data class CameraOptions
Camera options. |
|
external class Coordinates
Geolocation coordinates values. |
|
enum class CordovaEvent
Cordova event types. |
|
external class Device
Device information class. |
|
external interface DirectoryEntry : Entry |
|
external interface DirectoryEntryCallback |
|
external interface DirectoryEntrySync : EntrySync |
|
external interface DirectoryReader |
|
external interface DirectoryReaderSync |
|
external interface EntriesCallback |
|
external interface Entry |
|
external interface EntryCallback |
|
external interface EntrySync |
|
external interface ErrorCallback |
|
object File
Main object for Cordova file. |
|
external interface FileCallback |
|
external interface FileEntry : Entry |
|
external interface FileEntryCallback |
|
external interface FileEntrySync : EntrySync |
|
external interface FileSaver : EventTarget |
|
external interface FileSystem |
|
external interface FileSystemCallback |
|
external interface FileSystemSync |
|
external interface FileWriter : FileSaver |
|
external interface FileWriterCallback |
|
external interface FileWriterSync |
|
external interface Flags |
|
object Geolocation
Main geolocation object based on webview api. |
|
object InAppBrowser
Main object for Cordova InAppBrowser api. |
|
external class InAppBrowserEvent
InAppBrowser event type. |
|
external object LocalFileSystem |
|
external object LocalFileSystemSync |
|
object Locationservices
Main geolocation object based on Google location services api. |
|
external class Media
Cordova media class. |
|
object MediaCapture
Main media capture object. |
|
external class MediaError
Media error class. |
|
external class MediaFile
Media file information class. |
|
external class MediaFileData
Media file details class. |
|
external interface Metadata |
|
external interface MetadataCallback |
|
object Network
Main object for Cordova network. |
|
object Notification
Main object for Cordova notifications. |
|
external class PendingResult
Pending result class. |
|
external class Position
Geolocation position value. |
|
enum class PositionError
Geolocaton error codes. |
|
external class PromptResponse
A response object for prompt function callback. |
|
sealed class Result<out V : Any, out E> |
|
external class ResumeEvent
Resume event class. |
|
object Screen
Main object for Cordova screen. |
|
object Splashscreen
Main object for Cordova splashscreen. |
|
object StatusBar
Main object for Cordova status bar. |
|
external class SystemDirs
System directories class. |
|
object Vibration
Main object for Cordova vibration. |
|
external interface VoidCallback |
class CameraException : Exception
Exception class for camera errors. |
|
class CaptureException : Exception
Exception class for media capture errors. |
|
class FileException : Exception
Exception class for file errors. |
|
class GeolocationException : Exception
Exception class for geolocation errors. |
var cordovaDevice: Device?
Cordova device information object. |
fun addCordovaEventListener(event: CordovaEvent, listener: (Event) -> Unit): Unit
Add listeners for a Cordova events. |
|
fun addDeviceReadyListener(listener: (Device) -> Unit): Unit
Add listeners for 'deviceready' Cordova event. |
|
fun addPauseListener(listener: () -> Unit): Unit
Add listeners for 'pause' Cordova event. |
|
fun addResumeListener(listener: (ResumeEvent) -> Unit): Unit
Add listeners for 'resume' Cordova event. |
|
fun <V : Any, E> Result<V, E>.any(predicate: (V) -> Boolean): Boolean |
|
suspend fun FileEntry.append(data: <ERROR CLASS>): Result<FileEntry, FileException>
Append file content from a Blob. suspend fun FileEntry.append(data: String): Result<FileEntry, FileException>
Append file content from a plain string. |
|
suspend fun Entry.copyTo(parent: DirectoryEntry, newName: String? = null): Result<Entry, FileException>
Copy given file or directory to a new location. |
|
suspend fun FileEntry.createWriter(): Result<FileWriter, FileException>
Create a FileWriter object for a given file entry. |
|
fun <E> Result<*, E>.failure(f: (E) -> Unit): Unit |
|
fun <V : Any, U : Any> Result<V, *>.fanout(other: () -> Result<U, *>): Result<Pair<V, U>, *> |
|
suspend fun FileEntry.file(): Result<File, FileException>
Get a File object for a given file entry. |
|
fun <V : Any, U : Any, E> Result<V, E>.flatMap(transform: (V) -> Result<U, E>): Result<U, E> |
|
fun <V : Any, E, E2> Result<V, E>.flatMapError(transform: (E) -> Result<V, E2>): Result<V, E2> |
|
fun <X> Result<*, *>.getAs(): X? |
|
suspend fun Media.getCurrentAmplitude(): Number
Returns the current amplitude within an audio file. |
|
suspend fun Media.getCurrentPosition(): Number
Returns the current position within an audio file. |
|
suspend fun getDevice(): Device
Suspending function to return device information object. |
|
suspend fun DirectoryEntry.getDirectory(path: String, create: Boolean = true, exclusive: Boolean = false): Result<DirectoryEntry, FileException>
Get or create a directory in a given parent directory. |
|
suspend fun DirectoryEntry.getFile(path: String, create: Boolean = true, exclusive: Boolean = false): Result<FileEntry, FileException>
Get or create a file in a given parent directory. |
|
suspend fun MediaFile.getFormatData(): MediaFileData?
Get details for the given file. |
|
suspend fun Entry.getMetadata(): Result<Metadata, FileException>
Get file or directory metadata. |
|
infix fun <V : Any, E> Result<V, E>.getOrElse(fallback: V): V |
|
suspend fun Entry.getParent(): Result<DirectoryEntry, FileException>
Get file or directory parent directory entry. |
|
operator fun FileSystemCallback.invoke(filesystem: FileSystem): Unit operator fun EntryCallback.invoke(entry: Entry): Unit operator fun FileEntryCallback.invoke(entry: FileEntry): Unit operator fun DirectoryEntryCallback.invoke(entry: DirectoryEntry): Unit operator fun EntriesCallback.invoke(entries: Array<Entry>): Unit operator fun MetadataCallback.invoke(metadata: Metadata): Unit operator fun FileWriterCallback.invoke(fileWriter: FileWriter): Unit operator fun FileCallback.invoke(file: File): Unit operator fun VoidCallback.invoke(): Unit operator fun ErrorCallback.invoke(err: Error): Unit |
|
fun <V : Any, U : Any, E> Result<V, E>.map(transform: (V) -> U): Result<U, E> |
|
fun <V : Any, E, E2> Result<V, E>.mapError(transform: (E) -> E2): Result<V, E2> |
|
suspend fun Entry.moveTo(parent: DirectoryEntry, newName: String? = null): Result<Entry, FileException>
Move given file or directory to a new location. |
|
infix fun <V : Any, E> Result<V, E>.or(fallback: V): Result.Success<V> |
|
suspend fun FileEntry.readAsArrayBuffer(): Result<<ERROR CLASS>, FileException>
Read file content as an array buffer. |
|
suspend fun FileEntry.readAsDataURL(): Result<String, FileException>
Read file content as a data url. |
|
suspend fun FileEntry.readAsText(): Result<String, FileException>
Read file content as a plain string. |
|
suspend fun DirectoryReader.readEntries(): Result<List<Entry>, FileException>
List directory entries for a given DirectoryReader. suspend fun DirectoryEntry.readEntries(): Result<List<Entry>, FileException>
List directory entries for a given parent directory entry. |
|
suspend fun Entry.remove(): Result<Entry, FileException>
Remove given file or directory. |
|
suspend fun DirectoryEntry.removeRecursively(): Result<DirectoryEntry, FileException>
Remove given directory recursively. |
|
fun <V : Any> Result<V, *>.success(f: (V) -> Unit): Unit |
|
fun <ERROR CLASS>.toBlob(): <ERROR CLASS>
Convert array buffer to a blob. |
|
suspend fun FileEntry.write(data: <ERROR CLASS>): Result<FileEntry, FileException>
Write file content from a Blob. suspend fun FileEntry.write(data: String): Result<FileEntry, FileException>
Write file content from a plain string. |
|
suspend fun FileEntry.writeDataUrL(dataUrl: String): Result<FileEntry, FileException>
Write file content from a data url. |