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
316 lines
7.9 KiB
TypeScript
316 lines
7.9 KiB
TypeScript
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
|
// This file is automatically generated. DO NOT EDIT
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-ignore: Unused imports
|
|
import * as time$0 from "../../../time/models.js";
|
|
|
|
/**
|
|
* Album represents an album for the cover grid display.
|
|
*
|
|
* Year is the album's preferred display year — the release-group's
|
|
* original-release-date (MusicBrainz first-release-date) when known,
|
|
* falling back to the file-tag year. ReleaseYear is the file-tag
|
|
* year of the specific release in the library; for a 2010 remaster
|
|
* of a 1973 album, Year=1973 and ReleaseYear=2010.
|
|
*/
|
|
export interface Album {
|
|
"ID": number;
|
|
"Name": string;
|
|
"ArtistName": string;
|
|
"ArtistMBID": string;
|
|
"MBID": string;
|
|
"CoverArtPath": string;
|
|
"CoverArtSmall": string;
|
|
"CoverArtMedium": string;
|
|
"CoverArtLarge": string;
|
|
"Year": number;
|
|
"ReleaseYear": number;
|
|
}
|
|
|
|
/**
|
|
* AlbumCompleteness says how much of an album is present, as the files
|
|
* themselves claim.
|
|
*
|
|
* Known is the part that matters: a tag that never declared a total is
|
|
* not the same as a total that is unmet, and rendering the two alike
|
|
* would put an "incomplete" mark on most of an untagged library. When
|
|
* Known is false, Expected means nothing and the caller must say
|
|
* nothing.
|
|
*/
|
|
export interface AlbumCompleteness {
|
|
"owned": number;
|
|
"expected": number;
|
|
"known": boolean;
|
|
"complete": boolean;
|
|
}
|
|
|
|
/**
|
|
* Artist represents an artist in the library.
|
|
*/
|
|
export interface Artist {
|
|
"ID": number;
|
|
"Name": string;
|
|
"MBID": string;
|
|
"ImageSmall": string;
|
|
"ImageMedium": string;
|
|
"ImageLarge": string;
|
|
}
|
|
|
|
/**
|
|
* GenreWithCount holds a genre name and its associated track count.
|
|
*/
|
|
export interface GenreWithCount {
|
|
"Name": string;
|
|
"TrackCount": number;
|
|
}
|
|
|
|
/**
|
|
* Info contains library metadata enriched with track count
|
|
* for the frontend settings UI.
|
|
*/
|
|
export interface Info {
|
|
"id": number;
|
|
"name": string;
|
|
"path": string;
|
|
"trackCount": number;
|
|
}
|
|
|
|
/**
|
|
* RemovalHooks contains callbacks invoked during library removal.
|
|
* These break circular dependencies between the library, player,
|
|
* and queue packages.
|
|
*/
|
|
export interface RemovalHooks {
|
|
/**
|
|
* StopPlayback stops the currently-playing track.
|
|
*/
|
|
"StopPlayback": any;
|
|
|
|
/**
|
|
* CompactQueue reloads queue state after cascade deletes.
|
|
*/
|
|
"CompactQueue": any;
|
|
|
|
/**
|
|
* PostRemove runs after the removal commits, for cross-cutting
|
|
* invalidation (e.g. clearing library-sync "ready" markers).
|
|
*/
|
|
"PostRemove": any;
|
|
}
|
|
|
|
/**
|
|
* RemovalImpact contains pre-removal counts for the confirmation dialog.
|
|
*/
|
|
export interface RemovalImpact {
|
|
"trackCount": number;
|
|
"playlistsAffected": number;
|
|
"queueItemCount": number;
|
|
}
|
|
|
|
/**
|
|
* RemovalResult reports what one RemoveFromLibrary call did.
|
|
*/
|
|
export interface RemovalResult {
|
|
/**
|
|
* TracksRemoved is how many audio_files rows were deleted. It can
|
|
* be lower than len(filePaths) if a path was already gone.
|
|
*/
|
|
"tracksRemoved": number;
|
|
|
|
/**
|
|
* PathsExcluded is how many paths the scanner will now skip.
|
|
*/
|
|
"pathsExcluded": number;
|
|
}
|
|
|
|
/**
|
|
* RemovalSummary contains post-removal counts for the toast notification.
|
|
*/
|
|
export interface RemovalSummary {
|
|
"tracksDeleted": number;
|
|
"artistsRemoved": number;
|
|
"albumsRemoved": number;
|
|
"genresRemoved": number;
|
|
"playlistsAffected": number;
|
|
"queueItemsRemoved": number;
|
|
}
|
|
|
|
/**
|
|
* RescanHooks holds optional callbacks that run before and after
|
|
* the library-clear-and-scan phase of a full rescan. The app
|
|
* layer sets these to coordinate cross-cutting concerns (e.g.
|
|
* clearing the queue, restoring playlists) without the library
|
|
* needing to know about those packages.
|
|
*/
|
|
export interface RescanHooks {
|
|
/**
|
|
* PreClear runs before library data is wiped
|
|
* (e.g. clear queue and stop playback).
|
|
*/
|
|
"PreClear": any;
|
|
|
|
/**
|
|
* PostScan runs after the scan completes
|
|
* (e.g. restore playlists from M3U8 files).
|
|
*/
|
|
"PostScan": any;
|
|
}
|
|
|
|
/**
|
|
* ScanHooks contains callbacks invoked after a library scan
|
|
* completes. The app layer wires these so the library package
|
|
* does not depend on the playlist package directly.
|
|
*/
|
|
export interface ScanHooks {
|
|
/**
|
|
* RepopulatePlaylists re-imports tracks for playlists that
|
|
* lost their playlist_tracks rows (e.g., from a pre-fix
|
|
* FullRescan). Runs before ResolvePhantoms.
|
|
*/
|
|
"RepopulatePlaylists": any;
|
|
|
|
/**
|
|
* ResolvePhantoms re-links phantom playlist tracks whose
|
|
* files now exist in the library after scanning.
|
|
*/
|
|
"ResolvePhantoms": any;
|
|
|
|
/**
|
|
* OnAllScansComplete runs after ALL queued scans finish
|
|
* (queue drained).
|
|
*/
|
|
"OnAllScansComplete": any;
|
|
}
|
|
|
|
/**
|
|
* ScanMetrics holds timing and count data collected during a library scan.
|
|
* Worker-pool fields are protected by a mutex; DB-writer fields are
|
|
* single-threaded and use plain addition.
|
|
*/
|
|
export interface ScanMetrics {
|
|
/**
|
|
* Top-level phases (wall-clock).
|
|
*/
|
|
"total": time$0.Duration;
|
|
"loadExisting": time$0.Duration;
|
|
"walkDuration": time$0.Duration;
|
|
"extractionWallClock": time$0.Duration;
|
|
"dbWritesWallClock": time$0.Duration;
|
|
"orphanCleanup": time$0.Duration;
|
|
"postScanVariants": time$0.Duration;
|
|
|
|
/**
|
|
* Per-format extraction (cumulative across workers).
|
|
*/
|
|
"formatExtraction": { [_ in string]?: number } | null;
|
|
"formatCount": { [_ in string]?: number } | null;
|
|
|
|
/**
|
|
* Sub-operation cumulative times (across workers).
|
|
*/
|
|
"tagExtraction": time$0.Duration;
|
|
"durationExtraction": time$0.Duration;
|
|
|
|
/**
|
|
* DB sub-operations (cumulative, single-threaded DB writer).
|
|
*/
|
|
"batchCommits": time$0.Duration;
|
|
"coverArtSave": time$0.Duration;
|
|
|
|
/**
|
|
* Thumbnail generation (async worker pool).
|
|
*/
|
|
"thumbnailWallClock": time$0.Duration;
|
|
"thumbnailGeneration": time$0.Duration;
|
|
"thumbnailSmall": time$0.Duration;
|
|
"thumbnailMedium": time$0.Duration;
|
|
"thumbnailLarge": time$0.Duration;
|
|
|
|
/**
|
|
* Full-rescan-specific phases.
|
|
*/
|
|
"clearQueue": time$0.Duration;
|
|
"clearDatabase": time$0.Duration;
|
|
"clearCoverFiles": time$0.Duration;
|
|
|
|
/**
|
|
* File counts.
|
|
*/
|
|
"added": number;
|
|
"updated": number;
|
|
"skipped": number;
|
|
"removed": number;
|
|
|
|
/**
|
|
* Cancelled is true when the scan was stopped via CancelScan.
|
|
*/
|
|
"cancelled": boolean;
|
|
|
|
/**
|
|
* Library identification.
|
|
* library that was scanned
|
|
*/
|
|
"libraryId": number;
|
|
|
|
/**
|
|
* display name of scanned library
|
|
*/
|
|
"libraryName": string;
|
|
|
|
/**
|
|
* Non-fatal issues encountered during scanning.
|
|
*/
|
|
"warnings": ScanWarning[] | null;
|
|
}
|
|
|
|
/**
|
|
* ScanWarning represents a non-fatal issue encountered during scanning.
|
|
*/
|
|
export interface ScanWarning {
|
|
"filePath": string;
|
|
"phase": string;
|
|
"err": string;
|
|
}
|
|
|
|
/**
|
|
* Track represents a playable audio file in the library.
|
|
*/
|
|
export interface Track {
|
|
"TrackName": string;
|
|
"ArtistName": string;
|
|
"TrackLength": string;
|
|
"FilePath": string;
|
|
"TrackNumber": number;
|
|
"DiscNumber": number;
|
|
"Album": string;
|
|
"Genre": string[] | null;
|
|
"Year": number;
|
|
"Composer": string;
|
|
"FileType": string;
|
|
"SampleRate": number;
|
|
"BitDepth": number;
|
|
"Channels": number;
|
|
"Bitrate": number;
|
|
"FileSize": number;
|
|
"PlayCount": number;
|
|
"LastPlayed": string;
|
|
"RecordingMBID": string;
|
|
"ArtistMBID": string;
|
|
"ReleaseGroupMBID": string;
|
|
"CoverArtPath": string;
|
|
"CoverArtSmall": string;
|
|
"CoverArtMedium": string;
|
|
"CoverArtLarge": string;
|
|
}
|
|
|
|
/**
|
|
* TrackMBIDs holds MusicBrainz identifiers for a track, resolved
|
|
* from the recording, release group, and artist tables.
|
|
*/
|
|
export interface TrackMBIDs {
|
|
"recordingMbid": string;
|
|
"releaseGroupMbid": string;
|
|
"artistMbid": string;
|
|
}
|