notification

package
v0.0.0-...-41cedfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

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

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

const (
	Auto Direction = iota
	LeftToRight
	RightToLeft
)

func DirectionFromJS

func DirectionFromJS(value js.Value) Direction

DirectionFromJS is converting a javascript value into a Direction enum value.

func (*Direction) JSValue

func (this *Direction) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (Direction) Value

func (this Direction) Value() string

Value is converting this into javascript defined string value

type GetNotificationOptions

type GetNotificationOptions struct {
	Tag string
}

dictionary: GetNotificationOptions

func GetNotificationOptionsFromJS

func GetNotificationOptionsFromJS(value js.Value) *GetNotificationOptions

GetNotificationOptionsFromJS is allocating a new GetNotificationOptions object and copy all values in the value javascript object.

func (*GetNotificationOptions) JSValue

func (_this *GetNotificationOptions) JSValue() js.Value

JSValue is allocating a new javascript 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.Value) *Notification

NotificationFromJS is casting a js.Value into Notification.

func NotificationFromWrapper

func NotificationFromWrapper(input core.Wrapper) *Notification

NotificationFromJS is casting from something that holds a js.Value 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

type NotificationAction struct {
	Action string
	Title  string
	Icon   string
}

dictionary: NotificationAction

func NotificationActionFromJS

func NotificationActionFromJS(value js.Value) *NotificationAction

NotificationActionFromJS is allocating a new NotificationAction object and copy all values in the value javascript object.

func (*NotificationAction) JSValue

func (_this *NotificationAction) JSValue() js.Value

JSValue is allocating a new javascript 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

func OptionsFromJS(value js.Value) *Options

OptionsFromJS is allocating a new Options object and copy all values in the value javascript object.

func (*Options) JSValue

func (_this *Options) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type PermissionCallback

type PermissionCallback js.Func

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.Value) *PromisePermissionMode

PromisePermissionModeFromJS is casting a js.Value into PromisePermissionMode.

func PromisePermissionModeFromWrapper

func PromisePermissionModeFromWrapper(input core.Wrapper) *PromisePermissionMode

PromisePermissionModeFromJS is casting from something that holds a js.Value into PromisePermissionMode.

func RequestPermission

func RequestPermission(deprecatedCallback *PermissionCallback) (_result *PromisePermissionMode)

func (*PromisePermissionMode) Catch

func (*PromisePermissionMode) Finally

func (_this *PromisePermissionMode) Finally(onFinally *javascript.PromiseFinally) (_result *PromisePermissionMode)

func (*PromisePermissionMode) JSValue

func (_this *PromisePermissionMode) JSValue() js.Value

JSValue returns the js.Value or js.Null() if _this is nil

func (*PromisePermissionMode) Then

type PromisePermissionModeOnFulfilled

type PromisePermissionModeOnFulfilled js.Func

PromisePermissionModeOnFulfilled is a javascript function type.

Call Release() when done to release resouces allocated to this type.

type PromisePermissionModeOnFulfilledFunc

type PromisePermissionModeOnFulfilledFunc func(value PermissionMode)

callback: PromiseTemplateOnFulfilled

func PromisePermissionModeOnFulfilledFromJS

func PromisePermissionModeOnFulfilledFromJS(_value js.Value) PromisePermissionModeOnFulfilledFunc

type PromisePermissionModeOnRejected

type PromisePermissionModeOnRejected js.Func

PromisePermissionModeOnRejected is a javascript function type.

Call Release() when done to release resouces allocated to this type.

type PromisePermissionModeOnRejectedFunc

type PromisePermissionModeOnRejectedFunc func(reason js.Value)

callback: PromiseTemplateOnRejected

func PromisePermissionModeOnRejectedFromJS

func PromisePermissionModeOnRejectedFromJS(_value js.Value) PromisePermissionModeOnRejectedFunc

type Union

type Union struct {
	Value js.Value
}

func UnionFromJS

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue

func (u *Union) JSValue() js.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL