[v2] Docs update

This commit is contained in:
Lea Anthony
2021-09-27 19:35:30 +10:00
parent 511d0da2cb
commit 589eb3864f
150 changed files with 19195 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
---
sidebar_position: 1
---
# Introduction
The runtime is a library that provides utility methods for your application. There is both a Go and Javascript runtime
and the aim is to try and keep them at parity where possible.
The Go Runtime is available through importing `github.com/wailsapp/wails/v2/pkg/runtime`. All methods in this package
take a context as the first parameter. This context can be obtained from the [OnStartup](/docs/reference/options#OnStartup)
or [OnDomReady](/docs/reference/options#OnDomReady) hooks.
The Javascript library is available to the frontend via the `window.runtime` map. There is a runtime package generated when using `dev`
mode that provides Typescript declarations for the runtime. This should be located in the `wailsjs` directory in your
frontend directory.