kvision / pl.treksoft.kvision.electron / Protocol

Protocol

external interface Protocol : EventEmitter

Functions

interceptBufferProtocol

abstract fun interceptBufferProtocol(scheme: String, handler: (request: InterceptBufferProtocolRequest, callback: (<ERROR CLASS>?) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

interceptFileProtocol

abstract fun interceptFileProtocol(scheme: String, handler: (request: InterceptFileProtocolRequest, callback: (filePath: String) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

interceptHttpProtocol

abstract fun interceptHttpProtocol(scheme: String, handler: (request: InterceptHttpProtocolRequest, callback: (redirectRequest: RedirectRequest) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

interceptStreamProtocol

abstract fun interceptStreamProtocol(scheme: String, handler: (request: InterceptStreamProtocolRequest, callback: (dynamic) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

interceptStringProtocol

abstract fun interceptStringProtocol(scheme: String, handler: (request: InterceptStringProtocolRequest, callback: (data: String?) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

isProtocolHandled

abstract fun isProtocolHandled(scheme: String, callback: (Error) -> Unit): Unit

registerBufferProtocol

abstract fun registerBufferProtocol(scheme: String, handler: (request: RegisterBufferProtocolRequest, callback: (dynamic) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

registerFileProtocol

abstract fun registerFileProtocol(scheme: String, handler: (request: RegisterFileProtocolRequest, callback: (filePath: String?) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

registerHttpProtocol

abstract fun registerHttpProtocol(scheme: String, handler: (request: RegisterHttpProtocolRequest, callback: (redirectRequest: RedirectRequest) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

registerServiceWorkerSchemes

abstract fun registerServiceWorkerSchemes(schemes: Array<String>): Unit

registerStandardSchemes

abstract fun registerStandardSchemes(schemes: Array<String>, options: RegisterStandardSchemesOptions? = definedExternally): Unit

registerStreamProtocol

abstract fun registerStreamProtocol(scheme: String, handler: (request: RegisterStreamProtocolRequest, callback: (dynamic) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

registerStringProtocol

abstract fun registerStringProtocol(scheme: String, handler: (request: RegisterStringProtocolRequest, callback: (data: String?) -> Unit) -> Unit, completion: ((Error) -> Unit)? = definedExternally): Unit

uninterceptProtocol

abstract fun uninterceptProtocol(scheme: String, completion: ((Error) -> Unit)? = definedExternally): Unit

unregisterProtocol

abstract fun unregisterProtocol(scheme: String, completion: ((Error) -> Unit)? = definedExternally): Unit

Inherited Functions

addListener

open fun addListener(event: String, listener: Function<*>): EventEmitter

emit

open fun emit(event: String, vararg args: Any): Boolean

eventNames

open fun eventNames(): Array<String>

getMaxListeners

open fun getMaxListeners(): Number

listenerCount

open fun listenerCount(type: String): Number

listeners

open fun listeners(event: String): Array<Function<*>>

on

open fun on(event: String, listener: Function<*>): EventEmitter

once

open fun once(event: String, listener: Function<*>): EventEmitter

prependListener

open fun prependListener(event: String, listener: Function<*>): EventEmitter

prependOnceListener

open fun prependOnceListener(event: String, listener: Function<*>): EventEmitter

removeAllListeners

open fun removeAllListeners(event: String? = definedExternally): EventEmitter

removeListener

open fun removeListener(event: String, listener: Function<*>): EventEmitter

setMaxListeners

open fun setMaxListeners(n: Number): EventEmitter

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.