Documentation ¶
Overview ¶
Package runtime contains all the methods and data structures related to the runtime library of Wails. This includes both Go and JS runtimes.
Index ¶
- Variables
- func ProcessEncoding(text string) string
- type Browser
- type Dialog
- type Events
- func (r *Events) Emit(eventName string, optionalData ...interface{})
- func (r *Events) On(eventName string, callback func(optionalData ...interface{}))
- func (r *Events) OnMultiple(eventName string, callback func(optionalData ...interface{}), counter uint)
- func (r *Events) Once(eventName string, callback func(optionalData ...interface{}))
- type FileSystem
- type Log
- type Options
- type Runtime
- type Store
- type StoreProvider
- type Window
Constants ¶
This section is empty.
Variables ¶
var BridgeJS []byte
var InitJS []byte
var WailsCSS string
var WailsJS string
Functions ¶
func ProcessEncoding ¶ added in v0.19.0
ProcessEncoding attempts to convert CKJ strings to UTF-8
Types ¶
type Browser ¶
type Browser struct{}
Browser exposes browser methods to the runtime
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog exposes an interface to native dialogs
func NewDialog ¶
func NewDialog(renderer interfaces.Renderer) *Dialog
NewDialog creates a new Dialog struct
func (*Dialog) SelectDirectory ¶
SelectDirectory prompts the user to select a directory
func (*Dialog) SelectFile ¶
SelectFile prompts the user to select a file
func (*Dialog) SelectSaveFile ¶
SelectSaveFile prompts the user to select a file for saving
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events exposes the events interface
func NewEvents ¶
func NewEvents(eventManager interfaces.EventManager) *Events
NewEvents creates a new Events struct
func (*Events) OnMultiple ¶ added in v1.12.0
func (r *Events) OnMultiple(eventName string, callback func(optionalData ...interface{}), counter uint)
OnMultiple pass through
type FileSystem ¶
type FileSystem struct{}
FileSystem exposes file system utilities to the runtime
func (*FileSystem) HomeDir ¶
func (r *FileSystem) HomeDir() (string, error)
HomeDir returns the user's home directory
type Options ¶ added in v1.8.0
type Options struct { // The name of the store Name string // The runtime to attach the store to Runtime *Runtime // Indicates if notifying Go listeners should be notified of updates // synchronously (on the current thread) or asynchronously using // goroutines NotifySynchronously bool }
Options defines the optional data that may be used when creating a Store
type Runtime ¶ added in v1.8.0
type Runtime struct { Events *Events Log *Log Dialog *Dialog Window *Window Browser *Browser FileSystem *FileSystem Store *StoreProvider }
Runtime is the Wails Runtime Interface, given to a user who has defined the WailsInit method
func NewRuntime ¶ added in v1.8.0
func NewRuntime(eventManager interfaces.EventManager, renderer interfaces.Renderer) *Runtime
NewRuntime creates a new Runtime struct
type Store ¶ added in v1.8.0
type Store struct {
// contains filtered or unexported fields
}
Store is where we keep named data
func (*Store) Get ¶ added in v1.9.0
func (s *Store) Get() interface{}
Get returns the value of the data that's kept in the current state / Store
func (*Store) OnError ¶ added in v1.8.0
OnError takes a function that will be called whenever an error occurs
func (*Store) Set ¶ added in v1.8.0
Set will update the data held by the store and notify listeners of the change
type StoreProvider ¶ added in v1.8.0
type StoreProvider struct {
// contains filtered or unexported fields
}
StoreProvider is a struct that creates Stores
func NewStoreProvider ¶ added in v1.8.0
func NewStoreProvider(runtime *Runtime) *StoreProvider
NewStoreProvider creates new stores using the provided Runtime reference.
func (*StoreProvider) New ¶ added in v1.8.0
func (p *StoreProvider) New(name string, defaultValue interface{}) *Store
New creates a new store
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window exposes an interface for manipulating the window
func NewWindow ¶
func NewWindow(renderer interfaces.Renderer) *Window
NewWindow creates a new Window struct
func (*Window) SetMaxSize ¶ added in v1.13.0
SetMaxSize sets the maximum size of a resizable window
func (*Window) SetMinSize ¶ added in v1.13.0
SetMinSize sets the minimum size of a resizable window
func (*Window) UnFullscreen ¶
func (r *Window) UnFullscreen()
UnFullscreen attempts to restore the window to the size/position before fullscreen