Skip to content

Commit

Permalink
optimize ts interface
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Sep 27, 2020
1 parent 37d3692 commit a6dacbe
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 8 deletions.
31 changes: 28 additions & 3 deletions src/src/RtcChannel.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ const channels = new Map<string, RtcChannel>()
/**
* The {@link RtcChannel} class.
*/
export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, RtcVoicePositionInterface,
RtcPublishStreamInterface, RtcMediaRelayInterface, RtcDualStreamInterface, RtcFallbackInterface,
RtcMediaMetadataInterface, RtcEncryptionInterface, RtcInjectStreamInterface, RtcStreamMessageInterface {
export default class RtcChannel implements RtcChannelInterface {
/**
* @ignore
*/
Expand Down Expand Up @@ -750,6 +748,33 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface,
}
}

/**
* @ignore
*/
interface RtcChannelInterface extends RtcAudioInterface, RtcVideoInterface, RtcVoicePositionInterface,
RtcPublishStreamInterface, RtcMediaRelayInterface, RtcDualStreamInterface, RtcFallbackInterface,
RtcMediaMetadataInterface, RtcEncryptionInterface, RtcInjectStreamInterface, RtcStreamMessageInterface {
destroy(): Promise<void>

setClientRole(role: ClientRole): Promise<void>

joinChannel(token: string | null, optionalInfo: string | null, optionalUid: number, options: ChannelMediaOptions): Promise<void>

joinChannelWithUserAccount(token: string | null, userAccount: string, options: ChannelMediaOptions): Promise<void>

leaveChannel(): Promise<void>

renewToken(token: string): Promise<void>

getConnectionState(): Promise<ConnectionStateType>

publish(): Promise<void>

unpublish(): Promise<void>

getCallId(): Promise<string>
}

/**
* @ignore
*/
Expand Down
47 changes: 42 additions & 5 deletions src/src/RtcEngine.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ let engine: RtcEngine | undefined
/**
* [`RtcEngine`]{@link RtcEngine} is the main class of the Agora SDK.
*/
export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterface, RtcVideoInterface, RtcAudioMixingInterface,
RtcAudioEffectInterface, RtcVoiceChangerInterface, RtcVoicePositionInterface, RtcPublishStreamInterface,
RtcMediaRelayInterface, RtcAudioRouteInterface, RtcEarMonitoringInterface, RtcDualStreamInterface,
RtcFallbackInterface, RtcTestInterface, RtcMediaMetadataInterface, RtcWatermarkInterface, RtcEncryptionInterface,
RtcAudioRecorderInterface, RtcInjectStreamInterface, RtcCameraInterface, RtcStreamMessageInterface {
export default class RtcEngine implements RtcEngineInterface {
/**
* @ignore
*/
Expand Down Expand Up @@ -2275,6 +2271,47 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac
}
}

/**
* @ignore
*/
interface RtcEngineInterface extends RtcUserInfoInterface, RtcAudioInterface, RtcVideoInterface, RtcAudioMixingInterface,
RtcAudioEffectInterface, RtcVoiceChangerInterface, RtcVoicePositionInterface, RtcPublishStreamInterface,
RtcMediaRelayInterface, RtcAudioRouteInterface, RtcEarMonitoringInterface, RtcDualStreamInterface,
RtcFallbackInterface, RtcTestInterface, RtcMediaMetadataInterface, RtcWatermarkInterface, RtcEncryptionInterface,
RtcAudioRecorderInterface, RtcInjectStreamInterface, RtcCameraInterface, RtcStreamMessageInterface {
destroy(): Promise<void>

setChannelProfile(profile: ChannelProfile): Promise<void>

setClientRole(role: ClientRole): Promise<void>

joinChannel(token: string | null, channelName: string, optionalInfo: string | null, optionalUid: number): Promise<void>

switchChannel(token: string | null, channelName: string): Promise<void>

leaveChannel(): Promise<void>

renewToken(token: string): Promise<void>

enableWebSdkInteroperability(enabled: boolean): Promise<void>

getConnectionState(): Promise<ConnectionStateType>

getCallId(): Promise<string>

rate(callId: string, rating: Rate, description?: string): Promise<void>

complain(callId: string, description: string): Promise<void>

setLogFile(filePath: string): Promise<void>

setLogFilter(filter: LogFilter): Promise<void>

setLogFileSize(fileSizeInKBytes: number): Promise<void>

setParameters(parameters: string): Promise<void>
}

/**
* @ignore
*/
Expand Down

0 comments on commit a6dacbe

Please sign in to comment.