forked from micin-jp/react-native-skyway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
91 lines (75 loc) · 1.84 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
83
84
85
86
87
88
89
90
91
import { Component } from 'react';
declare namespace SkyWay {
export type PeerID = string;
export class PeerOptions {
key?: string;
domain?: string;
host?: string;
port?: number;
secure?: boolean;
turn?: boolean;
credential?: PeerCredential;
}
export class PeerCredential {
ttl?: number;
timestamp?: number;
authToken: string;
}
export class MediaConstraints {
cameraPosition?: CameraPosition;
maxWidth?: number;
minWidth?: number;
maxHeight?: number;
minHeight?: number;
maxFrameRate?: number;
minFrameRate?: number;
}
export enum CameraPosition {
Unspecified = 0,
Back = 1,
Front = 2,
}
export class PeerEvent extends Event {
}
export enum PeerStatus {
Disconnected = 0,
Connected = 1,
}
export enum MediaConnectionStatus {
Disconnected = 0,
Connected = 1,
}
export class Peer extends EventTarget {
constructor(peerId: PeerID, options?: PeerOptions, constraints?: MediaConstraints);
get peerId(): PeerID;
get options(): PeerOptions;
get constraints(): MediaConstraints;
get peerStatus(): PeerStatus;
get mediaConnectionStatus(): MediaConnectionStatus;
dispose(): void;
connect(): void;
disconnect(): void;
listAllPeers(callback: (peers: PeerID[]) => void): void;
call(receiverPeerId: PeerID): void;
answer(): void;
hangup(): void;
switchCamera(): void;
}
interface LocalVideoProps {
peer?: Peer | null;
zOrderMediaOverlay?: boolean;
zOrderOnTop?: boolean;
style?: any;
}
export class LocalVideo extends Component<LocalVideoProps> {
}
interface RemoteVideoProps {
peer?: Peer | null;
zOrderMediaOverlay?: boolean,
zOrderOnTop?: boolean,
style?: any;
}
export class RemoteVideo extends Component<RemoteVideoProps> {
}
}
export = SkyWay;