Ariver
2026-07-12 24f551a39eae849d891da26cc91f90d354e3a2db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package axinput
 
type DirectInsertResult struct {
    OK              bool   `json:"ok"`
    Inserted        bool   `json:"inserted"`
    NeedsPermission bool   `json:"needsPermission"`
    Method          string `json:"method"`
    Message         string `json:"message"`
    Target          string `json:"target,omitempty"`
}
 
type ClipboardResult struct {
    OK       bool   `json:"ok"`
    Prepared bool   `json:"prepared"`
    Restored bool   `json:"restored"`
    Token    string `json:"token,omitempty"`
    Message  string `json:"message"`
}
 
type FrontmostAppIdentity struct {
    OK       bool   `json:"ok"`
    Identity string `json:"identity,omitempty"`
    Message  string `json:"message"`
}
 
type AutoPasteResult struct {
    OK                 bool   `json:"ok"`
    Pasted             bool   `json:"pasted"`
    FrontmostUnchanged bool   `json:"frontmostUnchanged"`
    Message            string `json:"message"`
}
 
type Driver interface {
    AccessibilityTrusted(prompt bool) bool
    DirectInsert(text string) DirectInsertResult
    CopyTextToClipboard(text string) ClipboardResult
    FrontmostAppIdentity() FrontmostAppIdentity
    AutoPasteClipboardIfFrontmostUnchanged(expectedIdentity string) AutoPasteResult
    PrepareClipboardFallback(text string) ClipboardResult
    RestoreClipboardFallback(token string) ClipboardResult
}
 
func NewDriver() Driver {
    return newPlatformDriver()
}