///
import Logger from '@meteor-it/logger';
import EventEmitter from './EventEmitter';
import { Readable } from 'stream';
import TimingData from './TimingData';
export default class XBot extends EventEmitter {
logger: Logger;
name: string;
apiList: Api[];
constructor(name: string);
attachApi(api: Api): void;
onMessage(message: MessageEvent, sourceApi: Api): void;
onLeave(leave: LeaveEvent, sourceApi: Api): void;
onJoin(join: JoinEvent, sourceApi: Api): void;
onAction(action: ActionEvent, sourceApi: Api): void;
onPhoto(photo: PhotoChangeEvent, sourceApi: Api): void;
onTitle(title: TitleChangeEvent, sourceApi: Api): void;
uGetUser(uid: string): Promise;
uGetChat(cid: string): Promise;
}
export declare type IMessageOptions = {};
export declare class Api extends EventEmitter {
logger: Logger;
logged: boolean;
constructor(name: string | Logger);
auth(...params: string[]): Promise;
uGetUser(uid: string): Promise;
uGetChat(cid: string): Promise;
sendLocation(conv: Conversation, answer: boolean, caption: string, location: Location, options: IMessageOptions): Promise;
sendText(conv: Conversation, answer: boolean, text: string, options: IMessageOptions): Promise;
sendImageStream(conv: Conversation, answer: boolean, caption: string, image: Image, options: IMessageOptions): Promise;
sendFileStream(conv: Conversation, answer: boolean, caption: string, file: File, options: IMessageOptions): Promise;
sendAudioStream(conv: Conversation, answer: boolean, caption: string, audio: Audio, options: IMessageOptions): Promise;
sendCustom(conv: Conversation, answer: boolean, caption: string, options: IMessageOptions): Promise;
}
export declare class Location {
lat: number;
long: number;
constructor(lat: number, long: number);
}
export declare class Attachment {
type: string;
constructor(type: string);
}
export declare class MessengerSpecific extends Attachment {
messengerSpecificType: string;
data: T;
constructor(messengerSpecificType: string, data: T);
}
export declare class BaseFile extends Attachment {
stream: Readable;
size: number;
name: string;
constructor(stream: Readable, size: number, name: string);
}
export declare class File extends BaseFile {
mime: string;
constructor(stream: Readable, size: number, name: string, mime?: string);
static fromBuffer(buffer: Buffer, name: string, mime?: string): Promise;
static fromUrl(url: string, name: string, mime?: string): Promise;
static fromFilePath(path: string, name: string, mime?: string): Promise;
}
export declare class Image extends BaseFile {
constructor(stream: Readable, size: number);
static fromUrl(url: string): Promise;
static fromFilePath(path: string): Promise;
static fromCanvas(canvas: any): Promise;
}
export declare class Audio extends BaseFile {
constructor(stream: Readable, size: number, artist: string, title: string);
static fromUrl(url: string, artist: string, title: string): Promise