Skip to content

Commit

Permalink
optimize for doc
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Aug 25, 2020
1 parent 4090405 commit 0052e41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/RtcLocalView.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, {Component} from "react";
import {Platform} from "react-native";
import {Platform, ViewProps} from "react-native";

import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps} from "./src/RtcRenderView.native";

/**
* Use SurfaceView in Android.
* Use UIView in iOS.
*/
class SurfaceView extends Component<RtcSurfaceViewProps, {}> {
class SurfaceView extends Component<ViewProps & RtcSurfaceViewProps, {}> {
render() {
return (
<RtcSurfaceView
Expand All @@ -21,7 +21,7 @@ class SurfaceView extends Component<RtcSurfaceViewProps, {}> {
* Use TextureView in Android.
* Not support for iOS.
*/
class TextureView extends Component<RtcTextureViewProps, {}> {
class TextureView extends Component<ViewProps & RtcTextureViewProps, {}> {
render() {
if (Platform.OS === 'ios')
throw new Error('TextureView not support for iOS')
Expand Down
6 changes: 3 additions & 3 deletions src/RtcRemoteView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from "react";
import {Platform} from "react-native";
import {Platform, ViewProps} from "react-native";

import {
RtcSurfaceView,
Expand All @@ -13,7 +13,7 @@ import {
* Use SurfaceView in Android.
* Use UIView in iOS.
*/
class SurfaceView extends Component<RtcSurfaceViewProps & RtcUidProps, {}> {
class SurfaceView extends Component<ViewProps & RtcSurfaceViewProps & RtcUidProps, {}> {
render() {
return (
<RtcSurfaceView {...this.props}/>
Expand All @@ -25,7 +25,7 @@ class SurfaceView extends Component<RtcSurfaceViewProps & RtcUidProps, {}> {
* Use TextureView in Android.
* Not support for iOS.
*/
class TextureView extends Component<RtcTextureViewProps & RtcUidProps, {}> {
class TextureView extends Component<ViewProps & RtcTextureViewProps & RtcUidProps, {}> {
render() {
if (Platform.OS === 'ios')
throw new Error('TextureView not support for iOS')
Expand Down
8 changes: 4 additions & 4 deletions src/src/RtcRenderView.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface RtcUidProps {
* @property mirrorMode: number | The video mirror mode.
* @see VideoMirrorMode
*/
export interface RtcSurfaceViewProps extends ViewProps {
export interface RtcSurfaceViewProps {
zOrderMediaOverlay?: boolean;
zOrderOnTop?: boolean;
renderMode?: VideoRenderMode;
Expand All @@ -54,7 +54,7 @@ export interface RtcSurfaceViewProps extends ViewProps {
* @see RtcChannel.joinChannel
* @property mirror: boolean | The video mirror.
*/
export interface RtcTextureViewProps extends ViewProps {
export interface RtcTextureViewProps {
channelId?: string;
mirror?: boolean;
}
Expand All @@ -67,7 +67,7 @@ const RCTRtcSurfaceView = requireNativeComponent('RCTAgoraRtcSurfaceView');
/**
* @ignore
*/
export class RtcSurfaceView extends Component<RtcSurfaceViewProps & RtcUidProps, {}> {
export class RtcSurfaceView extends Component<ViewProps & RtcSurfaceViewProps & RtcUidProps, {}> {
render() {
const {channelId = null, uid, ...others} = this.props
return (
Expand All @@ -87,7 +87,7 @@ const RCTRtcTextureView = requireNativeComponent('RCTAgoraRtcTextureView');
/**
* @ignore
*/
export class RtcTextureView extends Component<RtcTextureViewProps & RtcUidProps, {}> {
export class RtcTextureView extends Component<ViewProps & RtcTextureViewProps & RtcUidProps, {}> {
render() {
const {channelId = null, uid, ...others} = this.props
return (
Expand Down

0 comments on commit 0052e41

Please sign in to comment.