mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Merge pull request #19093 from Agadar/master
Updated node-telegram-bot-api, added node-cleanup
This commit is contained in:
commit
7ad5650b35
17
types/node-cleanup/index.d.ts
vendored
Normal file
17
types/node-cleanup/index.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Type definitions for node-cleanup 2.1
|
||||
// Project: https://github.com/jtlapp/node-cleanup
|
||||
// Definitions by: Agadar <https://github.com/agadar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Note that ES6 modules cannot directly export callable functions.
|
||||
// This file should be imported using the CommonJS-style:
|
||||
// import nodeCleanup = require('node-cleanup');
|
||||
|
||||
export = install;
|
||||
|
||||
declare function install(cleanupHandler?: ((exitCode: number | null, signal: string | null) => boolean | undefined),
|
||||
stderrMessages?: { ctrl_C: string; uncaughtException: string }): void;
|
||||
|
||||
declare namespace install {
|
||||
function uninstall(): void;
|
||||
}
|
||||
13
types/node-cleanup/node-cleanup-tests.ts
Normal file
13
types/node-cleanup/node-cleanup-tests.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import nodeCleanup = require('node-cleanup');
|
||||
|
||||
function cleanupHandler(exitCode: number | null, signal: string | null): boolean | undefined {
|
||||
return true;
|
||||
}
|
||||
const stderrMessages = { ctrl_C: 'ctrl_c', uncaughtException: 'UncaughtException' };
|
||||
|
||||
nodeCleanup();
|
||||
nodeCleanup(cleanupHandler);
|
||||
nodeCleanup(cleanupHandler, undefined);
|
||||
nodeCleanup(cleanupHandler, stderrMessages);
|
||||
nodeCleanup(undefined, stderrMessages);
|
||||
nodeCleanup.uninstall();
|
||||
22
types/node-cleanup/tsconfig.json
Normal file
22
types/node-cleanup/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"node-cleanup-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/node-cleanup/tslint.json
Normal file
1
types/node-cleanup/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
43
types/node-telegram-bot-api/index.d.ts
vendored
43
types/node-telegram-bot-api/index.d.ts
vendored
@ -1,10 +1,15 @@
|
||||
// Type definitions for node-telegram-bot-api 0.27
|
||||
// Type definitions for node-telegram-bot-api 0.28
|
||||
// Project: https://github.com/yagop/node-telegram-bot-api
|
||||
// Definitions by: Alex Muench <https://github.com/ammuench>
|
||||
// Agadar <https://github.com/agadar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
/// <reference types="node" />
|
||||
|
||||
declare class TelegramBot {
|
||||
import { EventEmitter } from 'events';
|
||||
import { Stream } from "stream";
|
||||
|
||||
declare class TelegramBot extends EventEmitter {
|
||||
constructor(token: string, opts?: any);
|
||||
|
||||
startPolling(options?: any): Promise<any>;
|
||||
@ -23,27 +28,38 @@ declare class TelegramBot {
|
||||
sendMessage(chatId: number | string, text: string, options?: any): Promise<any>;
|
||||
answerInlineQuery(inlineQueryId: string, results: any[], options?: any): Promise<any>;
|
||||
forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: any): Promise<any>;
|
||||
sendPhoto(chatId: number | string, photo: any, options?: any): Promise<any>;
|
||||
sendAudio(chatId: number | string, audio: any, options?: any): Promise<any>;
|
||||
sendDocument(chatId: number | string, doc: any, options?: any, fileOpts?: any): Promise<any>;
|
||||
sendSticker(chatId: number | string, sticker: any, options?: any): Promise<any>;
|
||||
sendVideo(chatId: number | string, video: any, options?: any): Promise<any>;
|
||||
sendVoice(chatId: number | string, voice: any, options?: any): Promise<any>;
|
||||
sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: any): Promise<any>;
|
||||
sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: any): Promise<any>;
|
||||
sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: any, fileOpts?: any): Promise<any>;
|
||||
sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: any): Promise<any>;
|
||||
sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: any): Promise<any>;
|
||||
sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: any): Promise<any>;
|
||||
sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: any): Promise<any>;
|
||||
sendChatAction(chatId: number | string, action: string): Promise<any>;
|
||||
kickChatMember(chatId: number | string, userId: string): Promise<any>;
|
||||
unbanChatMember(chatId: number | string, userId: string): Promise<any>;
|
||||
answerCallbackQuery(callbackQueryId: number | string, text: string, showAlert: boolean, options?: any): Promise<any>;
|
||||
restrictChatMember(chatId: number | string, userId: string, options?: any): Promise<any>;
|
||||
promoteChatMember(chatId: number | string, userId: string, options?: any): Promise<any>;
|
||||
exportChatInviteLink(chatId: number | string): Promise<any>;
|
||||
sendChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise<any>;
|
||||
deleteChatPhoto(chatId: number | string): Promise<any>;
|
||||
setChatTitle(chatId: number | string, title: string): Promise<any>;
|
||||
setChatDescription(chatId: number | string, description: string): Promise<any>;
|
||||
pinChatMessage(chatId: number | string, messageId: string): Promise<any>;
|
||||
unpinChatMessage(chatId: number | string): Promise<any>;
|
||||
answerCallbackQuery(options?: any): Promise<any>;
|
||||
editMessageText(text: string, options?: any): Promise<any>;
|
||||
editMessageCaption(caption: string, options?: any): Promise<any>;
|
||||
editMessageReplyMarkup(replyMarkup: any, options?: any): Promise<any>;
|
||||
getUserProfilePhotos(userId: string, options?: any): Promise<any>;
|
||||
getUserProfilePhotos(userId: number | string, options?: any): Promise<any>;
|
||||
sendLocation(chatId: number | string, latitude: number, longitude: number, options?: any): Promise<any>;
|
||||
sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: any): Promise<any>;
|
||||
sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: any): Promise<any>;
|
||||
getFile(fileId: string): Promise<any>;
|
||||
getFileLink(fileId: string): Promise<any>;
|
||||
downloadFile(fileId: string, downloadDir: string): Promise<any>;
|
||||
onText(regexp: any, callback: ((msg: any, match: any[]) => void)): void;
|
||||
onText(regexp: RegExp, callback: ((msg: any, match: any[]) => void)): void;
|
||||
removeTextListener(regexp: RegExp): any;
|
||||
onReplyToMessage(chatId: number | string, messageId: number | string, callback: ((msg: any) => void)): number;
|
||||
removeReplyListener(replyListenerId: number): any;
|
||||
getChat(chatId: number | string): Promise<any>;
|
||||
@ -54,6 +70,11 @@ declare class TelegramBot {
|
||||
sendGame(chatId: number | string, gameShortName: string, options?: any): Promise<any>;
|
||||
setGameScore(userId: string, score: number, options?: any): Promise<any>;
|
||||
getGameHighScores(userId: string, options?: any): Promise<any>;
|
||||
deleteMessage(chatId: number | string, messageId: string, options?: any): Promise<any>;
|
||||
sendInvoice(chatId: number | string, title: string, description: string, payload: string, providerToken: string, startParameter: string,
|
||||
currency: string, prices: any[], options?: any): Promise<any>;
|
||||
answerShippingQuery(shippingQueryId: string, ok: boolean, options?: any): Promise<any>;
|
||||
answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: any): Promise<any>;
|
||||
}
|
||||
|
||||
export = TelegramBot;
|
||||
|
||||
@ -23,11 +23,21 @@ MyTelegramBot.sendAudio(1234, "audio/path", { foo: "bar" });
|
||||
MyTelegramBot.sendDocument(1234, "doc/path", { foo: "bar" }, { fileOption: true });
|
||||
MyTelegramBot.sendSticker(1234, "sticker/path", { foo: "bar" });
|
||||
MyTelegramBot.sendVideo(1234, "video/path", { foo: "bar" });
|
||||
MyTelegramBot.sendVideoNote(1234, "video/path", { foo: "bar" });
|
||||
MyTelegramBot.sendVoice(1234, "voice/path", { foo: "bar" });
|
||||
MyTelegramBot.sendChatAction(1234, "ACTION!");
|
||||
MyTelegramBot.kickChatMember(1234, "myUserID");
|
||||
MyTelegramBot.unbanChatMember(1234, "myUserID");
|
||||
MyTelegramBot.answerCallbackQuery("myCallbackQueryID", "test-text", false, { foo: "bar" });
|
||||
MyTelegramBot.restrictChatMember(1234, 'myUserID', { foo: "bar" });
|
||||
MyTelegramBot.promoteChatMember(1234, 'myUserID', { foo: "bar" });
|
||||
MyTelegramBot.exportChatInviteLink(1234);
|
||||
MyTelegramBot.sendChatPhoto(1234, "My/File/ID");
|
||||
MyTelegramBot.deleteChatPhoto(1234);
|
||||
MyTelegramBot.setChatTitle(1234, 'Chat Title');
|
||||
MyTelegramBot.setChatDescription(1234, 'Chat Description');
|
||||
MyTelegramBot.pinChatMessage(1234, 'Pinned Message');
|
||||
MyTelegramBot.unpinChatMessage(1234);
|
||||
MyTelegramBot.answerCallbackQuery({ foo: "bar" });
|
||||
MyTelegramBot.editMessageText("test-text", { foo: "bar" });
|
||||
MyTelegramBot.editMessageCaption("My Witty Caption", { foo: "bar" });
|
||||
MyTelegramBot.editMessageReplyMarkup({ replyMarkup: "something" }, { foo: "bar" });
|
||||
@ -39,6 +49,7 @@ MyTelegramBot.getFile("My/File/ID");
|
||||
MyTelegramBot.getFileLink("My/File/ID");
|
||||
MyTelegramBot.downloadFile("My/File/ID", "mydownloaddir/");
|
||||
MyTelegramBot.onText(/regex/, (msg, match) => { });
|
||||
MyTelegramBot.removeTextListener(/regex/);
|
||||
MyTelegramBot.onReplyToMessage(1234, "mymessageID", (msg) => { });
|
||||
MyTelegramBot.removeReplyListener(5466);
|
||||
MyTelegramBot.getChat(1234);
|
||||
@ -49,3 +60,7 @@ MyTelegramBot.leaveChat(1234);
|
||||
MyTelegramBot.sendGame(1234, "MygameName", { foo: "bar" });
|
||||
MyTelegramBot.setGameScore("myUserID", 99, { foo: "bar" });
|
||||
MyTelegramBot.getGameHighScores("myUserID", { foo: "bar" });
|
||||
MyTelegramBot.deleteMessage(1234, 'mymessageID', { foo: "bar" });
|
||||
MyTelegramBot.sendInvoice(1234, 'Invoice Title', 'Invoice Description', 'Invoice Payload', 'Providertoken', 'Startparameter', 'Currency', [1, 2, 4], { foo: "bar" });
|
||||
MyTelegramBot.answerShippingQuery('shippingQueryId', true, { foo: "bar" });
|
||||
MyTelegramBot.answerPreCheckoutQuery('preCheckoutQueryId', true, { foo: "bar" });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user