text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
package buildtags
import (
"reflect"
"testing"
)
func TestParse(t *testing.T) {
tests := []struct {
name string
tags string
want []string
wantErr bool
}{
{
name: "should support single tags",
tags: "test",
want: []string{"test"},
wantErr: false,
},
{
name: "should... | fim | wailsapp/wails | go |
<|fim_prefix|>package git
import (
"encoding/json"
"fmt"
"runtime"
"strings"
"github.com/wailsapp/wails/v2/internal/shell"
)
func gitcommand() string {
gitcommand := "git"
if runtime.GOOS == "windows" {
gitcommand = "git.exe"
}
return gitcommand
}
// IsInstalled returns true if git is installed for the ... | fim | wailsapp/wails | go |
<|fim_suffix|> name: "Escape Apostrophe",
args: args{
str: `John O'Keefe`,
},
want: `John O'Keefe`,
},
{
name: "Escape backslash",
args: args{
str: `MYDOMAIN\USER`,
},
want: `MYDOMAIN\\USER`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := Escap... | fim | wailsapp/wails | go |
<|fim_suffix|>sage)
os.Exit(1)
}
<|fim_prefix|>package logger
import (
"os"
)
// DefaultLogger is a utility to log messages to a number of destinations
type DefaultLogger struct{}
// NewDefaultLogger creates a new Logger.
func NewDefaultLogger() Logger {
return &DefaultLogger{}
}
// Print works like Sprintf.
fun... | fim | wailsapp/wails | go |
<|fim_suffix|> " + message)
}
// Fatal level logging. Works like Sprintf.
func (l *FileLogger) Fatal(message string) {
l.Println("FATAL | " + message)
os.Exit(1)
}
<|fim_prefix|>package logger
import (
"log"
"os"
)
// FileLogger is a utility to log messages to a number of destinations
type FileLogger struct {
f... | fim | wailsapp/wails | go |
<|fim_prefix|>package logger
import (
"fmt"
"strings"
)
// LogLevel is an unsigned 8bit int
type LogLevel uint8
const (
// TRACE level
TRACE LogLevel = 1
// DEBUG level logging
DEBUG LogLevel = 2
// INFO level <|fim_suffix|>urn "warning"
case ERROR:
return "error"
default:
return "debug"
}
}
// Logg... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package mac provides MacOS related utility functions for Wails applications
package mac
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/leaanthony/slicer"
"github.com/pkg/errors"
"github.com/wailsapp/wails/v2/internal/shell"
)
// StartAtLogin will either add or remove this applicati... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package mac provides MacOS related utility functions for Wails applications
package mac
import (
"fmt"
"github.com/pkg/errors"
"github.com/wailsapp/wails/v2/internal/shell"
)
// ShowNotification will either add or remove this application to/from the login
// items, depending on the given boolean ... | fim | wailsapp/wails | go |
<|fim_suffix|>{"Message only", "", "", "I am a message!", "", false},
{"Sound only", "", "", "", "submarine.aiff", false},
{"Full", "Title", "Subtitle", "This is a long message to show that text gets wrapped in a notification", "submarine.aiff", false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testin... | fim | wailsapp/wails | go |
package menu
type CallbackData struct {
MenuItem *MenuItem
// ContextData string
}
type Callback func(*CallbackData)
<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>package main
import (
"bytes"
_ "embed"
"encoding/json"
"io"
"log"
"net/http"
"os"
"path/filepath"
"te<|fim_suffix|> Rgb Rgb `json:"rgb"`
Hsl Hsl `json:"hsl"`
Name string `json:"name"`
}
//go:embed gen.tmpl
var Template string
func main() {
var Cols []InputCol
resp,... | fim | wailsapp/wails | go |
<|fim_prefix|>package menu
type Rgb struct {
R uint8 `json:"r"`
G uint8 `json:"g"`
B uint8 `json:"b"`
}
type Hsl struct {
H float64 `json:"h"`
S float64 `json:"s"`
L float64 `json:"l"`
}
type Col struct {
Hex string `json:"hex"`
Rgb Rgb `json:"rgb"`
Hsl Hsl `json:"hsl"`
Name string `json:"name"`
}... | fim | wailsapp/wails | go |
<|fim_prefix|>package menu
type Contex<|fim_suffix|> }
}
<|fim_middle|>tMenu struct {
ID string
Menu *Menu
}
func NewContextMenu(ID string, menu *Menu) *ContextMenu {
return &ContextMenu{
ID: ID,
Menu: menu,
<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>package keys
import (
"fmt"
"strings"
)
// Modifier is actually a string
type Modifier string
const (
// CmdOrCtrlKey represents Command on Mac and Control on other platforms
CmdOrCtrlKey Modifier = "cmdorctrl"
// OptionOrAltKey represents Option on Mac and Alt on other platforms
OptionOrAltKey M... | fim | wailsapp/wails | go |
package keys
const (
NSEventModifierFlagShift = 1 << 17 // Set if Shift key is pressed.
NSEventModifierFlagControl = 1 << 18 // Set if Control key is pressed.
NSEventModifierFlagOption = 1 << 19 // Set if Option or Alternate key is pressed.
NSEventModifierFlagCommand = 1 << 20 // Set if Command key is pressed.
... | fim | wailsapp/wails | go |
package keys
import "testing"
func TestToMacModifier(t *testing.T) {
tests := []struct {
name string
accelerator *Accelerator
want int
}{
// TODO: Add test cases.
{"nil", nil, 0},
{"empty", &Accelerator{}, 0},
{"key", &Accelerator{Key: "p"}, 0},
{"cmd", CmdOrCtrl(""), NSEventModifierF... | fim | wailsapp/wails | go |
<|fim_prefix|>package keys
import (
"fmt"
"strconv"
"strings"
"github.com/leaanthony/slicer"
)
var namedKeys = slicer.String([]string{"backspace", "tab", "return", "enter", "escape", "left", "right", "up", "down", "space", "delete", "home", "end", "page up", "page down", "f1", "f2", "f3", "f4", "f5", "f6", "f7",... | fim | wailsapp/wails | go |
<|fim_suffix|>t, err := Parse(d)
i.True(err != nil)
i.Equal(result, nil)
}
}
<|fim_prefix|>package keys
import (
"testing"
"github.com/matryer/is"
)
func TestParse(t *testing.T) {
i := is.New(t)
type args struct {
Input string
Expected *Accelerator
}
gooddata := []args{
{"CmdOrCtrl+A", CmdOrCt... | fim | wailsapp/wails | go |
<|fim_suffix|>cer.String()
for _, modifier := range accelerator.Modifiers {
result.Add(modifierStringMap[platform][modifier])
}
result.Deduplicate()
result.Add(strings.ToUpper(accelerator.Key))
return result.Join("+")
}
<|fim_prefix|>package keys
import (
"strings"
"github.com/leaanthony/slicer"
)
var modif... | fim | wailsapp/wails | go |
package keys
import (
"strconv"
"testing"
)
func TestStringify(t *testing.T) {
const Windows = "windows"
const Mac = "darwin"
const Linux = "linux"
tests := []struct {
arg *Accelerator
want string
platform string
}{
// Single Keys
{Key("a"), "A", Windows},
{Key(""), "", Windows},
{Key("... | fim | wailsapp/wails | go |
<|fim_prefix|>package menu
/*
// DefaultMacMenu returns a default menu including the default
// Application and Edit me<|fim_suffix|>() *Menu {
return NewMenuFromItems(
AppMenu(),
EditMenu(),
)
}
*/
<|fim_middle|>nus. Use `.Append()` to add to it.
func DefaultMacMenu<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>package menu
import "github.com/wailsapp/wails/v2/pkg/menu/keys"
type Menu struct {
Items []*MenuItem
}
func NewMenu() *Menu {
return &Menu{}
}
func (m *Menu) Append(item *MenuItem) {
m.Items = append(m.Items, item)
}
// Merge will append the items in the given menu
// into this menu
func (m *Menu... | fim | wailsapp/wails | go |
<|fim_suffix|>unc (m *MenuItem) Show() *MenuItem {
m.Hidden = false
return m
}
func (m *MenuItem) IsRadio() bool {
return m.Type == RadioType
}
func Label(label string) *MenuItem {
return &MenuItem{
Type: TextType,
Label: label,
}
}
// Text is a helper to create basic Text menu items
func Text(label string... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package menu provides all the functions and structs related to menus in a Wails application.
// Heavily inspired by Electron (c) 2013-2020 Github Inc.
// Electron License: https://github.com/electron/electron/blob/master/LICENSE
package menu
// Role is a type to identify menu roles
type Role int
// T... | fim | wailsapp/wails | go |
<|fim_suffix|>equence
}
var r, g, b uint8
ri, err := strconv.Atoi(params[index+2])
if err != nil {
return nil, invalidTrueColorSequence
}
gi, err := strconv.Atoi(params[index+3])
if err != nil {
return nil, invalidTrueColorSequence
}
bi, err := strconv.Atoi(params[index+4])... | fim | wailsapp/wails | go |
<|fim_suffix|>Name, w.FgCol.Name)
}
is.Equal(got[index].Style, w.Style)
}
})
}
}
func TestParseAnsi256(t *testing.T) {
is := is.New(t)
tests := []struct {
name string
input string
want []*StyledText
wantErr bool
}{
{"Grey93 & DarkViolet", "\u001B[38;5;255mGrey93\u001B[0m\u001B[38;5;1... | fim | wailsapp/wails | go |
<|fim_suffix|>t will be treated as base64 image data
Image string
// MacTemplateImage indicates that on a Mac, this image is a template image
MacTemplateImage bool
// Text Colour
RGBA string
// Font
FontSize int
FontName string
// Tooltip
Tooltip string
// Callback function when menu clicked
// Click C... | fim | wailsapp/wails | go |
<|fim_prefix|>package menu
// Type of the menu item
type Type string
const (
// TextType is the text menuitem type
TextType Type = "Text"
// SeparatorType is the Separator menuitem type
SeparatorType Type = "Separator"
// SubmenuType is the Submenu menuitem type
SubmenuType Type = "Submenu"
// CheckboxType is ... | fim | wailsapp/wails | go |
<|fim_prefix|>package menu
/*
// DefaultWindowsMenu returns a default m<|fim_suffix|>n NewMenuFromItems(
FileMenu(),
EditMenu(),
WindowMenu(),
)
}
*/
<|fim_middle|>enu including the default
// Application and Edit menus. Use `.Append()` to add to it.
func DefaultWindowsMenu() *Menu {
retur<|endoftext|> | fim | wailsapp/wails | go |
<|fim_suffix|>
func ChainMiddleware(middleware ...Middleware) Middleware {
return func(h http.Handler) http.Handler {
for i := len(middleware) - 1; i >= 0; i-- {
h = middleware[i](h)
}
return h
}
}
<|fim_prefix|>package assetserver
import (
"net/http"
)
// Middleware defines a HTTP middleware that can be ... | fim | wailsapp/wails | go |
<|fim_suffix|>usMethodNotAllowed`
Handler http.Handler
// Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default
// request handler dynamically, e.g. implement specialized Routing etc.
// The Middleware is called to build a new `http.Handler` used by ... | fim | wailsapp/wails | go |
<|fim_prefix|>package options
<|fim_suffix|>artup bool
}
<|fim_middle|>
// Debug options which are taken into account in debug builds.
type Debug struct {
// OpenInspectorOnStartup opens the inspector on startup of the app.
OpenInspectorOnSt<|endoftext|> | fim | wailsapp/wails | go |
<|fim_suffix|> - WebviewGpuPolicyOnDemand
// - WebviewGpuPolicyNever
//
// Due to https://github.com/wailsapp/wails/issues/2977, if options.Linux is nil
// in the call to wails.Run(), WebviewGpuPolicy is set by default to WebviewGpuPolicyNever.
// Client code may override this behavior by passing a non-nil Optio... | fim | wailsapp/wails | go |
<|fim_prefix|>package mac
// AppearanceType <|fim_suffix|>NSAppearanceNameAccessibilityHighContrastAqua - A high-contrast version of the standard light system appearance.
NSAppearanceNameAccessibilityHighContrastAqua AppearanceType = "NSAppearanceNameAccessibilityHighContrastAqua"
// NSAppearanceNameAccessibilityHig... | fim | wailsapp/wails | go |
<|fim_prefix|>package mac
//type ActivationPolicy int
//
//const (
// NSApplicationActivationPolicyRegular ActivationPolicy = 0
// NSApplicationActivationPolicyAccessory ActivationPolicy = 1
// NSApplicationActivationPolicyProhibited ActivationPolicy = 2
//)
type AboutInfo struct {
Title string
Message string... | fim | wailsapp/wails | go |
<|fim_suffix|>o select or otherwise interact with text.
// Set to true by default.
TextInteractionEnabled u.Bool
// A Boolean value that indicates whether a web view can display content full screen.
// Set to false by default
FullscreenEnabled u.Bool
// A string used as the application name portion of the user ag... | fim | wailsapp/wails | go |
<|fim_prefix|>package mac
// TitleBar contains options for the Mac titlebar
type TitleBar struct {
TitlebarAppearsTransparent bool
HideTitle bool
HideTitleBar bool
FullSizeContent bool
UseToolbar bool
HideToolbarSeparator bool
}
// TitleBarDefault ... | fim | wailsapp/wails | go |
<|fim_prefix|>package options
import (
"context"
"html"
"io/fs"
"net/http"
"os"
"path/filepath"
"runtime"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/linux"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"... | fim | wailsapp/wails | go |
<|fim_prefix|>package options
import (
"testing"
)
func TestMergeDefaultsWH(t *testing.T) {
tests := []struct {
name string
appoptions *App
wantWidth int
wantHeight int
}{
{
name: "No width and height",
appoptions: &App{},
wantWidth: 1024,
wantHeight: 768,
},
{
name: "Bas... | fim | wailsapp/wails | go |
<|fim_prefix|>package windows
type Theme int
type Messages struct {
InstallationRequired string
UpdateRequired string
MissingRequirements string
Webview2NotInstalled string
Error string
FailedToInstall string
DownloadPage string
PressOKToInstall string
ContactAdmin ... | fim | wailsapp/wails | go |
<|fim_prefix|>package runtime
im<|fim_suffix|>L uses the system default browser to open the url
func BrowserOpenURL(ctx context.Context, url string) {
appFrontend := getFrontend(ctx)
appFrontend.BrowserOpenURL(url)
}
<|fim_middle|>port (
"context"
)
// BrowserOpenUR<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>package runtime
import "context"
func ClipboardGetText(ctx context.Context) (s<|fim_suffix|>rontend := getFrontend(ctx)
return appFrontend.ClipboardSetText(text)
}
<|fim_middle|>tring, error) {
appFrontend := getFrontend(ctx)
return appFrontend.ClipboardGetText()
}
func ClipboardSetText(ctx context.... | fim | wailsapp/wails | go |
<|fim_suffix|> appFrontend := getFrontend(ctx)
if dialogOptions.DefaultDirectory != "" {
if !fs.DirExists(dialogOptions.DefaultDirectory) {
return "", fmt.Errorf("default directory '%s' does not exist", dialogOptions.DefaultDirectory)
}
}
return appFrontend.SaveFileDialog(dialogOptions)
}
// MessageDialog sh... | fim | wailsapp/wails | go |
<|fim_prefix|>package runtime
import (
"context"
"fmt"
)
// OnFileDrop returns a slice of file path strings when a drop is finished.
func OnFileDrop(ctx context.Context, callback func(x, y int, paths []string)) {
if callback == nil {
LogError(ctx, "OnFileDrop called with a nil callback")
return
}
EventsOn(ct... | fim | wailsapp/wails | go |
<|fim_prefix|>package runtime
import (
"context"
)
// EventsOn registers a listener for the given event name. It returns a func<|fim_suffix|>unc EventsOffAll(ctx context.Context) {
events := getEvents(ctx)
events.OffAll()
}
// EventsOnce registers a listener for the given event name. After the first callback, the... | fim | wailsapp/wails | go |
<|fim_prefix|>package runtime
import (
"context"
"fmt"
"github.com/wailsapp/wails/v2/pkg/logger"
)
// LogPrint prints a Print level message
func LogPrint(ctx context.Context, message string) {
myLogger := getLogger(ctx)
myLogger.Print(message)
}
// LogTrace prints a Trace level message
func LogTrace(ctx contex... | fim | wailsapp/wails | go |
<|fim_prefix|>package runtime
import (
"context"
"github.com/wailsapp/wails/v2/pkg/menu"
)
func MenuSetApplicationMenu(ctx context.Context, menu *menu.Menu) {
frontend := get<|fim_suffix|>cationMenu()
}
<|fim_middle|>Frontend(ctx)
frontend.MenuSetApplicationMenu(menu)
}
func MenuUpdateApplicationMenu(ctx contex... | fim | wailsapp/wails | go |
<|fim_suffix|>onnections).
func CleanupNotifications(ctx context.Context) {
fe := getFrontend(ctx)
fe.CleanupNotifications()
}
// IsNotificationAvailable checks if notifications are available on the current platform.
func IsNotificationAvailable(ctx context.Context) bool {
fe := getFrontend(ctx)
return fe.IsNotifi... | fim | wailsapp/wails | go |
<|fim_suffix|>ion
func Quit(ctx context.Context) {
if ctx == nil {
log.Fatalf("Error calling 'runtime.Quit': %s", contextError)
}
appFrontend := getFrontend(ctx)
appFrontend.Quit()
}
// Hide the application
func Hide(ctx context.Context) {
if ctx == nil {
log.Fatalf("Error calling 'runtime.Hide': %s", context... | fim | wailsapp/wails | go |
<|fim_suffix|>etFrontend(ctx)
return appFrontend.ScreenGetAll()
}
<|fim_prefix|>package runtime
import (
"context"
"github.com/wailsapp/wails/v2/internal/frontend"
)
type Screen = frontend<|fim_middle|>.Screen
// ScreenGetAll returns all screens
func ScreenGetAll(ctx context.Context) ([]Screen, error) {
appFron... | fim | wailsapp/wails | go |
<|fim_suffix|> {
C.fix_all_signals()
}
<|fim_prefix|>//go:build linux
package runtime
/*
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
static void fix_signal(int signum)
{
struct sigaction st;
if (sigaction(signum, NULL, &st) < 0) {
return;
}
st.sa_flags |= S... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build !linux
package runtime
// ResetSignalHan<|fim_suffix|>m.
//
// Note: This function only has an effect on Linux. On other platforms,
// it is a no-op.
func ResetSignalHandlers() {
// No-op on non-Linux platforms
}
<|fim_middle|>dlers resets signal handlers to allow panic recovery.
//
// On Li... | fim | wailsapp/wails | go |
<|fim_suffix|>indow
func WindowHide(ctx context.Context) {
appFrontend := getFrontend(ctx)
appFrontend.WindowHide()
}
// WindowSetSize sets the size of the window
func WindowSetSize(ctx context.Context, width int, height int) {
appFrontend := getFrontend(ctx)
appFrontend.WindowSetSize(width, height)
}
func Window... | fim | wailsapp/wails | go |
<|fim_prefix|>package main
import (
"context"
"fmt"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) start... | fim | wailsapp/wails | go |
<|fim_suffix|>ing): Promise<string>;
<|fim_prefix|>/<|fim_middle|>/ Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Greet(arg1: str<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_suffix|>e is automatically generated. DO NOT EDIT
export function Greet(arg1) {
return window['go']['main']['App']['Greet'](arg1);
}
<|fim_prefix|>// @ts-check
// Cynhyrchwyd<|fim_middle|> y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This fil<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
export interface Position {
x: number;
y: number;
}
export interface Size {
w: number;
h: number;
... | fim | wailsapp/wails | typescript |
<|fim_suffix|>
export function LogWarning(message) {
window.runtime.LogWarning(message);
}
export function LogError(message) {
window.runtime.LogError(message);
}
export function LogFatal(message) {
window.runtime.LogFatal(message);
}
export function EventsOnMultiple(eventName, callback, maxCallbacks) {
... | fim | wailsapp/wails | javascript |
<|fim_suffix|>f0 100%);
color: #333333;
}
.input-box .input {
border: none;
border-radius: 3px;
outline: none;
height: 30px;
line-height: 30px;
padding: 0 10px;
background-color: rgba(240, 240, 240, 1);
-webkit-font-smoothing: antialiased;
}
.input-box .input:hover {
bo... | fim | wailsapp/wails | javascript |
<|fim_prefix|>import {defineCon<|fim_suffix|>itejs.dev/config/
export default defineConfig({})
<|fim_middle|>fig} from 'vite'
// https://v<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>import {css, html, LitElement} from 'lit'
import logo from './assets/images/logo-universal.png'
import {Greet} from "../wailsjs/go/main/App";
import {customElement, property} from 'lit/decorators.js'
/**
* An example element.
*
* @slot - This element has a slot
* @csspart button - The button
*/
@cus... | fim | wailsapp/wails | typescript |
<|fim_suffix|>)
<|fim_prefix|>impor<|fim_middle|>t {defineConfig} from 'vite'
// https://vitejs.dev/config/
export default defineConfig({}<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_prefix|>import './app.css';<|fim_suffix|>box">
<input id="name" className="input" onChange={updateName} autoComplete="off" name="input"
type="text"/>
<button className="btn" onClick={greet}>Greet</button>
</div>
</div>
... | fim | wailsapp/wails | javascript |
<|fim_prefix|>import {render} from 'p<|fim_suffix|>';
render(<App/>, document.getElementById('app'));<|fim_middle|>react';
import {App} from './app';
import './style.css<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>import './app.css'
import logo from "./assets/images/logo-universal.png"
import {Greet} from "../wailsjs/go/main/App";
import {useState} from "preact/hooks";
export function App(props: any) {
const [resultText, setResultText] = useState("Please enter your name below 👇");
const [name, setName] = ... | fim | wailsapp/wails | typescript |
<|fim_prefix|>import {render} from 'prea<|fim_suffix|>ort {App} from './app';
import './style.css';
render(<App/>, document.getElementById('app')!);
<|fim_middle|>ct';
imp<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_prefix|>import {useState} from 'react';
import logo from './assets/images/logo-universal.png';
import './App.css';
import {Greet} from "../wailsjs/go/main/App";
function App() {
const [resultText, setResultTex<|fim_suffix|><div id="App">
<img src={logo} id="logo" alt="logo"/>
<div id=... | fim | wailsapp/wails | javascript |
<|fim_prefix|>import React from 'react'
import {createRoot} from 'react-dom/client'
import './style.css'
import App from './App'
const con<|fim_suffix|>createRoot(container)
root.render(
<React.StrictMode>
<App/>
</React.StrictMode>
)
<|fim_middle|>tainer = document.getElementById('root')
const root ... | fim | wailsapp/wails | javascript |
<|fim_prefix|>import {useState} from 'react';
import logo from './assets/images/logo-universal.png';
import './App.css';
import {Greet} from "../wailsjs/go/main/App";
function App() {
const [resultText, setResultText] = useState("Please enter your name below 👇");
const [name, setName] = useState('');
cons... | fim | wailsapp/wails | typescript |
<|fim_prefix|>import React from 'react'
import {createRoot} from 'react-dom/client'
import './style.css'
import App from './App'
const container = document.getElementBy<|fim_suffix|>ode>
<App/>
</React.StrictMode>
)
<|fim_middle|>Id('root')
const root = createRoot(container!)
root.render(
<React.Stri... | fim | wailsapp/wails | typescript |
<|fim_suffix|>arget: document.getElementById('app')
})
export default app
<|fim_prefix|>import './s<|fim_middle|>tyle.css'
import App from './App.svelte'
const app = new App({
t<|endoftext|> | fim | wailsapp/wails | javascript |
import './style.css'
import App from './App.svelte'
const app = new App({
target: document.getElementById('app')
})
export default app
<|endoftext|> | fim | wailsapp/wails | typescript |
import './style.css';
import './app.css';
import logo from './assets/images/logo-universal.png';
import {Greet} from '../wailsjs/go/main/App';
document.querySelector('#app').innerHTML = `
<img id="logo" class="logo">
<div class="result" id="result">Please enter your name below 👇</div>
<div class="inp... | fim | wailsapp/wails | javascript |
<|fim_suffix|>ntById('logo') as HTMLImageElement).src = logo;
let nameElement = (document.getElementById("name") as HTMLInputElement);
nameElement.focus();
let resultElement = document.getElementById("result");
declare global {
interface Window {
greet: () => void;
}
}
<|fim_prefix|>import './style.cs... | fim | wailsapp/wails | typescript |
<|fim_suffix|>pp).mount('#app')
<|fim_prefix|>import {creat<|fim_middle|>eApp} from 'vue'
import App from './App.vue'
createApp(A<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>import {defineConfig} from 'vite'
import vue from '@vitejs/plu<|fim_suffix|>t default defineConfig({
plugins: [vue()]
})
<|fim_middle|>gin-vue'
// https://vitejs.dev/config/
expor<|endoftext|> | fim | wailsapp/wails | javascript |
import {createApp} from 'vue'
import App from './App.vue'
createApp(App).mount('#app')
<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_suffix|>:= range template.FilesToDelete {
s.DELETE(fileToDelete)
}
for _, dirToDelete := range template.DirsToDelete {
s.RMDIR(dirToDelete)
}
s.REPLACEALL("README.md", s.Sub{"$NAME": template.ShortName})
s.REPLACEALL("template.json", s.Sub{"$NAME": name, "$SHORTNAME": shortName, "$DESCRIPTION": template.... | fim | wailsapp/wails | go |
<|fim_prefix|>package main
import (
"context"
"fmt"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// <|fim_suffix|>
// beforeClose is called when the application is about to quit,
// either by clicking the window close... | fim | wailsapp/wails | go |
<|fim_prefix|>// Get input + focus
let nameElement = document.getElementById("name");
nameElement.focus();
// Setup the greet function
window.greet = function () {
<|fim_suffix|>ode == 13) {
window.greet();
}
};
<|fim_middle|>// Get name
let name = nameElement.value;
// Check if the input is e... | fim | wailsapp/wails | javascript |
<|fim_prefix|>package main
import (
"context"
<|fim_suffix|> application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
// Greet returns a greeting for the g... | fim | wailsapp/wails | go |
<|fim_prefix|>import {css, html, LitElement} from 'lit'
import logo from './assets/images/logo-universal.png'
import {Greet} from "../wailsjs/go/main/App";
import './style.css';
/**
* An example element.
*
* @slot - This element has a slot
* @csspart button - The button
*/
export class MyElement extends LitElemen... | fim | wailsapp/wails | javascript |
<|fim_prefix|>import {defineConfig} from 'vite'
// https<|fim_suffix|>ort default defineConfig({})
<|fim_middle|>://vitejs.dev/config/
exp<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>// Cynhyrchwy<|fim_suffix|>is file is automatically generated. DO NOT EDIT
export function Greet(arg1: string): Promise<string>;
<|fim_middle|>d y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// Th<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_suffix|>
<|fim_prefix|>// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Greet(arg1) {
return window[<|fim_middle|>'go']['main']['App']['Greet'](arg1);
}<|endoftext|> | fim | wailsapp/wails | javascript |
/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
export interface Position {
x: number;
y: number;
}
export interface Size {
w: number;
h: number;
}
export inte... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
export function LogPrint(message) {
window.runtime.LogPrint(message);
}
export function LogTrace(message) {
... | fim | wailsapp/wails | javascript |
<|fim_prefix|>package main
import (
"context"
"fmt"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. Th<|fim_suffix|> the given name
func (a *App) Greet(name string) string {
ret... | fim | wailsapp/wails | go |
<|fim_prefix|>import {css, html, LitElement} from 'lit'
import logo from './assets/images/logo-universal.png'
import {Greet} from "../wailsjs/go/main/App";
import {customElement, property} from 'lit/decorators.js'
import './style.css';
/**
* An example element.
*
* @slot - This element has a slot
* @csspart button... | fim | wailsapp/wails | typescript |
<|fim_prefix|><|fim_suffix|>="vite/client" />
<|fim_middle|>/// <reference types<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_suffix|>//vitejs.dev/config/
export default defineConfig({})
<|fim_prefix|>import {defineConfig} from 'vite'
<|fim_middle|>
// https:<|endoftext|> | fim | wailsapp/wails | typescript |
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Greet(arg1: string): Promise<string>;
<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_prefix|>// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export functi<|fim_suffix|>1);
}
<|fim_middle|>on Greet(arg1) {
return window['go']['main']['App']['Greet'](arg<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
export interface Position {
x: number;
y: number;
}
export interface Size {
w: number;
h: number;
... | fim | wailsapp/wails | typescript |
<|fim_suffix|>ort function Hide() {
window.runtime.Hide();
}
export function Show() {
window.runtime.Show();
}
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present... | fim | wailsapp/wails | javascript |
<|fim_prefix|>package main
import (
"context"
"fmt"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called at application startup
func (a *App) startup(ctx context.Context) {
// Perform your setup here
a.... | fim | wailsapp/wails | go |
<|fim_suffix|>Element.onkeydown = function (e) {
if (e.keyCode == 13) {
window.greet();
}
};
<|fim_prefix|>// Get input + focus
let nameElement = document.getElementById("name");
nameElement.focus();
import './main.css';
// Setup the greet function
window.greet = function () {
// Get na<|fim_middle... | fim | wailsapp/wails | javascript |
<|fim_prefix|>package main
import (
"context"
"fmt"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a n<|fim_suffix|>!", name)
}
<|fim_middle|>ew App application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. The context is saved
// so we can call... | fim | wailsapp/wails | go |
import './app.css';
import logo from "./assets/images/logo-universal.png";
import {Greet} from "../wailsjs/go/main/App";
import {useState} from "preact/hooks";
export function App(props) {
const [resultText, setResultText] = useState("Please enter your name below 👇");
const [name, setName] = useState('');
... | fim | wailsapp/wails | javascript |
<|fim_suffix|>;<|fim_prefix|>import {render} from 'preact';
import {App} from './app';
import './style.css';
render(<App/>, document.getEl<|fim_middle|>ementById('app'))<|endoftext|> | fim | wailsapp/wails | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.