agora-rdc-core
Version:
115 lines (114 loc) • 3.34 kB
TypeScript
import { RDCEventCallback, RDCMouseEventType, RDCClipboardContentType } from './interfaces';
export interface RDCAddon {
/**
* initialize engine
* @param appId
* @param logPath
*/
initialize(appId: string, options: string): void;
/**
* listen events from native engine
* @param callback {OnEventCallback}
*/
handleEvent(callback: RDCEventCallback): void;
/**
* Login with userId
* @param userId
*/
login(userId: string, token: string): void;
/**
* Logout
*/
logout(): void;
/**
* Emit keyboard press event
* @param userId controlled user's userId
* @param type mouse event type @typedef MouseEventType
* @param x mouse event x of point
* @param y mouse event y of point
* @param delta can be undefined if it's not captured
*/
mouseEvent(userId: string, type: RDCMouseEventType, x: number, y: number, delta: number): void;
/**
* Emit keyboard press event
* @param userId controlled user's userId
* @param keyCode keyboard event key code
* @param isCompoundCtrl whether or not press `ctrl` at same time?
* @param isCompoundAlt whether or not press `alt` at same time?
* @param isCompoundShift whether or not press `shift` at same time?
*/
keyEvent(userId: string, keyCode: number, isCompoundCtrl: 1 | 0, isCompoundAlt: 1 | 0, isCompoundShift: 1 | 0): void;
/**
* send custom message
* @param userId controlled user's userId
* @param msg
*/
sendCustomMessage(userId: string, msg: string): void;
/**
* request control for specific user.
* @param userId
*/
requestControl(userId: string): void;
/**
* Authorize to take control or not;
* @param userId
* @param authorized
*/
answerRequestControl(userId: string, authorized: boolean): void;
/**
* Quit remote desktop control for specific user
* @param userId controlled user's userId
*/
quitControl(userId: string): void;
/**
* Agree to quit control or not;
* @param userId
* @param answer
*/
answerQuitControl(userId: string, answer: boolean): void;
/**
* update view size
* @param width
* @param height
*/
updateView(width: number, height: number): void;
/**
* Get focus, the focused end is the controlled end which will receive keyboard and mouse events by default.
* @param focus
*/
holdControl(focus: boolean): void;
/**
* Paste file of clipboard to remote end
*/
remotePasteOp(withPath: boolean, filePath: string): void;
/**
* Paste file of clipboard to remote end
*/
remotePasteOp(withPath: boolean): void;
/**
* get clipboard content type
*/
getClipboardType(): RDCClipboardContentType;
/**
* request remote end information
* @param userId
*/
requestRemoteInfo(userId: string): void;
/**
* join channel for broadcasting message
* @param channel
*/
joinChannel(channel: string): void;
/**
* leave channel for disable broadcasting message
* @param channel
*/
leaveChannel(): void;
/**
* release entire engine
*/
release(): void;
}
export declare var RDCAddon: {
new (): RDCAddon;
};