UNPKG

chzzk

Version:

네이버 라이브 스트리밍 서비스 CHZZK의 비공식 API 라이브러리

164 lines (163 loc) 5.09 kB
import { ChzzkClient } from "../client"; export interface PartialUser { nickname: string; profileImageUrl: string; userIdHash: string; } export interface ChatActivtyCount { chatMessageCount: number; restrict: boolean; restrictCount: number; temporaryRestrict: boolean; temporaryRestrictCount: number; } export interface LiveSettingParams { adult: boolean; categoryType?: string; chatActive: boolean; chatAvailableGroup: string; chatAvailableCondition: string; defaultLiveTitle: string; defaultThumbnailImageUrl?: string; dropsCampaignNo?: string; krOnlyViewing: boolean; liveCategory?: string; paidPromotion: boolean; minFollowerMinute: number; chatDonationRankingExposure: boolean; tags: string[]; clipActive: boolean; replayPublishType: string; } export interface LiveSetting { defaultLiveTitle: string; category: { categoryType?: string; categoryId?: string; categoryValue?: string; posterImageUrl?: string; tags?: string[]; dropsCampaignNos?: string[]; }; defaultThumbnailImageUrl?: string; chatActive: boolean; chatAvailableGroup: string; paidPromotion: boolean; adult: boolean; krOnlyViewing: boolean; chatAvailableCondition: string; minFollowerMinute: number; chatDonationRankingExposure: boolean; tags: string[]; clipActive: boolean; replayPublishType: string; dropsCampaignNo?: string; } export interface ChatRule { channelId: string; rule: string; } export interface ProhibitWord { createdDate: string; nickname: string; prohibitWord: string; prohibitWordNo: number; } export interface Stream { streamKey: string; streamSeq: number; streamUrl: string; } export interface ManageSearchResult { page: number; size: number; totalCount: number; totalPages: number; } export interface SubscriberSearchOptions { page: number; size: number; sortType: "RECENT" | "LONGER"; publishPeriod?: 1 | 3 | 6; tier?: "TIER_1" | "TIER_2"; userNickname?: string; } export interface FollowerSearchOptions { page: number; size: number; userNickname?: string; } export interface ManageVideoSearchOptions { videoType: "REPLAY" | "UPLOAD"; page: number; size: number; } export interface Following { following: boolean; notification: boolean; followDate: string; } export interface Subscribers extends ManageSearchResult { data: Subscriber[]; } export interface Subscriber { user: PartialUser; following?: Following; channelFollowing?: Following; } export interface Followers extends ManageSearchResult { data: Follower[]; } export interface Follower { user: PartialUser; following?: Following; channelFollowing?: Following; } export interface ManageVideos extends ManageSearchResult { data: ManageVideo[]; } export interface ManageVideo { commentCount: number; deleted: boolean; deletedBy: null; download?: { downloadable: boolean; }; duration: number; exposure: boolean; likeCount: number; liveAccumulateCount: number; liveId?: number; liveOpenDate?: string; liveUniqueViewCount: number; publishDate: string; readCount: number; thumbnailImageUrl: string; videoId: string; videoNo: number; videoTitle: string; videoType: "REPLAY" | "UPLOAD"; vodStatus: string; } export declare class ChzzkManage { private client; constructor(client: ChzzkClient); temporaryRestrict(channelId: string, chatChannelId: string, targetId: string): Promise<PartialUser>; restrict(channelId: string, targetId: string): Promise<PartialUser>; removeRestrict(channelId: string, targetId: string): Promise<Response>; chatActivityCount(channelId: string, targetId: string): Promise<ChatActivtyCount>; setRole(channelId: string, targetId: string, userRoleType: "streaming_chat_manager" | "streaming_channel_manager"): Promise<PartialUser>; removeRole(channelId: string, targetId: string): Promise<Response>; setting(channelId: string, params?: LiveSettingParams): Promise<LiveSetting>; chatRule(channelId: string): Promise<ChatRule>; setChatRule(channelId: string, rule: string): Promise<Response>; prohibitWords(channelId: string): Promise<ProhibitWord[]>; addProhibitWord(channelId: string, prohibitWord: string): Promise<Response>; removeProhibitWord(channelId: string, prohibitWordNo: number): Promise<Response>; removeAllProhibitWords(channelId: string): Promise<Response>; editProhibitWord(channelId: string, prohibitWordNo: number, prohibitWord: string): Promise<Response>; stream(channelId: string): Promise<Stream>; subscribers(channelId: string, options?: Partial<SubscriberSearchOptions>): Promise<Subscribers>; followers(channelId: string, options?: Partial<FollowerSearchOptions>): Promise<Followers>; videos(channelId: string, options?: Partial<ManageVideoSearchOptions>): Promise<ManageVideos>; }