@amityco/ts-sdk-react-native
Version:
Amity Social Cloud Typescript SDK
148 lines • 5.16 kB
TypeScript
export {};
declare global {
namespace Amity {
type RoomType = 'directStreaming' | 'coHosts';
type RoomTargetType = 'community' | 'user';
type RoomTargetVisibility = 'public' | 'private';
type RoomReferenceType = 'post' | 'event';
type RoomStatus = 'idle' | 'live' | 'waitingReconnect' | 'ended' | 'recorded' | 'terminated' | 'error';
type RawRoomParticipant = {
type: 'host' | 'coHost';
userId: string;
userInternalId: string;
canManageProductTags: boolean;
};
type RoomModeration = {
flagLabels: Amity.StreamModerationLabel[];
terminateLabels: Amity.StreamModerationLabel[];
updatedAt: Amity.timestamp;
};
type RoomResolution = {
aspectRatio?: string;
width?: number;
height?: number;
};
type RawRoom = {
_id: string;
roomId: string;
type: RoomType;
targetId?: string;
targetType?: RoomTargetType;
targetVisibility?: RoomTargetVisibility;
referenceType?: RoomReferenceType;
referenceId?: string;
liveChannelId?: string;
liveChannelEnabled: boolean;
title: string;
description?: string;
thumbnailFileId?: string;
status: RoomStatus;
participants: RawRoomParticipant[];
livePlaybackUrl?: string;
liveThumbnailUrl?: string;
liveResolution?: RoomResolution;
recordedPlaybackInfos: {
url: string;
thumbnailUrl: string;
}[];
recordedResolution?: RoomResolution;
durationSeconds?: number;
moderationId?: string;
moderation?: RoomModeration;
parentRoomId?: string;
childRoomIds?: string[];
createdAt: string;
createdBy: string;
updatedAt: string;
liveAt?: string;
endedAt?: string;
recordedAt?: string;
isDeleted: boolean;
deletedAt: string;
deletedBy: string;
creatorInternalId: string;
path: string;
metadata?: Record<string, unknown>;
};
type InternalRoom = RawRoom;
type RoomParticipant = RawRoomParticipant & {
user?: Amity.User;
};
type RoomLinkedObject = {
participants: RoomParticipant[];
post?: Amity.InternalPost;
childRooms: Amity.Room[];
getLiveChat: () => Promise<Amity.Channel<'live'> | undefined>;
createInvitation: (userId: string) => Promise<Amity.Cached<Amity.InternalInvitation[]>>;
getInvitations: () => Promise<Amity.Invitation | undefined>;
analytics: () => Amity.RoomAnalytics;
};
type Room = Omit<InternalRoom, 'participants'> & RoomLinkedObject;
type RoomLiveCollection = {
type?: RoomType;
statuses?: RoomStatus[];
sortBy?: 'firstCreated' | 'lastCreated';
limit?: number;
includeDeleted?: boolean;
};
type RoomLiveCollectionCache = {
data: string[];
params: Record<string, any>;
};
type BroadcasterData = {
coHostToken?: string;
coHostUrl?: string;
directStreamUrl?: string;
};
type RoomWatchingCount = {
count: number;
referenceTimestamp?: Amity.Timestamps;
};
type RawRoomViewer = {
userId: string;
joinedAt: Amity.Timestamps;
};
type RoomWatchingUser = RawRoomViewer & {
user?: Amity.User;
};
type ParticipantEventActor = {
eventActor: {
userInternalId: string;
};
};
type CoHostEvent = {
room: Amity.Room;
invitation?: Amity.Invitation;
actorInternalId?: string;
};
enum WatchSessionSyncStateEnum {
PENDING = "PENDING",
SYNCING = "SYNCING",
SYNCED = "SYNCED"
}
type WatchSessionSyncState = `${WatchSessionSyncStateEnum}`;
type WatchSessionEntity = {
sessionId: string;
roomId: string;
watchSeconds: number;
startTime: Date;
endTime?: Date | null;
syncState: WatchSessionSyncState;
syncedAt?: Date | null;
retryCount: number;
};
type WatchSessionData = {
sessionId: string;
roomId: string;
watchSeconds: number;
startTime: string;
endTime?: string;
};
interface RoomAnalytics {
createWatchSession(startedAt: Date): Promise<string>;
updateWatchSession(sessionId: string, duration: number, endedAt: Date): Promise<void>;
syncPendingWatchSessions(): void;
}
}
}
//# sourceMappingURL=room.d.ts.map