부록. TypeScript 사용하기
Web 버전의 카카오 i 커넥트 라이브 SDK는 기본적으로 TypeScript로 작성되었으며, TypeScript를 활용한 기능 구현을 지원하고 있습니다. SDK에서 제공하는 TypeScrip 타입은 다음과 같고 import 하여 사용할 수 있습니다.
코드예제SDK Typescript import Syntax
import ConnectLive, {
IRoom,
ILocalMedia,
ILocalScreen,
} from '@connectlive/connectlive-web-sdk';
타입 | 설명 |
---|---|
IRoom | ConnectLive.createRoom()을 통해 반환되는 객체의 타입 |
ILocalMedia | ConnectLive.createLocalMedia()을 통해 반환되는 객체의 타입 |
ILocalScreen | ConnectLive.createLocalScreen()을 통해 반환되는 객체의 타입 |
ILocalAudio | LocalMedia와 LocalScreen 객체의 audio 속성에 해당하는 타입 |
ILocalVideo | LocalMedia와 LocalScreen 객체의 video 속성에 해당하는 타입 |
IRemoteVideo | Remote Participant(리모트 참여자) 객체나 이벤트를 통해 전달되는 RemoteVideo객체의 타입 |
ILocalParticipant | 로컬 참여자 객체의 타입 |
IRemoteParticipant | Remote Participant(리모트 참여자) 객체의 타입 |
에러 타입 | 설명 |
---|---|
IServerError와 IClientError의 부모 타입 | |
IServerError | 서버에서 발생한 에러 코드와 메시지를 담고 있는 에러 타입 |
IClientError | 클라이언트에서 발생한 에러코드와 메시지를 담고 있는 에러 타입 |
타입 | 설명 |
---|---|
IRoomEventConnecting | connecting 이벤트의 파라미터 |
IRoomEventConnected | connected 이벤트의 파라미터 |
IRoomEventDisconnected | disconnected 이벤트의 파라미터 |
IRoomEventParticipantEntered | participantEntered 이벤트의 파라미터 |
IRoomEventParticipantLeft | participantLeft 이벤트의 파라미터 |
IRoomEventLocalAudioPublished | localAudioPublished 이벤트의 파라미터 |
IRoomEventLocalAudioUnpublished | localAudioUnpublished 이벤트의 파라미터 |
IRoomEventLocalVideoPublished | localVideoPublished 이벤트의 파라미터 |
IRoomEventLocalVideoUnpublished | localVideoUnpublished 이벤트의 파라미터 |
IRoomEventRemoteVideoPublished | remoteVideoPublished 이벤트의 파라미터 |
IRoomEventRemoteVideoUnpublished | remoteVideoUnpublished 이벤트의 파라미터 |
IRoomEventRemoteAudioPublished | remoteAudioPublished 이벤트의 파라미터 |
IRoomEventRemoteAudioUnpublished | remoteAudioUnpublished 이벤트의 파라미터 |
IRoomEventRemoteAudioSubscribed | remoteAudioSubscribed 이벤트의 파라미터 |
IRoomEventRemoteAudioUnsubscribed | remoteAudioUnsubscribed 이벤트의 파라미터 |
IRoomEventRemoteAudioStateChanged | remoteAudioStateChanged 이벤트의 파라미터 |
IRoomEventRemoteVideoStateChanged | remoteVideoStateChanged 이벤트의 파라미터 |
IRoomEventRecordFailed | recordFailed 이벤트의 파라미터 |