// Generated using `moon info`, DON'T EDIT IT package "chandra/desktop/lib/gamelib" import { "chandra/desktop/interface/chandra/desktop/theme", "chandra/desktop/interface/chandra/desktop/types", "moonbitlang/core/debug", } // Values pub fn approx_width(String, Int32) -> Int32 pub let background_choices : Array[String] pub let categories : Array[Category] pub fn category_badge(String) -> String pub let colors_choices : Array[String] pub fn count_in(Array[Game], Category) -> Int32 pub fn draw_glyph(Array[@types.DrawOp], String, Int32, Int32, Int32, @types.Color, letter? : String) -> Unit pub fn ellipsize(String, Int32, Int32) -> String pub fn error_message(String) -> String pub fn filter_games(Array[Game], Category, String) -> Array[Game] pub fn grid_fit(Array[Game], Int32, Int32) -> (Array[(Int32, Int32, Int32, Int32, Int32)], Int32, Int32, Int32) pub fn grid_layout(Array[Game], Int32, lv? : Int32, min_w? : Int32) -> (Array[(Int32, Int32, Int32, Int32, Int32)], Int32, Int32) pub fn modes_of(Array[Mode], String) -> Array[Mode] pub fn parse_int(String) -> Int32 pub fn parse_state(String) -> Result[State, String] pub let state : Library pub fn wrap(String, Int32, Int32, Int32) -> Array[String] // Errors // Types and methods #derive(Eq, @debug.Debug) pub(all) enum Action { NoAction Launch(String, String) Stop(String) Focus(String) Refresh } #derive(Eq, @debug.Debug) pub(all) enum Category { All Games Launchers Tools Running } pub fn Category::key(Self) -> String pub fn Category::label(Self) -> String pub fn Category::parse(String) -> Self pub fn Category::title(Self) -> String #derive(Eq, @debug.Debug) pub(all) struct ConfigEntry { key : String label : String choices : Array[String] value : String } #derive(Eq, @debug.Debug) pub(all) struct Game { id : String name : String category : String description : String icon : String install_hint : String featured : Bool installed : Bool running : Bool } pub fn Game::status(Self) -> Status #derive(Eq, @debug.Debug) pub(all) enum Hit { NoHit Cat(Category) Search ClearSearch RefreshButton Card(String) Button(String, String) StopButton(String) FocusButton(String) RunningRow(String) RunningStop(String) } pub(all) struct Library { mut category : Category mut query : String mut scroll : Int32 mut hover : Hit mut press : Hit mut selected : String mut focused : Bool mut colors : String mut background : String regions : Array[(@types.Rect, Hit)] mut shown : Array[(String, Int32, Int32)] mut content_h : Int32 mut view_h : Int32 mut games : Array[Game] } pub fn Library::config_items(Self) -> Array[ConfigEntry] pub fn Library::handle(Self, @types.InputEvent) -> (Bool, Action) pub fn Library::hit(Self, @types.Point) -> Hit pub fn Library::new() -> Self pub fn Library::render(Self, Array[Game], Array[Mode], Rig, @types.Size, @theme.Tokens) -> Array[@types.DrawOp] pub fn Library::scroll_by(Self, Int32) -> Bool pub fn Library::set_config(Self, String, String) -> Bool #derive(Eq, @debug.Debug) pub(all) struct Mode { game : String id : String label : String } pub(all) struct Pal { bg : @types.Color panel : @types.Color card : @types.Color card_hover : @types.Color row_sel : @types.Color border : @types.Color fg : @types.Color muted : @types.Color faint : @types.Color accent : @types.Color accent_fg : @types.Color ok : @types.Color ok_bg : @types.Color badge_bg : @types.Color badge_fg : @types.Color warn : @types.Color dark : Bool } pub fn Pal::dark() -> Self pub fn Pal::light() -> Self #derive(Eq, @debug.Debug) pub(all) struct Rig { connected : Bool error : String gpu : String resolution : String display : String audio : String audio_ok : Bool hostname : String } pub fn Rig::unknown() -> Self #derive(Eq, @debug.Debug) pub(all) struct State { rig : Rig games : Array[Game] modes : Array[Mode] } #derive(Eq, @debug.Debug) pub(all) enum Status { Running Ready NotInstalled } pub fn Status::label(Self) -> String // Type aliases // Traits