import { AxiosResponse } from 'axios'; import { Method } from 'axios'; import { Moment } from 'moment'; import { default as moment_2 } from 'moment'; export declare class AdItem { /** @ignore */ private _raw; /** @ignore */ constructor( /** @ignore */ _raw: IServerFetchAdResponseInnerItem); get title(): string; get url(): string; get image(): Base64Image; } export declare class AdList extends ResponseObject implements Iterable { /** @ignore */ private _endpoint; /** @ignore */ private _list; /** @ignore */ constructor( /** @ignore */ _endpoint: SystemEndpoint, raw: ServerFetchAdResponse); get items(): readonly AdItem[]; [Symbol.iterator](): IterableIterator; } export declare class Base64Image { /** @ignore */ private _b64; /** @ignore */ constructor( /** @ignore */ _b64: string); toDataUrl(): string; toBinary(): Uint8Array; toBase64(): string; } export declare enum CodecType { /** Unknown */ NONE = 0, /** H.264 */ AVC = 1, /** H.265 */ HEVC = 2, /** Audio */ MP4A = 3, /** Dolby */ DOLBY = 4 } export declare function create(restful: string): Promise; export declare type CreateTaskOptionsRaw = ICreateTaskOptionsRawAuto | ICreateTaskOptionsRawCustom; export declare class DanmakuEndpoint { /** @ignore */ private _endpoint; /** @ignore */ constructor( /** @ignore */ _endpoint: Endpoint); } export declare class Directory extends ResponseObject { get path(): string | undefined; } export declare class Endpoint { readonly endpoint: string; /** @ignore */ constructor(endpoint: string); /** @ignore */ createRequest(method: Method, path?: string, data?: any): Promise; greet(): Promise; user(): UserEndpoint; video(): VideoEndpoint; system(): SystemEndpoint; danmaku(): DanmakuEndpoint; task(): TaskEndpoint; } export declare class FavoriteList extends ResponseObject { /** @ignore */ private _video; /** @ignore */ private _linkid; /** @ignore */ constructor( /** @ignore */ _video: Video, /** @ignore */ _linkid: LinkId); get id(): LinkId; get owner(): User | undefined; get name(): string | undefined; get createDate(): Moment | undefined; getQualityByIndex(index?: number, useBv?: boolean): Promise; getQuality(useBv?: boolean): AsyncIterable; get asVideo(): Video; get items(): readonly VideoPage[]; [Symbol.iterator](): IterableIterator; } export declare interface ICreateTaskOptionsRawAuto { avid: number; cid: number; quality: 1000; useav: boolean; useflv: boolean; videocodecs: CodecType; videofilename: string; } export declare interface ICreateTaskOptionsRawCustom { avid: number; cid: number; quality: number; audio_quality: number; useav: boolean; useflv: boolean; videocodecs: CodecType; videofilename: string; } export declare interface IServerCreateTaskResponseInner { code: number; control_name: string; } export declare interface IServerDirResponseInner { dir: string; } export declare interface IServerFetchAdResponseInner extends ReadonlyArray { } export declare interface IServerFetchAdResponseInnerItem { title: string; url: string; /** Base64 */ img: string; } export declare interface IServerFetchUpdateStatusResponseInner { status: UpdateStatusType; changelog: string; } export declare interface IServerHello { hello: string; } export declare interface IServerResponseError { code: number; message: string; data: null; } export declare interface IServerResponseSuccess { code: number; message: string; data: T; } export declare interface IServerTaskStatusResponseInner { task_control_name: string; status_text: string; task_status: TaskStatusType; progress: number; use_time: number; average_speed: string; msg: string; } export declare interface IServerUserInfoInnerResponseInner { is_login: boolean; mid: number; uname: string; face: string; vip_status: boolean; vip_label_text?: string; vip_label_theme?: string; } export declare interface IServerUserLoginResponseInner { login_successful: boolean; /** Base64 */ image?: string; mode?: string; } export declare interface IServerVideoInfoResponseInner { id: number; link_type: LinkType; video_cover: string; video_title: string; video_filename: string; video_desc: string; sub_sort: string; sort: string; up_name: string; up_mid: number; up_face: string; bili_pubdate_str: string; is_stein_gate: boolean; list: IServerVideoPage[]; } export declare interface IServerVideoPage { page_av: number; page_bv: string; page_cid: number; duration: number; page: number; page_name: string; page_title: string; video_title: string; video_filename: string; is_bangumi: boolean; } export declare interface IServerVideoQualityItem { quality: number; quality_str: string; codec: CodecType; bit_rate: string; stream_size: string; is_video: boolean; is_audio: boolean; api_type: number; } export declare interface IServerVideoQualityResponseInner { list: ReadonlyArray; } export declare class LinkId { type: LinkType; id: string; constructor(type: LinkType, id: string | number); get downloadFlag(): string; isUp(): boolean; isNormalVideo(): boolean; isFavoriteList(): boolean; isBangumi(): boolean; isVideo(): boolean; isUpCollection(): boolean; isUpList(): boolean; static resolve(s: string): LinkId; } export declare enum LinkType { UNKNOWN = 0, AV = 1, BV = 2, EP = 3, SS = 4, MEDIA = 5, UP = 6, FAVLIST = 7, UPCOLLECTION = 8, UPLIST = 9 } export declare enum LoginMode { Web = "web", TV = "tv" } export { Method } export declare interface Refreshable { refresh(...args: any[]): Refreshable | Promise; } export declare class ResponseObject> { /** @ignore */ private _raw; /** @ignore */ constructor( /** @ignore */ _raw: T); get code(): number; get success(): boolean; get message(): string | undefined; get raw(): (T extends ServerResponse ? P : never) | undefined; get rawData(): any; toJSON(): any; } export declare type ServerCreateTaskResponse = ServerResponse; export declare type ServerDirResponse = ServerResponse; export declare type ServerFetchAdResponse = ServerResponse; export declare type ServerFetchUpdateStatusResponse = ServerResponse; export declare type ServerResponse = IServerResponseSuccess | IServerResponseError; export declare type ServerTaskStatusResponse = ServerResponse; export declare type ServerUserInfoResponse = ServerResponse; export declare type ServerUserLoginResponse = ServerResponse; export declare type ServerVideoInfoResponse = ServerResponse; export declare type ServerVideoQualityResponse = ServerResponse; export declare class SystemEndpoint { /** @ignore */ private _endpoint; /** @ignore */ constructor( /** @ignore */ _endpoint: Endpoint); fetchAd(): Promise; fetchUpdateStatus(): Promise; getDownloadDir(): Promise; setDownloadDir(dir: string): Promise; } export declare class Task extends ResponseObject { private _endpoint; private _id; private _control; constructor(raw: ServerCreateTaskResponse, _endpoint: TaskEndpoint); get id(): string; get controlName(): string; control(): TaskControl; } export declare class TaskControl { readonly id: string; private _endpoint; constructor(id: string, _endpoint: TaskEndpoint); get controlName(): string; pause(): Promise; resume(): Promise; delete(): Promise; deleteWithFile(): Promise; status(): Promise; clone(): TaskControl; } export declare class TaskEndpoint { /** @ignore */ private _endpoint; /** @ignore */ constructor( /** @ignore */ _endpoint: Endpoint); createRaw(options: CreateTaskOptionsRaw): Promise; control(id: string): TaskControl; pause(id: string): Promise; resume(id: string): Promise; delete(id: string): Promise; deleteWithFile(id: string): Promise; status(id: string): Promise; deleteTaskAndFile(id: string): Promise; } export declare class TaskStatus extends ResponseObject { private _endpoint; constructor(raw: ServerTaskStatusResponse, _endpoint: TaskEndpoint); control(): TaskControl; refresh(): Promise; get id(): string; get controlName(): string; get status(): TaskStatusType; get statusText(): string; get averageSpeed(): string; get taskMessage(): string; get progress(): number; get useTime(): number; } export declare enum TaskStatusType { TASKERROR = 0, TASKPAUSE = 1, TASKRUNNING = 2, TASKWAIT = 3, TASKMERGEING = 4, TASKGENMUSIC = 5, TASKCOMPLETE = 6 } export declare class UpdateStatus extends ResponseObject implements Refreshable { /** @ignore */ private _endpoint; /** @ignore */ constructor(raw: ServerFetchUpdateStatusResponse, /** @ignore */ _endpoint: SystemEndpoint); get isChecking(): boolean; get isNotSupportUpdate(): boolean; get isUpToDate(): boolean; get isNeedUpdate(): boolean; get changelog(): string | undefined; get status(): UpdateStatusType | undefined; refresh(): Promise; } export declare enum UpdateStatusType { CHECKING = 0, NOTSUPPORTUPDATE = 1, UPTODATE = 2, NEEDUPDATE = 3 } export declare class User { private _mid?; private _uname?; private _face?; constructor(_mid?: number | undefined, _uname?: string | undefined, _face?: string | undefined); get id(): number | undefined; get username(): string | undefined; get avatarImage(): string | undefined; } export declare class UserEndpoint { /** @ignore */ private _endpoint; /** @ignore */ constructor( /** @ignore */ _endpoint: Endpoint); login(mode: LoginMode): Promise; getInfo(): Promise; } export declare class UserInfo extends ResponseObject implements Refreshable { /** @ignore */ private _endpoint; /** @ignore */ constructor( /** @ignore */ _endpoint: UserEndpoint, _raw: ServerUserInfoResponse); get isLogin(): boolean; user(): User; get vipInfo(): UserVipInfo | undefined; refresh(): Promise; } export declare class UserLogin extends ResponseObject implements Refreshable { /** @ignore */ private _user; /** @ignore */ private _mode; /** @ignore */ private _img; /** @ignore */ constructor( /** @ignore */ _user: UserEndpoint, _raw: ServerUserLoginResponse, /** @ignore */ _mode: LoginMode); get loginSuccess(): boolean; get mode(): string | undefined; get image(): Base64Image | undefined; refresh(mode?: LoginMode): Promise; waitToLogon(refresh_fn?: (login: UserLogin) => Promise, poll_fn?: (login: UserLogin) => Promise, refresh_ms?: number, ms?: number): Promise; } export declare interface UserVipInfo { status: boolean; label?: string; theme?: string; } export declare class Video extends ResponseObject { /** @ignore */ private _endpoint; /** @ignore */ private readonly _linkid; /** @ignore */ private readonly _up_user; /** @ignore */ private readonly _date; /** @ignore */ private readonly _pages; /** @ignore */ constructor( /** @ignore */ _endpoint: VideoEndpoint, raw: ServerVideoInfoResponse); get id(): LinkId | undefined; get upUser(): User | undefined; get rawId(): number | undefined; get rawLinkType(): LinkType | undefined; get title(): string | undefined; get description(): string | undefined; get coverImage(): string | undefined; get filename(): string | undefined; get publishDate(): moment_2.Moment | undefined; get isSteinGate(): boolean; get sort(): string | undefined; get subSort(): string | undefined; get pages(): ReadonlyArray; getQuality(useBv?: boolean): AsyncIterable; getQualityByIndex(index?: number, useBv?: boolean): Promise; [Symbol.iterator](): IterableIterator; toJSON(): IServerVideoInfoResponseInner | null | undefined; } export declare class VideoEndpoint { private _endpoint; constructor(_endpoint: Endpoint); getVideoQuality(id: LinkId | string, cid: number): Promise; getVideoInfo(id: LinkId | string): Promise