-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
45 lines (41 loc) · 1.12 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
import { EmitterSubscription } from "react-native";
export declare enum DLNAServiceState {
IDLE = "IDLE",
STARTING = "STARTING",
RUNNING = "RUNNING",
STOPPING = "STOPPING",
}
export declare enum DLNAMediaType {
TYPE_UNKNOWN = "TYPE_UNKNOWN",
TYPE_VIDEO = "TYPE_VIDEO",
TYPE_AUDIO = "TYPE_AUDIO",
TYPE_IMAGE = "TYPE_IMAGE",
}
type StateChangeCallback = (data: { state: DLNAServiceState }) => void;
type MediaInfoCallback = (data: {
url: string;
title: string;
mediaType: DLNAMediaType;
albumArtURI: string;
}) => void;
/**
* 启动服务
*/
export declare function startDLNAService(serverName: string): void;
/**
* 停止服务
*/
export declare function stopDLNAService(): void;
export declare function onDlnaStateChange(
callback: StateChangeCallback
): EmitterSubscription;
export declare function onDlnaMediaInfo(
callback: MediaInfoCallback
): EmitterSubscription;
export declare function getAllApps(params?: {
[key: string]: string;
}): Promise<{
[key: string]: string;
}>;
export declare function startApp(packageName: string): void;
export declare function getDLNAState(): Promise<DLNAServiceState>;