11/* auto-generated by NAPI-RS */
22/* eslint-disable */
33/** 关闭 Discord RPC */
4- export declare function disableDiscordRpc ( ) : void
4+ export declare function disableDiscordRpc ( ) : void ;
55
66/**
77 * 禁用媒体控件
@@ -10,7 +10,7 @@ export declare function disableDiscordRpc(): void
1010 *
1111 * 会在调用 API 失败时抛出错误
1212 */
13- export declare function disableSystemMedia ( ) : void
13+ export declare function disableSystemMedia ( ) : void ;
1414
1515/** Discord 配置参数 */
1616export interface DiscordConfigPayload {
@@ -19,22 +19,23 @@ export interface DiscordConfigPayload {
1919 *
2020 * 注意暂停时进度会固定为 0
2121 */
22- showWhenPaused : boolean
22+ showWhenPaused : boolean ;
2323 /** 显示模式,参考 [`DiscordDisplayMode`] */
24- displayMode ?: DiscordDisplayMode
24+ displayMode ?: DiscordDisplayMode ;
2525}
2626
2727/**
2828 * Discord 显示模式枚举
2929 *
3030 * 不打开详细信息面板时,在用户名下方显示的小字
3131 */
32- export type DiscordDisplayMode = /** Listening to SPlayer */
33- 'Name' |
34- /** Listening to Rick Astley */
35- 'State' |
36- /** Listening to Never Gonna Give You Up */
37- 'Details' ;
32+ export type DiscordDisplayMode =
33+ /** Listening to SPlayer */
34+ | "Name"
35+ /** Listening to Rick Astley */
36+ | "State"
37+ /** Listening to Never Gonna Give You Up */
38+ | "Details" ;
3839
3940/**
4041 * 启用 Discord RPC
@@ -43,7 +44,7 @@ export type DiscordDisplayMode = /** Listening to SPlayer */
4344 *
4445 * 启用后会立刻尝试连接,如果 Discord 未启动,或因为其他未知原因连接失败,会每 5 秒尝试连接一次
4546 */
46- export declare function enableDiscordRpc ( ) : void
47+ export declare function enableDiscordRpc ( ) : void ;
4748
4849/**
4950 * 启用媒体控件
@@ -52,7 +53,7 @@ export declare function enableDiscordRpc(): void
5253 *
5354 * 会在调用 API 失败时抛出错误
5455 */
55- export declare function enableSystemMedia ( ) : void
56+ export declare function enableSystemMedia ( ) : void ;
5657
5758/**
5859 * 初始化插件
@@ -69,20 +70,20 @@ export declare function enableSystemMedia(): void
6970 *
7071 * 如果其他 API 调用失败,则只会打印日志并静默失败
7172 */
72- export declare function initialize ( logDir : string ) : void
73+ export declare function initialize ( logDir : string ) : void ;
7374
7475export interface MetadataParam {
75- songName : string
76- authorName : string
77- albumName : string
76+ songName : string ;
77+ authorName : string ;
78+ albumName : string ;
7879 /** 封面的原始字节数据,适用于除 Discord RPC 之外的其他平台 */
79- coverData ?: Buffer
80+ coverData ?: Buffer ;
8081 /**
8182 * 封面的 HTTP URL,更新 Discord RPC 时必传,其他平台可不传
8283 *
8384 * Linux 平台在没有提供 `cover_data` 时会使用它
8485 */
85- originalCoverUrl ?: string
86+ originalCoverUrl ?: string ;
8687 /**
8788 * 网易云音乐中对应的曲目 ID
8889 *
@@ -91,26 +92,25 @@ export interface MetadataParam {
9192 * - 生成 Discord RPC 的按钮链接
9293 * - MacOS 和 Linux 会使用此值来填充唯一的曲目 ID
9394 */
94- ncmId ?: number
95+ ncmId ?: number ;
9596 /**
9697 * 当前歌曲时长,单位是毫秒
9798 *
9899 * 用于 Linux、MacOS、Discord RPC 的元数据更新。Windows 使用 [`TimelinePayload`] 的
99100 * `total_time` 字段。
100101 */
101- duration ?: number
102+ duration ?: number ;
102103}
103104
104- export type PlaybackStatus = 'Playing' |
105- 'Paused' ;
105+ export type PlaybackStatus = "Playing" | "Paused" ;
106106
107107export interface PlayModePayload {
108- isShuffling : boolean
109- repeatMode : RepeatMode
108+ isShuffling : boolean ;
109+ repeatMode : RepeatMode ;
110110}
111111
112112export interface PlayStatePayload {
113- status : PlaybackStatus
113+ status : PlaybackStatus ;
114114}
115115
116116/**
@@ -124,35 +124,34 @@ export interface PlayStatePayload {
124124 *
125125 * 如果 N-API 创建线程安全函数失败,会抛出错误。通常不应该发生,除非 JS 环境已经销毁了
126126 */
127- export declare function registerEventHandler ( callback : ( arg : SystemMediaEvent ) => void ) : void
127+ export declare function registerEventHandler ( callback : ( arg : SystemMediaEvent ) => void ) : void ;
128128
129- export type RepeatMode = 'None' |
130- 'Track' |
131- 'List' ;
129+ export type RepeatMode = "None" | "Track" | "List" ;
132130
133131/** 关闭插件,清理资源 */
134- export declare function shutdown ( ) : void
132+ export declare function shutdown ( ) : void ;
135133
136134export interface SystemMediaEvent {
137- type : SystemMediaEventType
138- positionMs ?: number
135+ type : SystemMediaEventType ;
136+ positionMs ?: number ;
139137}
140138
141- export type SystemMediaEventType = 'Play' |
142- 'Pause' |
143- 'Stop' |
144- 'NextSong' |
145- 'PreviousSong' |
146- 'ToggleShuffle' |
147- 'ToggleRepeat' |
148- /** 绝对位置,毫秒 */
149- 'Seek' ;
139+ export type SystemMediaEventType =
140+ | "Play"
141+ | "Pause"
142+ | "Stop"
143+ | "NextSong"
144+ | "PreviousSong"
145+ | "ToggleShuffle"
146+ | "ToggleRepeat"
147+ /** 绝对位置,毫秒 */
148+ | "Seek" ;
150149
151150export interface TimelinePayload {
152151 /** 单位是毫秒 */
153- currentTime : number
152+ currentTime : number ;
154153 /** 单位是毫秒 */
155- totalTime : number
154+ totalTime : number ;
156155}
157156
158157/**
@@ -163,7 +162,7 @@ export interface TimelinePayload {
163162 * * `payload` - 配置信息,可以配置是否在暂停后也显示 Discord Activity 和 状态显示风格。详情请查看
164163 * [`DiscordConfigPayload`]
165164 */
166- export declare function updateDiscordConfig ( payload : DiscordConfigPayload ) : void
165+ export declare function updateDiscordConfig ( payload : DiscordConfigPayload ) : void ;
167166
168167/**
169168 * 更新歌曲元数据
@@ -174,7 +173,7 @@ export declare function updateDiscordConfig(payload: DiscordConfigPayload): void
174173 *
175174 * 更新 Discord RPC 的元数据时,必须提供 `original_cover_url`
176175 */
177- export declare function updateMetadata ( payload : MetadataParam ) : void
176+ export declare function updateMetadata ( payload : MetadataParam ) : void ;
178177
179178/**
180179 * 更新播放模式
@@ -183,14 +182,14 @@ export declare function updateMetadata(payload: MetadataParam): void
183182 *
184183 * 只会更新媒体控件的信息,不会更新 Discord RPC 上的信息
185184 */
186- export declare function updatePlayMode ( payload : PlayModePayload ) : void
185+ export declare function updatePlayMode ( payload : PlayModePayload ) : void ;
187186
188187/**
189188 * 更新播放状态 (播放/暂停)
190189 *
191190 * 同时也会更新 Discord 的播放状态 (如果启用了 Discord RPC)
192191 */
193- export declare function updatePlayState ( payload : PlayStatePayload ) : void
192+ export declare function updatePlayState ( payload : PlayStatePayload ) : void ;
194193
195194/**
196195 * 更新进度信息
@@ -201,4 +200,4 @@ export declare function updatePlayState(payload: PlayStatePayload): void
201200 *
202201 * Discord RPC 实现的进度更新有节流,调用此函数无需担心 Discord RPC 的速率限制
203202 */
204- export declare function updateTimeline ( payload : TimelinePayload ) : void
203+ export declare function updateTimeline ( payload : TimelinePayload ) : void ;
0 commit comments