-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.d.ts
82 lines (80 loc) · 2.13 KB
/
index.d.ts
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export class ExternalObject<T> {
readonly '': {
readonly '': unique symbol
[K: symbol]: T
}
}
export interface ArtData {
data: Buffer
mimetype: string
}
export interface Metadata {
album?: string
albumArtist?: string
albumArtists?: Array<string>
artist: string
artists: Array<string>
artData?: ArtData
id?: string
length: number
title: string
}
export interface Capabilities {
canControl: boolean
canPlayPause: boolean
canGoNext: boolean
canGoPrevious: boolean
canSeek: boolean
}
export interface Position {
howMuch: number
when: Date
}
export interface Status {
metadata?: Metadata
capabilities: Capabilities
status: string
isLoop: string
shuffle: boolean
volume: number
elapsed?: Position
app?: string
}
export function getPlayerManager(): Promise<PlayerManager | null>
export function getFriendlyNameFor(aumid: string): Promise<string | null>
export type JsPlayer = Player
export class Player {
constructor(player: ExternalObject<Player>)
pollNextEvent(): Promise<string>
getStatus(): Promise<Status>
getAumid(): Promise<string>
play(): Promise<boolean>
pause(): Promise<boolean>
playPause(): Promise<boolean>
stop(): Promise<boolean>
getPlaybackStatus(): Promise<string>
next(): Promise<boolean>
previous(): Promise<boolean>
setShuffle(value: boolean): Promise<boolean>
getShuffle(): Promise<boolean>
setRepeat(value: string): Promise<boolean>
getRepeat(): Promise<string>
seek(offsetS: number): Promise<boolean>
seekPercentage(percentage: number): Promise<boolean>
setPosition(positionS: number): Promise<boolean>
getPosition(wantsCurrentPosition: boolean): Promise<Position | null>
}
export type JsPlayerManager = PlayerManager
export class PlayerManager {
constructor(playerManager: ExternalObject<PlayerManager>)
pollNextEvent(): Promise<string>
getActiveSession(): Player | null
getSession(aumid: string): Player | null
getSessionsKeys(): Array<string>
getSystemSession(): Player | null
updateSystemSession(): void
updateSessions(denylist?: Array<string> | undefined | null): void
}