text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
//go:build windows
// +build windows
package cfd
import (
"github.com/go-ole/go-ole"
"unsafe"
)
var (
saveFileDialogCLSID = ole.NewGUID("{C0B4E2F3-BA21-4773-8DBA-335EC946EB8B}")
saveFileDialogIID = ole.NewGUID("{84bccd23-5fde-4cdb-aea4-af64b83d78ab}")
)
type iFileSaveDialog struct {
vtbl *iFile... | fim | wailsapp/wails | go |
<|fim_suffix|>tr unsafe.Pointer) (string, error) {
var ptr *uint16
ret, _, _ := syscall.SyscallN(vtbl.GetDisplayName,
uintptr(objPtr),
0x80058000, // SIGDN_FILESYSPATH,
uintptr(unsafe.Pointer(&ptr)))
if err := hresultToError(ret); err != nil {
return "", err
}
defer ole.CoTaskMemFree(uintptr(unsafe.Pointer... | fim | wailsapp/wails | go |
<|fim_suffix|> }
defer shellItem.vtbl.release(unsafe.Pointer(shellItem))
return shellItem.vtbl.getDisplayName(unsafe.Pointer(shellItem))
}
<|fim_prefix|>//go:build windows
// +build windows
package cfd
import (
"fmt"
"github.com/go-ole/go-ole"
"syscall"
"unsafe"
)
const (
iidShellItemArrayGUID = "{b63ea76d-1f... | fim | wailsapp/wails | go |
<|fim_suffix|>ClientData uintptr
SetFilter uintptr
}
<|fim_prefix|>//go:build windows
// +build windows
package cfd
type comDlgFilterSpec stru<|fim_middle|>ct {
pszName *int16
pszSpec *int16
}
type iUnknownVtbl struct {
QueryInterface uintptr
AddRef uintptr
Release uintptr
}
type iModalWi... | fim | wailsapp/wails | go |
<|fim_suffix|>setTitle(objPtr unsafe.Pointer, title string) error {
titlePtr := ole.SysAllocString(title)
defer ole.SysFreeString(titlePtr) // Ensure the string is freed
ret, _, _ := syscall.SyscallN(vtbl.SetTitle,
uintptr(objPtr),
uintptr(unsafe.Pointer(titlePtr)))
return hresultToError(ret)
}
func (vtbl *iFi... | fim | wailsapp/wails | go |
<|fim_suffix|>
dialog, err := cfd.NewSaveFileDialog(config)
if err != nil {
return "", err
}
defer dialog.Release()
return dialog.ShowAndGetResult()
}
<|fim_prefix|>package cfdutil
import (
"github.com/wailsapp/wails/v3/internal/go-common-file-dialog/cfd"
)
// TODO doc
func ShowOpenFileDialog(config cfd.Dialo... | fim | wailsapp/wails | go |
<|fim_prefix|>package util
import (
"github.com/go-ole/go-ole"
"github.com/wailsapp/wails/v3/internal/uuid"
)
func StringToUUID(str string) *ole.GUID {
return ole.NewGUID<|fim_suffix|>)
}
<|fim_middle|>(uuid.NewSHA1(uuid.Nil, []byte(str)).String()<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>package util
import (
"github.com/go-ole/go-ole"
"testing"
)
func TestStringToUUID(t *testing.T)<|fim_suffix|>7933985F-2C87-5A5B-A26E-5D0326829AC2")
if generated != expected {
t.Errorf("not equal. expected %s, found %s", expected.String(), generated.String())
}
}
<|fim_middle|> {
generated := *St... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package gos<|fim_suffix|> []string
standardFiles []string
templateFiles []string
ignoredFiles map[string]struct{}
renameFiles map[string]string
}
// New creates a TemplateDir for the given filesystem.
func New(fsys fs.FS) *TemplateDir {
return &TemplateDir{
fs: f... | fim | wailsapp/wails | go |
<|fim_prefix|>package gosod
import (
"io"
"io/fs"
"os"
"path/filepath"
"testing"
"testing/fstest"
"time"
)
// ---- helpers ----
func readFile(t *testing.T, path string) string {
t.Helper()
b, err := os.ReadFile(path)
if err != nil {
t.Fatalf("read %s: %v", path, err)
}
return string(b)
}
// ---- Basic... | fim | wailsapp/wails | go |
<|fim_suffix|>getDir, nil)
if err == nil {
t.Fatal("expected error when target directory cannot be created")
}
}
<|fim_prefix|>//go:build unix
package gosod
import (
"os"
"path/filepath"
"testing"
"testing/fstest"
)
// TestExtract_MkdirAllFails relies on Unix permission semantics (mode 0555
// prevents subdi... | fim | wailsapp/wails | go |
<|fim_suffix|>ev/hash#Hash)
return h.Sum32()
}
<|fim_prefix|>package hash
import "hash/fnv"
func Fnv(s string) uint32 {
h := fn<|fim_middle|>v.New32a()
_, _ = h.Write([]byte(s)) // Hash implementations never return errors (see https://pkg.go.d<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>// Package keychain provides secure credential storage using the system keychain.
// On macOS it uses Keychain, on Windows it uses Credential Manager,
// and on Linux it uses Secret Service (via D-Bus).
package keychain
import (
"fmt"
"os"
"github.com/zalando/go-keyring"
)
const (
// ServiceName is... | fim | wailsapp/wails | go |
<|fim_suffix|>cached Flatpak library paths.
func (c *pathCache) getFlatpak() []string {
c.init()
c.mu.RLock()
defer c.mu.RUnlock()
return c.flatpak
}
// getSnap returns cached Snap library paths.
func (c *pathCache) getSnap() []string {
c.init()
c.mu.RLock()
defer c.mu.RUnlock()
return c.snap
}
// getNix retu... | fim | wailsapp/wails | go |
<|fim_suffix|> }
}
}
// Scan for runtime lib directories
for _, installDir := range installDirs {
runtimeDir := filepath.Join(installDir, "runtime")
if _, err := os.Stat(runtimeDir); err != nil {
continue
}
// Look for lib directories in runtimes
// Structure: runtime/<name>/<arch>/<version>/<hash>... | fim | wailsapp/wails | go |
<|fim_suffix|>
// }
//
// # Multi-Library Search
//
// When you don't know which version of a library is installed, use the
// multi-library search functions:
//
// // Find any available WebKit2GTK version (first found wins)
// match, err := libpath.FindFirstLibrary("webkit2gtk-4.1", "webkit2gtk-4.0", "webkit2gtk-6.0")... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build linux
package libpath
import (
"context"
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
)
// Common library search paths on Linux systems
var defaultLibPaths = []string{
// Standard paths
"/usr/lib",
"/usr/lib64",
"/lib",
"/lib64",
// Debian/Ubuntu multiarch
"/usr/lib/x86_64-l... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build linux
package libpath
import (
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
)
func TestPkgConfigToLibName(t *testing.T) {
tests := []struct {
input string
expected string
}{
{"gtk+-3.0", "libgtk-3"},
{"gtk+-4.0", "libgtk-4"},
{"webkit2gtk-4.1", "libwebkit2gtk-4.1"},... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build !linux
package libpath
// FindLibraryPath is a stub for non-Linux platforms.
func FindLibraryPath(libName string) (string, error) {
return "", &LibraryNotFoundError{Name: libName}
}
// FindLibraryFile is a stub for non-Linux platforms.
func FindLibraryFile(fileName string) (string, error) {... | fim | wailsapp/wails | go |
<|fim_suffix|>ixStoreLib := "/run/current-system/sw/lib"
if _, err := os.Stat(nixStoreLib); err == nil {
paths = append(paths, nixStoreLib)
}
return paths
}
<|fim_prefix|>//go:build linux
package libpath
import "os"
// getNixLibPaths returns cached libr<|fim_middle|>ary paths for Nix/NixOS installations.
func ... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build linux
package libpath
import (
"os"
"path/filepath"
)
// getSnapLibPaths returns cached library paths from installed Snap packages.
func getSnapLibPaths() []string {
return cache.getSnap()
}
// discoverSnapLibPaths scans for Snap package library directories.
// Scans /snap/*/current/usr/... | fim | wailsapp/wails | go |
<|fim_prefix|>package lo
// As<|fim_suffix|>ins reports whether v is present in collection.
func Contains[T comparable](collection []T, v T) bool {
for _, item := range collection {
if item == v {
return true
}
}
return false
}
// ContainsBy reports whether any element of collection satisfies predicate.
fun... | fim | wailsapp/wails | go |
package lo
import (
"errors"
"sort"
"testing"
)
// ----- Associate -----
func TestAssociate_basic(t *testing.T) {
in := []string{"a", "bb", "ccc"}
got := Associate(in, func(s string) (string, int) { return s, len(s) })
want := map[string]int{"a": 1, "bb": 2, "ccc": 3}
if len(got) != len(want) {
t.Fatalf("go... | fim | wailsapp/wails | go |
<|fim_suffix|>tform
func Info() (*OS, error) {
return platformInfo()
}
<|fim_prefix|>package operatingsystem
// OS contains information about the operating system
type OS struct {
ID string `json:"ID"`
Name string `json:"Name"`
Version string `json:"Version"`
Branding string `json:"Branding"`
}
func (... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build android
package operatingsystem
im<|fim_suffix|> "Android",
Version: fmt.Sprintf("Go %s", runtime.Version()),
Branding: "Android",
}, nil
}
<|fim_middle|>port (
"fmt"
"runtime"
)
func platformInfo() (*OS, error) {
return &OS{
ID: "android",
Name: <|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build darwin
package operatingsystem
import (
"os/exec"
"strings"
)
var macOSNames = m<|fim_suffix|>ion = version
ID, err := getSysctlValue("kern.osversion")
if err != nil {
return nil, err
}
result.ID = ID
result.Branding = getOSName(result.Version)
return &result, nil
}
<|fim_middle|>... | fim | wailsapp/wails | go |
<|fim_suffix|>, `"`)
case "VERSION":
result.Branding = strings.Trim(splitLine[1], `"`)
}
}
return &result
}
<|fim_prefix|>//go:build linux && !android
package operatingsystem
import (
"fmt"
"os"
"strings"
)
// platformInfo is the platform specific method to get system information
func platformInfo() (*OS... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build windows
package operatingsystem
import (
"fmt"
"github.com/wailsapp/wails/v3/pkg/w32"
"golang.org/x/sys/windows/registry"
)
func platformInfo() (*OS, error) {
// Default value
var result OS
result.ID = "Unknown"
result.Name = "Window<|fim_suffix|>")
displayVersion, _, _ := key.GetSt... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build windows
package operatingsystem
import (
"strconv"
"golang.org/x/sys/windows/registry"
)
type WindowsVersionInfo struct {
Major int
Minor int
Build int
DisplayVersion string
}
func (w *WindowsVersionInfo) IsWindowsVersionAtLeast(major, minor, buildNumber in... | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build linux && cgo && !gtk3 && !android
package operatingsystem
/*
#cgo linux pkg-config: gtk4 webkitgtk-6.0
#include <webkit/webkit.h>
*/
import "C"
import "fmt"
type WebkitVersion struct {
Major uint
Minor uint
Micro uint
}
func GetWebkitVersion() WebkitVersion {
var major, minor, micro C.u... | fim | wailsapp/wails | go |
//go:build linux && cgo && gtk3 && !android
package operatingsystem
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1
#include <webkit2/webkit2.h>
*/
import "C"
import "fmt"
type WebkitVersion struct {
Major uint
Minor uint
Micro uint
}
func GetWebkitVersion() WebkitVersion {
var major, minor, micro C.uint
maj... | fim | wailsapp/wails | go |
<|fim_suffix|>alue and marks it as unset.
func (v *Var[T]) Unset() {
v.set = false
var zero T
v.val = zero
}
// NewVar creates a new Var with the given value, marked as set.
func NewVar[T any](val T) Var[T] {
return Var[T]{val: val, set: true}
}
<|fim_prefix|>package optional
// True is a Bool set to true.
var Tr... | fim | wailsapp/wails | go |
<|fim_prefix|>package optional
import "testing"
// ----- NewVar -----
func TestNewVar_bool(t *testing.T) {
v := NewVar(true)
if !v.IsSet() {
t.Error("expected IsSet true after NewVar")
}
if !v.Get() {
t.Error("expected Get to return true")
}
}
func TestNewVar_int(t *testing.T) {
v := NewVar(42)
if !v.IsS... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package packager provides a simplified interface for creating Linux packages using nfpm
package packager
import (
"fmt"
"io"
"os"
"github.com/goreleaser/nfpm/v2"
_ "github.com/goreleaser/nfpm/v2/apk" // Register APK packager
_ "github.com/goreleaser/nfpm/v2/arch" // Register Arch Linux package... | fim | wailsapp/wails | go |
<|fim_prefix|>package packager
import (
"bytes"
"os"
"path/filepath"
"testing"
)
func TestCreatePackageFromConfig(t *testing.T) {
// Create a temporary file for testing
content := []byte("test content")
tmpfile, err := os.CreateTemp("", "example")
if err != nil {
t.Fatal(err)
}
defer os.Remove(tmpfile.Nam... | fim | wailsapp/wails | go |
<|fim_prefix|>// Pack<|fim_suffix|>
// Bold returns the SGR for bold text.
func Bold() string { return CSI + AttrBold + "m" }
// Faint returns the SGR for "faint" (dim) text. Most terminals render this as
// reduced contrast against the background.
func Faint() string { return CSI + AttrFaint + "m" }
// IsTerminal re... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package pulse renders a wake build to a terminal as the "Pulse" TUI: a
// pre-painted skeleton of one row per planned step that updates each row
// in place as steps progress, plus a pinned progress strip and throughput
// sparkline beneath. Written without third-party styling libraries.
package pulse
... | fim | wailsapp/wails | go |
<|fim_suffix|> return s.bold(s.fg(Failure, match))
}
return match
})
return line
}
// formatExitCode renders an exit-code line with the number itself bolded
// so the panel's "status exited 1" reads "status exited **1**" — the
// number is what the eye is looking for.
func (s *styler) formatExitCode(code int) s... | fim | wailsapp/wails | go |
<|fim_suffix|> needing per-row colour.
func (s *styler) barchart(value, max float64, width, rank int) string {
if max <= 0 || width <= 0 {
return ""
}
ratio := value / max
if ratio > 1 {
ratio = 1
}
n := int(float64(width)*ratio + 0.5)
if n < 1 && value > 0 {
n = 1
}
if n > width {
n = width
}
fill :... | fim | wailsapp/wails | go |
<|fim_prefix|>package pulse
import (
"fmt"
"io"
"os"
"strings"
"sync"
"time"
"github.com/wailsapp/wails/v3/internal/report"
"github.com/wailsapp/wails/v3/internal/report/pulse/ansi"
)
// Reporter renders a wake build as the "Pulse" TUI.
//
// In Normal verbosity it uses **skeleton mode**: at BuildStart it pr... | fim | wailsapp/wails | go |
<|fim_prefix|>package pulse
import (
"io"
"strings"
"github.com/wailsapp/wails/v3/internal/report/pulse/ansi"
)
// liveRegion is a re-paintable bottom-of-terminal pane that sits *below* the
// scrollback. It is the core mechanism that lets the wake TUI keep a pinned
// "active steps + progress" panel visible whil... | fim | wailsapp/wails | go |
<|fim_prefix|>package pulse
import (
"fmt"
"strings"
"time"
"github.com/wailsapp/wails/v3/internal/report"
"github.com/wailsapp/wails/v3/internal/report/pulse/ansi"
)
// repaintLocked rebuilds the pinned region from current state and atomically
// replaces what's on screen. Caller holds r.mu.
func (r *Reporter)... | fim | wailsapp/wails | go |
<|fim_suffix|>dded with spaces to at least width visible cells,
// counting runes not bytes. SGR escapes are stripped for width measurement.
func padRight(s string, width int) string {
v := visibleWidth(s)
if v >= width {
return s
}
return s + strings.Repeat(" ", width-v)
}
// padLeft returns s padded with space... | fim | wailsapp/wails | go |
<|fim_suffix|>i.Reset) {
t.Errorf("truncate styled past width = %q, want suffix %q", got, "…"+ansi.Reset)
}
// Width=0: empty out.
if got := truncate("anything", 0); got != "" {
t.Errorf("truncate width 0 = %q, want empty", got)
}
}
func TestPad(t *testing.T) {
if got := padRight("hi", 5); got != "hi " {
... | fim | wailsapp/wails | go |
<|fim_suffix|>prefix width explicitly so we can pad the legend line to match.
const (
labelText = "Where time went"
indent = 2
labelW = 15 // visible width of labelText
barGap = 2
prefixW = indent + labelW + barGap
)
barW := cols - prefixW - 2
if barW < 20 {
barW = 20
}
if barW > 60 {
bar... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package report is the build-reporting contract for wake.
//
// It is a leaf package: it has no dependencies on the executor, on lipgloss, or
// on any producer. Three kinds of code use it:
//
// - The executor (and anything orchestrating a build) drives a [Reporter]
// through the build lifecycle... | fim | wailsapp/wails | go |
<|fim_prefix|>package report
import (
"strings"
"testing"
"time"
)
func TestEncodeDecodeRoundtrip(t *testing.T) {
in := Event{Kind: KindStatus, Msg: "generating bindings"}
line := Encode(in)
if !strings.HasPrefix(line, sentinel) {
t.Fatalf("encoded line missing sentinel: %q", line)
}
if strings.Contains(lin... | fim | wailsapp/wails | go |
<|fim_suffix|>P6iDYX1sim7xo4hYFiHAIUY2tX4ZTU7R/FqufXkoKoir5NAkX+lmUnyTfkimQIWMT4iPA9JYC/lW97vlZtpd5qb7M/KKT0AEyONZQ=="<|fim_prefix|>window.hierarchyData = "eJylj8E<|fim_middle|>KwjAQRP9lzrFSibbm6tWD91JKTFcMblNI4qnk36UVi4cqgpdl2WF23gzwfR8DVCVLsZeyFvB0YTLR9i5ADZDlOJ3uCAoH7Qwx6zPTyfedDXS0N4LAzboWarPdCdw9Q8G6S<|endoftext|> | fim | wailsapp/wails | javascript |
(function() {
addIcons();
function addIcons() {
if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
svg.innerHTML = `<symbol class="tsd... | fim | wailsapp/wails | javascript |
<|fim_suffix|>t.fromClause(l),L=this.tokenSet.intersect(E).toArray();if(L.length===0&&l.presence===t.Query.presence.REQUIRED){for(var m=0;m<l.fields.length;m++){var g=l.fields[m];o[g]=t.Set.empty}break}for(var T=0;T<L.length;T++)for(var w=L[T],C=this.invertedIndex[w],O=C._index,m=0;m<l.fields.length;m++){var g=l.fields... | fim | wailsapp/wails | javascript |
<|fim_prefix|>window.navigationData = "eJytmlFv2zYQx7+LntNtTdNsC4YBSZykweI5s9L5oSgKWqITLjQpUJQTb9h3HyiSFiWdjrKzpxa6//3uRPNIHpUv/ySavurkLPmFCU2VIPzX5CgpiH5KzpK1zCtOy++/edu37570midHyTMTeXJ2fJRkT4zniork7MsOtWAily8NJuOkLNsYK2nT3h//9O/RDnJ<|fim_suffix|>uew3to434O7KMBAaxT740V6ExkYHHufLuNS8d7WnHNCrjAdwwvQovzmhNo06wfjyrNG6qNGM... | fim | wailsapp/wails | javascript |
<|fim_suffix|>zPQ8IUgMcVgMMrUEHhgSvAQ6xAZqrALrcAQhuAxxyAzRfASE9jwh+AxyCA8YZDiAoDnA4DpggOYBgOcChOUAzFxDS05hgOsChOkCzF0CXXgDBdoBDd4CmMIAuvwCC8gCH8wBNYwBdggEE7QEO7wHpRHkmwXyAQ32AZjNoxhkI8gMc9gM0o0Fy9EDwH+AQIKA5DZKmB4IBAYcCAc1qAF2EAgQLAg4NApraALoQBQgqBBwuBFKDQXp7RdAh4PAhoDkOoAtSgOBEwCFFIBsv3ASCFgGHFwFNdUBEuxGCGgGHGwFNdwBd2... | fim | wailsapp/wails | javascript |
<|fim_suffix|>string;
model: string;
device: string;
version: string;
sdkInt: number;
}
/** Return information about the Android device. */
export function Info(): Promise<Info> {
return call(DeviceInfo);
}
}
export namespace Toast {
/** Show a short Android ... | fim | wailsapp/wails | typescript |
/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
import { newRuntimeCaller, objectNames } from "./runtime.js";
const call = newRuntimeCaller(objectNames.Application);
const HideMethod = ... | fim | wailsapp/wails | typescript |
<|fim_suffix|>meCaller, objectNames } from "./runtime.js";
const call = newRuntimeCaller(objectNames.Browser);
const BrowserOpenURL = 0;
/**
* Open a browser window to the given URL.
*
* @param url - The URL to open
*/
export function OpenURL(url: string | URL): Promise<void> {
return call(BrowserOpenURL, {u... | fim | wailsapp/wails | typescript |
<|fim_suffix|>{
get: function () {
throw isCallableMarker;
}
});
isCallableMarker = {};
// eslint-disable-next-line no-throw-literal
reflectApply(function () { throw 42; }, null, badArrayLike);
} catch (_) {
if (_ !== isCallableMarker) ... | fim | wailsapp/wails | typescript |
<|fim_suffix|>e bound method returns an error.
* The value of the {@link RuntimeError#name} property is "RuntimeError".
*/
export class RuntimeError extends Error {
/**
* Constructs a new RuntimeError instance.
* @param message - The error message.
* @param options - Options to be forwarded to the ... | fim | wailsapp/wails | typescript |
<|fim_suffix|>ed", "Promise fulfilled unexpectedly");
} catch (err) {
reason = err;
assert(state === "rejected", "Promise rejected unexpectedly");
}
expect(sentinel).toHaveBeenCalled();
expect(oncancelled).not.toHav... | fim | wailsapp/wails | javascript |
<|fim_suffix|> any<T>(values: Iterable<T | PromiseLike<T>>): CancellablePromise<Awaited<T>>;
static any<T extends readonly unknown[] | []>(values: T): CancellablePromise<Awaited<T[number]>>;
static any<T extends Iterable<unknown> | ArrayLike<unknown>>(values: T): CancellablePromise<unknown> {
let collec... | fim | wailsapp/wails | typescript |
<|fim_suffix|>text});
}
/**
* Get the Clipboard text
*
* @returns A promise that resolves with the text from the Clipboard.
*/
export function Text(): Promise<string> {
return call(ClipboardText);
}
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|... | fim | wailsapp/wails | typescript |
/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
import { newRuntimeCaller, objectNames } from "./runtime.js";
import { IsDebug } from "./system.js";
import { eventTarget } from "./utils.... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron<|fim_suffix|>urce);
}
return (source) => {
if (source === null) {
return [];
}
for (let i = 0; i < source.length; i++) {
... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
import {newRuntimeCaller, objectNames} from "./runtime.js";
// setup
window._wails = window._wails || {};
const call = new... | fim | wailsapp/wails | typescript |
<|fim_suffix|> < resizeHandleHeight;
const bottomBorder = event.clientY < bottomContentEdge && (bottomContentEdge - event.clientY) < resizeHandleHeight;
// Adjust for corner areas.
const rightCorner = event.clientX < rightContentEdge && (rightContentEdge - event.clientX) < (resizeHandleWidth + cornerExtra)... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export cons... | fim | wailsapp/wails | typescript |
import { On, Off, OffAll, OnMultiple, WailsEvent, Once } from './events';
import { eventListeners } from "./listener";
import { expect, describe, it, vi, afterEach, beforeEach } from 'vitest';
const dispatchWailsEvent = window._wails.dispatchWailsEvent;
afterEach(() => {
OffAll();
vi.resetAllMocks();
});
describ... | fim | wailsapp/wails | javascript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
import { newRuntimeCaller, objectNames } from "./runtime.js";
import { eventListeners, Listener, listenerOff } from "./liste... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ <|fim_suffix|>rieves the value associated with the specified key from the flag map.
*
* @param key - The key to retrieve the value for.
* @return The value associated with the specified key.
*/
export function GetFlag(key: string): any {
t... | fim | wailsapp/wails | typescript |
<|fim_suffix|>
export {};
<|fim_prefix|>/*
_ __ <|fim_middle|> _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
declare global {
interface Window {
_wails: Record<string, any>;
}
... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
// Setup
window._wails = window._wails || {};
import "./contextmenu.js";
import "./drag.js";
// Re-export public API
impor... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / /<|fim_suffix|> systemVersion: string;
isSimulator: boolean;
}
export function Info(): Promise<Info> {
return call(DeviceInfo);
}
}
<|fim_middle|> (__ )
|__/|__/\__,_/_/_/____/
The electron ... | fim | wailsapp/wails | typescript |
<|fim_suffix|>is.maxCallbacks === 0;
}
}
export function listenerOff(listener: Listener): void {
let listeners = eventListeners.get(listener.eventName);
if (!listeners) {
return;
}
listeners = listeners.filter(l => l !== listener);
if (listeners.length === 0) {
eventListeners.d... | fim | wailsapp/wails | typescript |
<|fim_suffix|>SE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This alpha... | fim | wailsapp/wails | typescript |
<|fim_suffix|>}'. Please verify that the wails tool is up to date and the binding generator runs successfully. If you moved the bindings to a custom location, ensure you supplied the correct root path as the first argument to \`wailsTypedEventsPlugin\``);
return;
}
bindingsId = r... | fim | wailsapp/wails | typescript |
<|fim_prefix|>import * as util from "util";
import * as V from "vitest";
import { CancellablePromise } from "./cancellable";
// The Promises/A+ suite handles some errors late.
process.on('rejectionHandled', function () {});
// The Promises/A+ suite leaves some errors unhandled.
process.on('unhandledRejection', functi... | fim | wailsapp/wails | javascript |
<|fim_suffix|>g/wrapping)
*/
export function getTransport(): RuntimeTransport | null {
return customTransport;
}
/**
* Creates a new runtime caller with specified ID.
*
* @param object - The object to invoke the method on.
* @param windowName - The name of the window.
* @return The new runtime caller functio... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
export interface Size {
<|fim_suffix|> Y: number;
/** Contains the width and height of the screen. */
Size: Size;... | fim | wailsapp/wails | typescript |
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
import { newRuntimeCaller, objectNames } from "./runtime.js";
const call = newRuntimeCaller(objectNames.System);
const Sys... | fim | wailsapp/wails | typescript |
<|fim_suffix|>I emits BACK to the host. */
User: Object.freeze({
/** User clicked Install on an Available update. */
Install: "wails:updater:user:install",
/** User clicked Restart & Apply on a Ready update. */
Restart: "wails:updater:user:restart",
/** User clicked Skip This... | fim | wailsapp/wails | typescript |
<|fim_suffix|>allback);
}
}
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The electron alternative for Go
(c) Lea Anthony 2019-present
*/
/**
* Logs a message to the console with custom formatting.
*
* @param message - The m... | fim | wailsapp/wails | typescript |
<|fim_suffix|>sed or fullscreen.
*/
Restore(): Promise<void> {
return this[callerSym](RestoreMethod);
}
/**
* Sets the absolute position of the window.
*
* @param x - The desired horizontal absolute position of the window.
* @param y - The desired vertical absolute position... | fim | wailsapp/wails | typescript |
<|fim_suffix|>ment
*/
set(element: Element, triggers: string[]): AddEventListenerOptions {
if (!this[triggerMapSym].has(element)) { this[elementCountSym]++; }
this[triggerMapSym].set(element, triggers);
return {};
}
/**
* Removes all registered event listeners.
*/
... | fim | wailsapp/wails | typescript |
<|fim_prefix|>import { defineConfig } from "vi<|fim_suffix|>st/config";
export default defineConfig({
test: {
environment: 'happy-dom',
testTimeout: 200
},
});
<|fim_middle|>te<|endoftext|> | fim | wailsapp/wails | typescript |
<|fim_suffix|>ml";
import { debugLog } from "../@wailsio/runtime/src/utils";
window.wails = Runtime;
EnableWML();
if (DEBUG) {
debugLog("Wails Runtime Loaded")
}
<|fim_prefix|>/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/<|fim_middle|> |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The ele... | fim | wailsapp/wails | javascript |
<|fim_prefix|>package runtime
import (
"fmt"
"encoding/json"
)
var runtimeInit = `window._wails=window._wails||{};window._wails.flags=window._wails.flags||{};window.wails=window.wails||{};`
func Core(flags map[string]any<|fim_suffix|> {
flagsStr := ""
if len(flags) > 0 {
f, err := json.Marshal(flags)
if err... | fim | wailsapp/wails | go |
<|fim_suffix|> console.log('[Wails Android Runtime] _wails.invoke called:', m);
return window.wails.invoke(typeof m==='string'?m:JSON.stringify(m));
};
console.log('[Wails Android Runtime] Runtime injection complete');
`
var flags = ""
<|fim_prefix|>//go:build android
package runtime
// Android uses window.wail... | fim | wailsapp/wails | go |
<|fim_suffix|>ion(msg){window.webkit.messageHandlers.external.postMessage(msg);};"
<|fim_prefix|>//go:build <|fim_middle|>darwin
package runtime
var invoke = "window._wails.invoke=funct<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>//go:build !production
p<|fim_suffix|>ntime.GOARCH)
<|fim_middle|>ackage runtime
import (
"fmt"
"runtime"
)
var environment = fmt.Sprintf(`window._wails.environment={"OS":"%s","Arch":"%s","Debug":true};`, runtime.GOOS, ru<|endoftext|> | fim | wailsapp/wails | go |
<|fim_suffix|> the page's invoke loses the
// receiver. Wrap it like darwin does so callers can invoke without
// thinking about receiver binding.
var invoke = "window._wails.invoke=function(msg){window.webkit.messageHandlers.external.postMessage(msg);};"
<|fim_prefix|>//go:build linux && !android
package runtime
// ... | fim | wailsapp/wails | go |
<|fim_prefix|>//<|fim_suffix|>t "fmt"
import goruntime "runtime"
var environment = fmt.Sprintf(`window._wails.environment={"OS":"%s","Arch":"%s","Debug":false};`, goruntime.GOOS, goruntime.GOARCH)
<|fim_middle|>go:build production
package runtime
impor<|endoftext|> | fim | wailsapp/wails | go |
<|fim_suffix|>.webview.postMessage;`
<|fim_prefix|>//go:build windows
package runtime
var invoke = `window._wails.invoke=window.chr<|fim_middle|>ome<|endoftext|> | fim | wailsapp/wails | go |
<|fim_prefix|>package s
import (
"crypto/md5"
"fmt"
"io"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
"unicode"
)
var (
Output io.Writer = io.Discard
IndentSize int
originalOutput io.Writer
currentIndent int
dryRun bool
deferred []func()
)
func checkError(err error) {... | fim | wailsapp/wails | go |
<|fim_prefix|>// Package semver provides simple semantic version parsing and comparison.
// Implements a subset of the Semantic Versioning 2.0.0 spec sufficient
// for the wails version-check use cases.
package semver
import (
"fmt"
"strconv"
"strings"
)
// Version represents a parsed semantic version.
type Versio... | fim | wailsapp/wails | go |
<|fim_prefix|>package semver
import (
"strings"
"testing"
)
// ---------------------------------------------------------------------------
// NewVersion – par<|fim_suffix|>s {
tc := tc
t.Run(tc.a+"_vs_"+tc.b, func(t *testing.T) {
got := comparePrerelease(tc.a, tc.b)
// normalise to -1/0/1
if got < 0 {
... | fim | wailsapp/wails | go |
<|fim_suffix|>options.Name, options.OutputDir)
tfs, err := fs.Sub(serviceTemplate, "template")
if err != nil {
return err
}
return gosod.New(tfs).Extract(options.OutputDir, options)
}
<|fim_prefix|>package service
import (
"embed"
"fmt"
"io/fs"
"os"
"path/filepath"
"github.com/wailsapp/wails/v3/internal/... | fim | wailsapp/wails | go |
<|fim_prefix|>package setupwizard
import (
"github.com/wailsapp/wails/v3/internal/defaults"
)
// Re-export types for convenience
type GlobalDefaults = defaults.GlobalDefaults
type AuthorDefaults = defaults.AuthorDefaults
type ProjectDefaults = defaults.ProjectDefaults
// DefaultGlobalDefaults returns sensible defau... | fim | wailsapp/wails | go |
<|fim_prefix|>export default {
plugins: {
tailwindcss:<|fim_suffix|>ixer: {},
},
}
<|fim_middle|> {},
autopref<|endoftext|> | fim | wailsapp/wails | javascript |
<|fim_prefix|>import { useState, useEffect, createContext, useContext } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import type { DependencyStatus, SystemInfo, DockerStatus, GlobalDefaults } from './types';
import { checkDependencies, getState, getDockerStatus, buildDockerImage, close, getDef... | fim | wailsapp/wails | typescript |
<|fim_prefix|>import type { WizardState, DependencyStatus, DockerStatus, UserConfig, WailsConfig, GlobalDefaults } from './types';
const API_BASE = '/api';
export async function getState(): Promise<WizardState> {
const response = await fetch(`${API_BASE}/state`);
return response.json();
}
export async function c... | fim | wailsapp/wails | typescript |
<|fim_prefix|>import wailsLogoWhite from '../assets/wails-logo-white-text.svg';
import wailsLogoBlack from '../as<|fim_suffix|>, size = 240, theme = 'dark' }: WailsLogoProps) {
// White text for dark mode, black text for light mode
const logoSrc = theme === 'dark' ? wailsLogoWhite : wailsLogoBlack;
return (
... | fim | wailsapp/wails | typescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.