0.13.5 • Published 6 months ago
@types/tgfancy v0.13.5
Installation
npm install --save @types/tgfancy
Summary
This package contains type definitions for tgfancy (https://github.com/GochoMugo/tgfancy).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tgfancy.
index.d.ts
// Type definitions for tgfancy 0.13
// Project: https://github.com/GochoMugo/tgfancy
// Definitions by: Giorgio Garasto <https://github.com/Dabolus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as TelegramBot from 'node-telegram-bot-api';
declare namespace Tgfancy {
interface ChatIdResolutionOptions {
resolve(token: string, chatId: number | string, callback: ((error: Error | null, target: any) => void)): void;
}
interface EmojificationOptions {
emojify(text: string): string;
}
interface RatelimitingOptions {
maxRetries?: number | undefined;
timeout?: number | undefined;
notify?(methodName: string, ...args: any[]): void;
maxBackoff?: number | undefined;
}
interface WebSocketOptions {
url: string;
autoOpen?: boolean | undefined;
}
interface TgfancyOptions {
chatIdResolution?: boolean | ChatIdResolutionOptions | undefined;
emojification?: boolean | EmojificationOptions | undefined;
kickWithoutBan?: boolean | undefined;
openshiftWebHook?: boolean | undefined;
orderedSending?: boolean | undefined;
ratelimiting?: boolean | RatelimitingOptions | undefined;
textPaging?: boolean | undefined;
webSocket?: boolean | WebSocketOptions | undefined;
}
interface ConstructorOptions extends TelegramBot.ConstructorOptions {
tgfancy?: TgfancyOptions | undefined;
}
interface ResolvedChat {
id: number | string;
username: string;
type: string;
when: string;
}
interface ResolvedGroupOrChannel extends ResolvedChat {
title: string;
}
interface ResolvedUser extends ResolvedChat {
first_name: string;
last_name?: string | undefined;
}
}
declare class Tgfancy extends TelegramBot {
constructor(token: string, options?: Tgfancy.ConstructorOptions);
resolveChatId(chatId: string): Promise<Tgfancy.ResolvedChat>;
openWebSocket(): Promise<undefined>;
closeWebSocket(): Promise<undefined>;
hasOpenWebSocket(): boolean;
kickChatMember(chatId: number | string, userId: number | string, ban?: boolean): Promise<boolean>;
}
export = Tgfancy;
Additional Details
- Last updated: Fri, 02 Jul 2021 19:36:42 GMT
- Dependencies: @types/node-telegram-bot-api
- Global values: none
Credits
These definitions were written by Giorgio Garasto.