Rewrite the launcher in MoonBit (old code moves to legacy/) (#1)
This commit was merged in pull request #1.
This commit is contained in:
1 parent
7d2bf5996f
commit
2fa7bd745b
150 files changed
+8319
-462
No files matched your search
@@ -0,0 +1,57 @@
|
||||
// Generated using `moon info`, DON'T EDIT IT
|
||||
package "experiments/launcher/gesture"
|
||||
|
||||
import {
|
||||
"moonbitlang/core/debug",
|
||||
}
|
||||
|
||||
// Values
|
||||
pub fn classify_swipe(Double, Double, Int32) -> Swipe?
|
||||
|
||||
pub let hold_ms : Int32
|
||||
|
||||
pub let slop : Double
|
||||
|
||||
// Errors
|
||||
|
||||
// Types and methods
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub(all) enum Input {
|
||||
Down(x~ : Double, y~ : Double, chain~ : Array[Int32])
|
||||
Move(x~ : Double, y~ : Double)
|
||||
Up(x~ : Double, y~ : Double)
|
||||
Cancel
|
||||
Hold(Int32)
|
||||
}
|
||||
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub(all) enum Out {
|
||||
Schedule(Int32, Int32)
|
||||
Began(chain~ : Array[Int32], x~ : Double, y~ : Double)
|
||||
Tap(chain~ : Array[Int32])
|
||||
Press(chain~ : Array[Int32])
|
||||
Drag(x~ : Double, y~ : Double, x0~ : Double, y0~ : Double)
|
||||
Release(moved~ : Bool, held~ : Bool)
|
||||
}
|
||||
|
||||
pub(all) struct State {
|
||||
mut down : Bool
|
||||
mut x0 : Double
|
||||
mut y0 : Double
|
||||
mut moved : Bool
|
||||
mut held : Bool
|
||||
mut chain : Array[Int32]
|
||||
mut token : Int32
|
||||
}
|
||||
pub fn State::new() -> Self
|
||||
pub fn State::step(Self, Input) -> Array[Out]
|
||||
|
||||
#derive(Eq, @debug.Debug)
|
||||
pub(all) enum Swipe {
|
||||
Down
|
||||
Up
|
||||
}
|
||||
|
||||
// Type aliases
|
||||
|
||||
// Traits
|
||||
Reference in new issue
Block a user