frontend/wailsjs/ is deleted and frontend/bindings/ takes its place — a real TypeScript module tree nested by Go import path, generated by wails3's static analyser rather than by building the app and running it. The @go alias absorbs the constant prefix, so a call site imports '@go/library/library.js' and the codemod over all 93 sites was a specifier rewrite plus splitting @go/models' namespaces into one import per package. The 12 SetContext bindings and the fake `context` model are gone, as Phase 2's ServiceStartup port promised: 272 methods across 12 services, none of them plumbing. @runtime/runtime is now a local shim (src/wails/runtime.ts) over @wailsio/runtime, so the 22 EventsOn imports are untouched. It unwraps v3's WailsEvent into v2's callback shape, which is exact here: nothing in backend/events passes more than one data argument, and v3 only packs arguments into a slice when there is more than one. v3 tells the truth about two things v2 lied about, and that is most of the diff. A Go nil slice really does arrive as JSON null, and a Go named string type really is an enum; v2 typed them as T[] and string. utils/binding.ts states the app's actual contract — an absent list is an empty list — once, at the boundary where it is true, and also drops the CancellablePromise the app never cancels. Four test fixtures widen an enum field back to its value union. Not done, and Phase 5's to fix: frontend/test/support/wails-fake.ts still fakes window.go, which v3 does not have, so `make ui-test` is broken and harness.test.ts fails to compile on EventsEmit. That test also asserts v2 ordering that no longer holds — v3's Events.Emit calls the backend and does not notify in-page listeners at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDCbcCZQepnpSQYJ6SxxZm
237 lines
6.8 KiB
TypeScript
237 lines
6.8 KiB
TypeScript
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
|
// This file is automatically generated. DO NOT EDIT
|
|
|
|
/**
|
|
* Config represents the application configuration.
|
|
* @module
|
|
*/
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import { Call as $Call, CancellablePromise as $CancellablePromise } from "@wailsio/runtime";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import * as download$0 from "../download/models.js";
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import * as tracklist$0 from "../tracklist/models.js";
|
|
|
|
/**
|
|
* GetDefaultPage returns the view the app opens to on launch.
|
|
*/
|
|
export function GetDefaultPage(): $CancellablePromise<string> {
|
|
return $Call.ByID(3209119019);
|
|
}
|
|
|
|
/**
|
|
* GetDownloadPreferences returns the configured auto-download
|
|
* guardrails.
|
|
*/
|
|
export function GetDownloadPreferences(): $CancellablePromise<download$0.AutoDownloadPrefs> {
|
|
return $Call.ByID(4104118319);
|
|
}
|
|
|
|
/**
|
|
* GetFavoritesIconStyle returns the configured icon style.
|
|
*/
|
|
export function GetFavoritesIconStyle(): $CancellablePromise<string> {
|
|
return $Call.ByID(3222927230);
|
|
}
|
|
|
|
/**
|
|
* GetFavoritesPlaylistID returns the configured default playlist ID.
|
|
*/
|
|
export function GetFavoritesPlaylistID(): $CancellablePromise<number> {
|
|
return $Call.ByID(4116868495);
|
|
}
|
|
|
|
/**
|
|
* GetLibraryDirectory returns the currently configured library directory path.
|
|
*/
|
|
export function GetLibraryDirectory(): $CancellablePromise<string> {
|
|
return $Call.ByID(2123565657);
|
|
}
|
|
|
|
/**
|
|
* GetPinDefaultPlaylist returns whether the default playlist
|
|
* is pinned to the top of the playlist view.
|
|
*/
|
|
export function GetPinDefaultPlaylist(): $CancellablePromise<boolean> {
|
|
return $Call.ByID(3818283301);
|
|
}
|
|
|
|
/**
|
|
* GetQueueFallback returns what plays, if anything, once the queue
|
|
* runs out.
|
|
*/
|
|
export function GetQueueFallback(): $CancellablePromise<string> {
|
|
return $Call.ByID(1504773860);
|
|
}
|
|
|
|
/**
|
|
* GetScanConcurrency returns the configured scan concurrency mode.
|
|
*/
|
|
export function GetScanConcurrency(): $CancellablePromise<string> {
|
|
return $Call.ByID(3233312385);
|
|
}
|
|
|
|
/**
|
|
* GetShortcuts returns the current shortcut bindings map.
|
|
*/
|
|
export function GetShortcuts(): $CancellablePromise<{ [_ in string]?: string } | null> {
|
|
return $Call.ByID(1616717634);
|
|
}
|
|
|
|
/**
|
|
* GetThemeAccentColor returns the configured accent colour.
|
|
*/
|
|
export function GetThemeAccentColor(): $CancellablePromise<string> {
|
|
return $Call.ByID(4264374057);
|
|
}
|
|
|
|
/**
|
|
* GetThemeBackgroundShade returns the configured background shade.
|
|
*/
|
|
export function GetThemeBackgroundShade(): $CancellablePromise<string> {
|
|
return $Call.ByID(578772653);
|
|
}
|
|
|
|
/**
|
|
* GetTrackListColumns returns the configured track-list columns.
|
|
*/
|
|
export function GetTrackListColumns(): $CancellablePromise<tracklist$0.Column[] | null> {
|
|
return $Call.ByID(3426289065);
|
|
}
|
|
|
|
/**
|
|
* Load reads and parses the config file from disk.
|
|
*/
|
|
export function Load(): $CancellablePromise<void> {
|
|
return $Call.ByID(2408891113);
|
|
}
|
|
|
|
/**
|
|
* ResetShortcuts resets all shortcuts to defaults.
|
|
*/
|
|
export function ResetShortcuts(): $CancellablePromise<void> {
|
|
return $Call.ByID(3197898083);
|
|
}
|
|
|
|
/**
|
|
* Save writes the config to disk. Refuses to write if the config
|
|
* was never successfully loaded — prevents overwriting user config
|
|
* with defaults during abnormal startup/shutdown sequences.
|
|
*/
|
|
export function Save(): $CancellablePromise<void> {
|
|
return $Call.ByID(1988945736);
|
|
}
|
|
|
|
/**
|
|
* SetDefaultPage validates and saves a new launch page.
|
|
*/
|
|
export function SetDefaultPage(page: string): $CancellablePromise<void> {
|
|
return $Call.ByID(2714957423, page);
|
|
}
|
|
|
|
/**
|
|
* SetDownloadPreferences saves new auto-download guardrails. This only
|
|
* persists them; the download package cannot depend on config (config
|
|
* already depends on download for UserConfig), so making the change
|
|
* live without a restart is the caller's job — the frontend settings
|
|
* save calls this and download.Service.SetPreferences in the same
|
|
* action, and app.go's initDownloadRuntime applies the saved value to
|
|
* the running Manager at startup.
|
|
*/
|
|
export function SetDownloadPreferences(prefs: download$0.AutoDownloadPrefs): $CancellablePromise<void> {
|
|
return $Call.ByID(2655203755, prefs);
|
|
}
|
|
|
|
/**
|
|
* SetFavoritesIconStyle validates and saves a new icon style.
|
|
*/
|
|
export function SetFavoritesIconStyle(style: string): $CancellablePromise<void> {
|
|
return $Call.ByID(812590378, style);
|
|
}
|
|
|
|
/**
|
|
* SetFavoritesPlaylistID saves a new default playlist ID.
|
|
*/
|
|
export function SetFavoritesPlaylistID(id: number): $CancellablePromise<void> {
|
|
return $Call.ByID(2117079163, id);
|
|
}
|
|
|
|
/**
|
|
* SetLibraryDirectory validates and saves a new library directory,
|
|
* then emits the LibraryConfigChanged event so listeners (e.g. the
|
|
* Library scanner) can react.
|
|
*/
|
|
export function SetLibraryDirectory(dir: string): $CancellablePromise<void> {
|
|
return $Call.ByID(1352505021, dir);
|
|
}
|
|
|
|
/**
|
|
* SetPinDefaultPlaylist saves whether the default playlist
|
|
* should be pinned to the top of the playlist view.
|
|
*/
|
|
export function SetPinDefaultPlaylist(pin: boolean): $CancellablePromise<void> {
|
|
return $Call.ByID(372446849, pin);
|
|
}
|
|
|
|
/**
|
|
* SetQueueFallback validates and saves a new queue-fallback mode.
|
|
*/
|
|
export function SetQueueFallback(mode: string): $CancellablePromise<void> {
|
|
return $Call.ByID(2824429312, mode);
|
|
}
|
|
|
|
/**
|
|
* SetScanConcurrency validates and saves a new scan concurrency
|
|
* mode. The change takes effect on the next scan.
|
|
*/
|
|
export function SetScanConcurrency(mode: string): $CancellablePromise<void> {
|
|
return $Call.ByID(742893445, mode);
|
|
}
|
|
|
|
/**
|
|
* SetShortcut saves a single shortcut binding.
|
|
*/
|
|
export function SetShortcut(action: string, key: string): $CancellablePromise<void> {
|
|
return $Call.ByID(275130705, action, key);
|
|
}
|
|
|
|
/**
|
|
* SetShortcuts saves the entire shortcut bindings map.
|
|
*/
|
|
export function SetShortcuts(bindings: { [_ in string]?: string } | null): $CancellablePromise<void> {
|
|
return $Call.ByID(4073898118, bindings);
|
|
}
|
|
|
|
/**
|
|
* SetThemeAccentColor validates and saves a new accent colour.
|
|
*/
|
|
export function SetThemeAccentColor(color: string): $CancellablePromise<void> {
|
|
return $Call.ByID(3536665861, color);
|
|
}
|
|
|
|
/**
|
|
* SetThemeBackgroundShade validates and saves a new background shade.
|
|
*/
|
|
export function SetThemeBackgroundShade(shade: string): $CancellablePromise<void> {
|
|
return $Call.ByID(2709290065, shade);
|
|
}
|
|
|
|
/**
|
|
* SetTrackListColumns validates and saves a new column layout.
|
|
*/
|
|
export function SetTrackListColumns(columns: tracklist$0.Column[] | null): $CancellablePromise<void> {
|
|
return $Call.ByID(4226159685, columns);
|
|
}
|
|
|
|
/**
|
|
* Validate returns errors if there is a breaking issue with the config.
|
|
*/
|
|
export function Validate(): $CancellablePromise<void> {
|
|
return $Call.ByID(3087982155);
|
|
}
|