Documentation ¶
Overview ¶
Package wakelock is to request a wake lock that prevents some aspect of the device from entering a power-saving state (e.g., preventing the system from turning off the screen).
Index ¶
- type PromiseWakeLock
- func (_this *PromiseWakeLock) Catch(onRejected *PromiseWakeLockOnRejected) (_result *PromiseWakeLock)
- func (_this *PromiseWakeLock) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseWakeLock)
- func (_this *PromiseWakeLock) JSValue() js.Value
- func (_this *PromiseWakeLock) Then(onFulfilled *PromiseWakeLockOnFulfilled, onRejected *PromiseWakeLockOnRejected) (_result *PromiseWakeLock)
- type PromiseWakeLockOnFulfilled
- type PromiseWakeLockOnFulfilledFunc
- type PromiseWakeLockOnRejected
- type PromiseWakeLockOnRejectedFunc
- type Union
- type WakeLock
- func (_this *WakeLock) Active() bool
- func (_this *WakeLock) AddEventActiveChange(listener func(event *domcore.Event, currentTarget *WakeLock)) js.Func
- func (_this *WakeLock) CreateRequest() (_result *WakeLockRequest)
- func (_this *WakeLock) OnActiveChange() domcore.EventHandlerFunc
- func (_this *WakeLock) SetOnActiveChange(listener func(event *domcore.Event, currentTarget *WakeLock)) js.Func
- func (_this *WakeLock) Type() WakeLockType
- type WakeLockRequest
- type WakeLockType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PromiseWakeLock ¶
type PromiseWakeLock struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: Promise
func PromiseWakeLockFromJS ¶
func PromiseWakeLockFromJS(value js.Value) *PromiseWakeLock
PromiseWakeLockFromJS is casting a js.Value into PromiseWakeLock.
func PromiseWakeLockFromWrapper ¶
func PromiseWakeLockFromWrapper(input core.Wrapper) *PromiseWakeLock
PromiseWakeLockFromJS is casting from something that holds a js.Value into PromiseWakeLock.
func (*PromiseWakeLock) Catch ¶
func (_this *PromiseWakeLock) Catch(onRejected *PromiseWakeLockOnRejected) (_result *PromiseWakeLock)
func (*PromiseWakeLock) Finally ¶
func (_this *PromiseWakeLock) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseWakeLock)
func (*PromiseWakeLock) JSValue ¶
func (_this *PromiseWakeLock) JSValue() js.Value
JSValue returns the js.Value or js.Null() if _this is nil
func (*PromiseWakeLock) Then ¶
func (_this *PromiseWakeLock) Then(onFulfilled *PromiseWakeLockOnFulfilled, onRejected *PromiseWakeLockOnRejected) (_result *PromiseWakeLock)
type PromiseWakeLockOnFulfilled ¶
PromiseWakeLockOnFulfilled is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromiseWakeLockOnFulfilledToJS ¶
func PromiseWakeLockOnFulfilledToJS(callback PromiseWakeLockOnFulfilledFunc) *PromiseWakeLockOnFulfilled
type PromiseWakeLockOnFulfilledFunc ¶
type PromiseWakeLockOnFulfilledFunc func(value *WakeLock)
callback: PromiseTemplateOnFulfilled
func PromiseWakeLockOnFulfilledFromJS ¶
func PromiseWakeLockOnFulfilledFromJS(_value js.Value) PromiseWakeLockOnFulfilledFunc
type PromiseWakeLockOnRejected ¶
PromiseWakeLockOnRejected is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromiseWakeLockOnRejectedToJS ¶
func PromiseWakeLockOnRejectedToJS(callback PromiseWakeLockOnRejectedFunc) *PromiseWakeLockOnRejected
type PromiseWakeLockOnRejectedFunc ¶
callback: PromiseTemplateOnRejected
func PromiseWakeLockOnRejectedFromJS ¶
func PromiseWakeLockOnRejectedFromJS(_value js.Value) PromiseWakeLockOnRejectedFunc
type Union ¶
func UnionFromJS ¶
type WakeLock ¶
type WakeLock struct {
domcore.EventTarget
}
class: WakeLock
func WakeLockFromJS ¶
WakeLockFromJS is casting a js.Value into WakeLock.
func WakeLockFromWrapper ¶
WakeLockFromJS is casting from something that holds a js.Value into WakeLock.
func (*WakeLock) AddEventActiveChange ¶
func (_this *WakeLock) AddEventActiveChange(listener func(event *domcore.Event, currentTarget *WakeLock)) js.Func
AddActiveChange is adding doing AddEventListener for 'ActiveChange' on target. This method is returning allocated javascript function that need to be released.
func (*WakeLock) CreateRequest ¶
func (_this *WakeLock) CreateRequest() (_result *WakeLockRequest)
func (*WakeLock) OnActiveChange ¶
func (_this *WakeLock) OnActiveChange() domcore.EventHandlerFunc
OnActiveChange returning attribute 'onactivechange' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*WakeLock) SetOnActiveChange ¶
func (_this *WakeLock) SetOnActiveChange(listener func(event *domcore.Event, currentTarget *WakeLock)) js.Func
SetOnActiveChange is assigning a function to 'onactivechange'. This This method is returning allocated javascript function that need to be released.
func (*WakeLock) Type ¶
func (_this *WakeLock) Type() WakeLockType
Type returning attribute 'type' with type WakeLockType (idl: WakeLockType).
type WakeLockRequest ¶
type WakeLockRequest struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: WakeLockRequest
func WakeLockRequestFromJS ¶
func WakeLockRequestFromJS(value js.Value) *WakeLockRequest
WakeLockRequestFromJS is casting a js.Value into WakeLockRequest.
func WakeLockRequestFromWrapper ¶
func WakeLockRequestFromWrapper(input core.Wrapper) *WakeLockRequest
WakeLockRequestFromJS is casting from something that holds a js.Value into WakeLockRequest.
func (*WakeLockRequest) Cancel ¶
func (_this *WakeLockRequest) Cancel()
func (*WakeLockRequest) JSValue ¶
func (_this *WakeLockRequest) JSValue() js.Value
JSValue returns the js.Value or js.Null() if _this is nil
type WakeLockType ¶
type WakeLockType int
enum: WakeLockType
const ( ScreenWakeLockType WakeLockType = iota SystemWakeLockType )
func WakeLockTypeFromJS ¶
func WakeLockTypeFromJS(value js.Value) WakeLockType
WakeLockTypeFromJS is converting a javascript value into a WakeLockType enum value.
func (*WakeLockType) JSValue ¶
func (this *WakeLockType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (WakeLockType) Value ¶
func (this WakeLockType) Value() string
Value is converting this into javascript defined string value