Documentation ¶
Overview ¶
Package notification allows web pages to control the display of system notifications to the end user.
Source: Notifications API Standard (https://notifications.spec.whatwg.org/)
Index ¶
- func MaxActions() uint
- type Direction
- type GetNotificationOptions
- type Notification
- func (_this *Notification) Actions() *javascript.FrozenArray
- func (_this *Notification) AddEventClick(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) AddEventClose(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) AddEventError(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) AddEventShow(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) Badge() string
- func (_this *Notification) Body() string
- func (_this *Notification) Close()
- func (_this *Notification) Data() js.Value
- func (_this *Notification) Dir() Direction
- func (_this *Notification) Icon() string
- func (_this *Notification) Image() string
- func (_this *Notification) Lang() string
- func (_this *Notification) OnClick() domcore.EventHandlerFunc
- func (_this *Notification) OnClose() domcore.EventHandlerFunc
- func (_this *Notification) OnError() domcore.EventHandlerFunc
- func (_this *Notification) OnShow() domcore.EventHandlerFunc
- func (_this *Notification) Renotify() bool
- func (_this *Notification) RequireInteraction() bool
- func (_this *Notification) SetOnClick(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) SetOnClose(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) SetOnError(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) SetOnShow(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
- func (_this *Notification) Silent() bool
- func (_this *Notification) Tag() string
- func (_this *Notification) Timestamp() int
- func (_this *Notification) Title() string
- func (_this *Notification) Vibrate() *javascript.FrozenArray
- type NotificationAction
- type Options
- type PermissionCallback
- type PermissionCallbackFunc
- type PermissionMode
- type PromisePermissionMode
- func (_this *PromisePermissionMode) Catch(onRejected *PromisePermissionModeOnRejected) (_result *PromisePermissionMode)
- func (_this *PromisePermissionMode) Finally(onFinally *javascript.PromiseFinally) (_result *PromisePermissionMode)
- func (_this *PromisePermissionMode) JSValue() js.Value
- func (_this *PromisePermissionMode) Then(onFulfilled *PromisePermissionModeOnFulfilled, ...) (_result *PromisePermissionMode)
- type PromisePermissionModeOnFulfilled
- type PromisePermissionModeOnFulfilledFunc
- type PromisePermissionModeOnRejected
- type PromisePermissionModeOnRejectedFunc
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxActions ¶
func MaxActions() uint
MaxActions returning attribute 'maxActions' with type uint (idl: unsigned long).
Types ¶
type Direction ¶
type Direction int
enum: NotificationDirection
func DirectionFromJS ¶
DirectionFromJS is converting a javascript value into a Direction enum value.
type GetNotificationOptions ¶
type GetNotificationOptions struct {
Tag string
}
dictionary: GetNotificationOptions
func GetNotificationOptionsFromJS ¶
func GetNotificationOptionsFromJS(value js.Wrapper) *GetNotificationOptions
GetNotificationOptionsFromJS is allocating a new GetNotificationOptions object and copy all values from input javascript object
func (*GetNotificationOptions) JSValue ¶
func (_this *GetNotificationOptions) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type Notification ¶
type Notification struct {
domcore.EventTarget
}
class: Notification
func New ¶
func New(title string, options *Options) (_result *Notification)
func NotificationFromJS ¶
func NotificationFromJS(value js.Wrapper) *Notification
NotificationFromJS is casting a js.Wrapper into Notification.
func (*Notification) Actions ¶
func (_this *Notification) Actions() *javascript.FrozenArray
Actions returning attribute 'actions' with type javascript.FrozenArray (idl: FrozenArray).
func (*Notification) AddEventClick ¶
func (_this *Notification) AddEventClick(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
AddClick is adding doing AddEventListener for 'Click' on target. This method is returning allocated javascript function that need to be released.
func (*Notification) AddEventClose ¶
func (_this *Notification) AddEventClose(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
AddClose is adding doing AddEventListener for 'Close' on target. This method is returning allocated javascript function that need to be released.
func (*Notification) AddEventError ¶
func (_this *Notification) AddEventError(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
AddError is adding doing AddEventListener for 'Error' on target. This method is returning allocated javascript function that need to be released.
func (*Notification) AddEventShow ¶
func (_this *Notification) AddEventShow(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
AddShow is adding doing AddEventListener for 'Show' on target. This method is returning allocated javascript function that need to be released.
func (*Notification) Badge ¶
func (_this *Notification) Badge() string
Badge returning attribute 'badge' with type string (idl: USVString).
func (*Notification) Body ¶
func (_this *Notification) Body() string
Body returning attribute 'body' with type string (idl: DOMString).
func (*Notification) Close ¶
func (_this *Notification) Close()
func (*Notification) Data ¶
func (_this *Notification) Data() js.Value
Data returning attribute 'data' with type Any (idl: any).
func (*Notification) Dir ¶
func (_this *Notification) Dir() Direction
Dir returning attribute 'dir' with type Direction (idl: NotificationDirection).
func (*Notification) Icon ¶
func (_this *Notification) Icon() string
Icon returning attribute 'icon' with type string (idl: USVString).
func (*Notification) Image ¶
func (_this *Notification) Image() string
Image returning attribute 'image' with type string (idl: USVString).
func (*Notification) Lang ¶
func (_this *Notification) Lang() string
Lang returning attribute 'lang' with type string (idl: DOMString).
func (*Notification) OnClick ¶
func (_this *Notification) OnClick() domcore.EventHandlerFunc
OnClick returning attribute 'onclick' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*Notification) OnClose ¶
func (_this *Notification) OnClose() domcore.EventHandlerFunc
OnClose returning attribute 'onclose' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*Notification) OnError ¶
func (_this *Notification) OnError() domcore.EventHandlerFunc
OnError returning attribute 'onerror' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*Notification) OnShow ¶
func (_this *Notification) OnShow() domcore.EventHandlerFunc
OnShow returning attribute 'onshow' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*Notification) Renotify ¶
func (_this *Notification) Renotify() bool
Renotify returning attribute 'renotify' with type bool (idl: boolean).
func (*Notification) RequireInteraction ¶
func (_this *Notification) RequireInteraction() bool
RequireInteraction returning attribute 'requireInteraction' with type bool (idl: boolean).
func (*Notification) SetOnClick ¶
func (_this *Notification) SetOnClick(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
SetOnClick is assigning a function to 'onclick'. This This method is returning allocated javascript function that need to be released.
func (*Notification) SetOnClose ¶
func (_this *Notification) SetOnClose(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
SetOnClose is assigning a function to 'onclose'. This This method is returning allocated javascript function that need to be released.
func (*Notification) SetOnError ¶
func (_this *Notification) SetOnError(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
SetOnError is assigning a function to 'onerror'. This This method is returning allocated javascript function that need to be released.
func (*Notification) SetOnShow ¶
func (_this *Notification) SetOnShow(listener func(event *domcore.Event, currentTarget *Notification)) js.Func
SetOnShow is assigning a function to 'onshow'. This This method is returning allocated javascript function that need to be released.
func (*Notification) Silent ¶
func (_this *Notification) Silent() bool
Silent returning attribute 'silent' with type bool (idl: boolean).
func (*Notification) Tag ¶
func (_this *Notification) Tag() string
Tag returning attribute 'tag' with type string (idl: DOMString).
func (*Notification) Timestamp ¶
func (_this *Notification) Timestamp() int
Timestamp returning attribute 'timestamp' with type int (idl: unsigned long long).
func (*Notification) Title ¶
func (_this *Notification) Title() string
Title returning attribute 'title' with type string (idl: DOMString).
func (*Notification) Vibrate ¶
func (_this *Notification) Vibrate() *javascript.FrozenArray
Vibrate returning attribute 'vibrate' with type javascript.FrozenArray (idl: FrozenArray).
type NotificationAction ¶
dictionary: NotificationAction
func NotificationActionFromJS ¶
func NotificationActionFromJS(value js.Wrapper) *NotificationAction
NotificationActionFromJS is allocating a new NotificationAction object and copy all values from input javascript object
func (*NotificationAction) JSValue ¶
func (_this *NotificationAction) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type Options ¶
type Options struct { Dir Direction Lang string Body string Tag string Image string Icon string Badge string Timestamp int Renotify bool Silent bool RequireInteraction bool Data js.Value Actions []*NotificationAction }
dictionary: NotificationOptions
func OptionsFromJS ¶
OptionsFromJS is allocating a new Options object and copy all values from input javascript object
type PermissionCallback ¶
PermissionCallback is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PermissionCallbackToJS ¶
func PermissionCallbackToJS(callback PermissionCallbackFunc) *PermissionCallback
type PermissionCallbackFunc ¶
type PermissionCallbackFunc func(permission PermissionMode)
callback: NotificationPermissionCallback
func PermissionCallbackFromJS ¶
func PermissionCallbackFromJS(_value js.Value) PermissionCallbackFunc
type PermissionMode ¶
type PermissionMode int
enum: NotificationPermission
const ( Default PermissionMode = iota Denied Granted )
func Permission ¶
func Permission() PermissionMode
Permission returning attribute 'permission' with type PermissionMode (idl: NotificationPermission).
func PermissionModeFromJS ¶
func PermissionModeFromJS(value js.Value) PermissionMode
PermissionModeFromJS is converting a javascript value into a PermissionMode enum value.
func (*PermissionMode) JSValue ¶
func (this *PermissionMode) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (PermissionMode) Value ¶
func (this PermissionMode) Value() string
Value is converting this into javascript defined string value
type PromisePermissionMode ¶
type PromisePermissionMode struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: Promise
func PromisePermissionModeFromJS ¶
func PromisePermissionModeFromJS(value js.Wrapper) *PromisePermissionMode
PromisePermissionModeFromJS is casting a js.Wrapper into PromisePermissionMode.
func RequestPermission ¶
func RequestPermission(deprecatedCallback *PermissionCallback) (_result *PromisePermissionMode)
func (*PromisePermissionMode) Catch ¶
func (_this *PromisePermissionMode) Catch(onRejected *PromisePermissionModeOnRejected) (_result *PromisePermissionMode)
func (*PromisePermissionMode) Finally ¶
func (_this *PromisePermissionMode) Finally(onFinally *javascript.PromiseFinally) (_result *PromisePermissionMode)
func (*PromisePermissionMode) JSValue ¶
func (_this *PromisePermissionMode) JSValue() js.Value
func (*PromisePermissionMode) Then ¶
func (_this *PromisePermissionMode) Then(onFulfilled *PromisePermissionModeOnFulfilled, onRejected *PromisePermissionModeOnRejected) (_result *PromisePermissionMode)
type PromisePermissionModeOnFulfilled ¶
PromisePermissionModeOnFulfilled is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromisePermissionModeOnFulfilledToJS ¶
func PromisePermissionModeOnFulfilledToJS(callback PromisePermissionModeOnFulfilledFunc) *PromisePermissionModeOnFulfilled
type PromisePermissionModeOnFulfilledFunc ¶
type PromisePermissionModeOnFulfilledFunc func(value PermissionMode)
callback: PromiseTemplateOnFulfilled
func PromisePermissionModeOnFulfilledFromJS ¶
func PromisePermissionModeOnFulfilledFromJS(_value js.Value) PromisePermissionModeOnFulfilledFunc
type PromisePermissionModeOnRejected ¶
PromisePermissionModeOnRejected is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromisePermissionModeOnRejectedToJS ¶
func PromisePermissionModeOnRejectedToJS(callback PromisePermissionModeOnRejectedFunc) *PromisePermissionModeOnRejected
type PromisePermissionModeOnRejectedFunc ¶
callback: PromiseTemplateOnRejected
func PromisePermissionModeOnRejectedFromJS ¶
func PromisePermissionModeOnRejectedFromJS(_value js.Value) PromisePermissionModeOnRejectedFunc