diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 99a2aae7b8..8017017d8c 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1321,7 +1321,7 @@ declare namespace DataTables { /** * Set an initial filter in DataTables and / or filtering options. Since: 1.10 */ - search?: SearchSettings; + search?: SearchSettings | boolean; /** * Set placeholder attribute for input type="text" tag elements. Since: 1.10 diff --git a/types/htmlbars-inline-precompile/htmlbars-inline-precompile-tests.ts b/types/htmlbars-inline-precompile/htmlbars-inline-precompile-tests.ts new file mode 100644 index 0000000000..c8adb26d1a --- /dev/null +++ b/types/htmlbars-inline-precompile/htmlbars-inline-precompile-tests.ts @@ -0,0 +1,5 @@ +import hbs from 'htmlbars-inline-precompile'; + +const likeThisDotRender = (s: string | string[]) => {}; + +likeThisDotRender(hbs`this is allowed`); diff --git a/types/htmlbars-inline-precompile/index.d.ts b/types/htmlbars-inline-precompile/index.d.ts new file mode 100644 index 0000000000..ab4bf9a1b7 --- /dev/null +++ b/types/htmlbars-inline-precompile/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for htmlbars-inline-precompile 1.0 +// Project: https://github.com/ember-cli/ember-cli-htmlbars-inline-precompile +// Definitions by: Chris Krycho +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// This is a bit of a funky one: it's from a [Babel plugin], but is exported for +// Ember applications as the module `"htmlbars-inline-precompile"`. It acts +// like a tagged string from the perspective of consumers, but is actually an +// AST transformation which generates a function as its output. That function in +// turn [generates a string or array of strings][output] to use with the Ember +// testing helper `this.render()`. +// +// [Babel plugin]: https://github.com/ember-cli/babel-plugin-htmlbars-inline-precompile#babel-plugin-htmlbars-inline-precompile- +// [output]: https://github.com/emberjs/ember-test-helpers/blob/77f9a53da9d8c19a85b3122788caadbcc59274c2/lib/ember-test-helpers/-legacy-overrides.js#L17-L42 + +export default function hbs(tagged: TemplateStringsArray): string | string[]; diff --git a/types/htmlbars-inline-precompile/tsconfig.json b/types/htmlbars-inline-precompile/tsconfig.json new file mode 100644 index 0000000000..32ad3d22fb --- /dev/null +++ b/types/htmlbars-inline-precompile/tsconfig.json @@ -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", + "htmlbars-inline-precompile-tests.ts" + ] +} diff --git a/types/htmlbars-inline-precompile/tslint.json b/types/htmlbars-inline-precompile/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/htmlbars-inline-precompile/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/js.spec/index.d.ts b/types/js.spec/index.d.ts new file mode 100644 index 0000000000..b33a0fd475 --- /dev/null +++ b/types/js.spec/index.d.ts @@ -0,0 +1,330 @@ +// Type definitions for js.spec 1.0 +// Project: http://js-spec.online +// Definitions by: Matt Bishop +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * A Spec provides a predicate that can test a value for conformance. + */ +export interface Spec { + /** + * The name of the spec, displayed in explain() results. + */ + readonly name: string; + + /** + * Data necessary to check values for conformity. + */ + readonly options: object; + + /** + * Returns the conformed value to this spec. + * @param value the value to test for conformance + * @returns {symbol.invalid} if the value does not conform to the spec, or the value if it does. + */ + conform(value: any): any; + + /** + * Explain why a value does not conform to this spec. + * @param value the value to examine + * @returns {Problem[]} list of problems or null if none + */ + explain(value: any): Problem[]; +} + +/** + * A Spec with a boolean conform function. Test the value and return true if it conforms. + */ +export interface Predicate extends Spec { + (value: any): boolean; +} + +/** + * An explanation of why a part of a value does not conform to a spec. + */ +export interface Problem { + /** + * The path to the value. + */ + readonly path: string[]; + + /** + * Pth to he Spec that applies. + */ + readonly via: string[]; + + /** + * The value associated with the problem. + */ + readonly value: any; + + /** + * A predicate function to test new values for conformance. + */ + readonly predicate: Predicate; +} + +/** + * Given a Spec, tests the value for confomrance. If it passes, then returns true. + * @param {Spec} spec the spec to test with + * @param value the value to test + * @returns {boolean} true if valid + */ +export function valid(spec: Spec, value: any): boolean; + +/** + * Returns the conformed value to this spec. + * @param {Spec} spec the spec to test with + * @param value the value to test + * @returns {symbol.invalid} if the value does not conform to the spec, or the conformed value if it does. + */ +export function conform(spec: Spec, value: any): any; + +/** + * Like explain(), but returns Problems array. + * @param {Spec} spec the spec to test with + * @param value the value to test + * @returns {Problem[]} list of problems or null if none + */ +export function explainData(spec: Spec, value: any): Problem[]; + +/** + * Prints, to the console, reasons why the value did not conform to this spec. + * @param {Spec} spec the spec to test with + * @param value the value to test + */ +export function explain(spec: Spec, value: any): void; + +/** + * Returns a multiline string with reasons why the value did not conform to this spec. + * @param {Spec} spec the spec to test with + * @param value the value to test + */ +export function explainStr(spec: Spec, value: any): string; + +/** + * Tests if a value conforms to a spec, and if not, throws an Error. + * @param {Spec} spec the spec to test with + * @param value the value to test + */ +export function assert(spec: Spec, value: any): void; + +export namespace symbol { + /** + * Returned by conform() to indicate a value does not conform to a spec. + */ + const invalid: symbol; + + /** + * Used as an option in collection() to specify the size of a collection. + */ + const count: symbol; + + /** + * Used as an option in collection() to specify the maximum size of a collection. + */ + const maxCount: symbol; + + /** + * Used as an option in collection() to specify the minimum size of a collection. + */ + const minCount: symbol; + + /** + * Used as an option in map() to specify a key spec that is optional. + */ + const optional: symbol; +} + +export namespace spec { + /** + * Predicate function definition to describe non-spec predicate functions. + */ + type PredFn = (value: any) => boolean; + + /** + * Defins an input to a spec. Can be a Spec instance or a predicate function. + */ + type SpecInput = PredFn | Spec; + + /** + * Data must conform to every provided spec. + * @param {string} name the name of the spec + * @param {spec.SpecInput} specs the array of specs that must all match + * @returns {Spec} the constructed Spec + */ + function and(name: string, ...specs: SpecInput[]): Spec; + + /** + * Data must conform to at least one provided spec. The order in which they are validated is not defined. + * The conform() function returns matched branches along with input data. + * @param {string} name the name of the spec + * @param {object} alts map of alternative keys with their respective SpecInputs + * @returns {Spec} the constructed Spec + */ + function or(name: string, alts: {[key: string]: SpecInput}): Spec; + + /** + * By default no spec accepts null or undefined as valid input. Wrap your spec in nilable() to change this. + * @param {string} name the name of the spec + * @param {spec.SpecInput} spec the spec to apply if a value is non-nil + * @returns {Spec} the constructed spec + */ + function nilable(name: string, spec: SpecInput): Spec; + + // Cannot specify 'symbol' as a key type: https://github.com/Microsoft/TypeScript/issues/7660 + /** + * Used to define collections with items of the same type. Works with Arrays and Sets. + * Accepts an option map as optional second parameter. + * NOTE: the keys in this option map are symbols but Typescript will not allow 'symbol' to be specified + * as a key type but the TS compiler will allow it. + * @param {string} name the name of the spec + * @param {spec.SpecInput} spec the spec to apply to values in the collection + * @param {object} options symbol.count or symbol.minCount / symbol.maxCount + * @returns {Spec} + */ + function collection(name: string, spec: SpecInput, options?: {[option: string]: number}): Spec; + + /** + * Used to define collections with items of possibly different types. Works only with arrays as order is important. + * @param {string} name the name of the spec + * @param {spec.SpecInput} specs the specs to test the value array + * @returns {Spec} the constructed spec + */ + function tuple(name: string, ...specs: SpecInput[]): Spec; + + /** + * Used to define the shape of maps. By default all keys are required. Use {symbol.optional} key to define + * optional keys. Shape map can contain nested key specs. + * @param {string} name the name of the spec + * @param {Object} shape the shape map with keys and associated specs + * @returns {Spec} the constructed spec + */ + function map(name: string, shape: object): Spec; + + /** + * Used to define "one out of these values", like an enum. (It's called oneOf because enum is a reserved word.) + * @param {string} name the name of the spec + * @param values the emum of values + * @returns {Spec} the constructed spec + */ + function oneOf(name: string, ...values: any[]): Spec; + + // Predicates + /** + * Returns true if data is an integer. + */ + const int: Predicate; + + /** + * Returns true if data is an integer. + */ + const integer: Predicate; + + /** + * Returns true if data is a finite number. + */ + const finite: Predicate; + + /** + * Returns true if data is a number (can be double or integer). + */ + const number: Predicate; + + /** + * Returns true if data is an odd number. + */ + const odd: Predicate; + + /** + * Returns true if data is an even number. + */ + const even: Predicate; + + /** + * Returns true if data is a number greater than zero. + */ + const positive: Predicate; + + /** + * Returns true if data is a number smaller than zero. + */ + const negative: Predicate; + + /** + * Returns true if data is the number zero. + * Why: To easily construct specs for >= 0. + */ + const zero: Predicate; + + /** + * Returns true if data is a string. + */ + const str: Predicate; + + /** + * Returns true if data is a string. + */ + const string: Predicate; + + /** + * Returns true if data is a function. + */ + const fn: Predicate; + + /** + * Returns true if data is a Symbol. + */ + const sym: Predicate; + + /** + * Returns true if data is a Symbol. + */ + const symbol: Predicate; + + /** + * Returns true if data is null or undefined. + */ + const nil: Predicate; + + /** + * Returns true if data is a boolean. + */ + const bool: Predicate; + + /** + * Returns true if data is a boolean. + */ + const boolean: Predicate; + + /** + * Returns true if data is a Date. + */ + const date: Predicate; + + /** + * Returns true if data is a plain object. + */ + const obj: Predicate; + + /** + * Returns true if data is a plain object. + */ + const object: Predicate; + + /** + * Returns true if data is an Array. + */ + const array: Predicate; + + /** + * Returns true if data is a Set. + */ + const set: Predicate; + + /** + * Returns true if data is an Array or Set. + */ + const coll: Predicate; +} diff --git a/types/js.spec/js.spec-tests.ts b/types/js.spec/js.spec-tests.ts new file mode 100644 index 0000000000..8bb9611e87 --- /dev/null +++ b/types/js.spec/js.spec-tests.ts @@ -0,0 +1,87 @@ +import * as S from "js.spec"; + +const spec: S.Spec = S.spec.bool; +const c: symbol = spec.conform("water"); +const waterProblems: S.Problem[] = spec.explain("water"); +const name: string = spec.name; +const options: object = spec.options; + +const isValid: boolean = S.valid(S.spec.boolean, true); + +const result = S.conform(S.spec.map("dancing", {field: S.spec.string}), "not a map"); + +const problems: S.Problem[] = S.explainData(S.spec.int, "not a number"); + +const {path, via, value, predicate}: {path: string[], via: string[], value: any, predicate: S.Predicate} = problems[0]; + +const problemStr: string = S.explainStr(S.spec.even, 3); + +// $ExpectType void +S.explain(S.spec.positive, true); + +// $ExpectType void +S.assert(S.spec.string, "things"); + +const symbols: symbol[] = [S.symbol.count, S.symbol.invalid, S.symbol.maxCount, S.symbol.minCount, S.symbol.optional]; + +const orSpec: S.Spec = S.spec.or("or test", { ball: (value: any) => value === "whale", fish: S.spec.number }); + +const nilableSpec: S.Spec = S.spec.nilable("nilable test", (value: any) => false); + +const collectionSpec: S.Spec = S.spec.collection("collection test", S.spec.positive); + +const collection2Spec: S.Spec = S.spec.collection("collection test", S.spec.string, {[S.symbol.count]: 3}); + +const tupleSpec: S.Spec = S.spec.tuple("tuple test", S.spec.bool, S.spec.date, S.spec.array); + +const mapSpec: S.Spec = S.spec.map("map test", { email: S.spec.string, [S.symbol.optional]: { name: S.spec.string } }); + +const oneOfSpec: S.Spec = S.spec.oneOf("oneOf test", "a", "b", "c"); + +// Predicates + +const intPred: S.Predicate = S.spec.int; + +const integerPred: S.Predicate = S.spec.integer; + +const finitePred: S.Predicate = S.spec.finite; + +const numberPred: S.Predicate = S.spec.number; + +const oddPred: S.Predicate = S.spec.odd; + +const evenPred: S.Predicate = S.spec.even; + +const positivePred: S.Predicate = S.spec.positive; + +const negativePred: S.Predicate = S.spec.negative; + +const zeroPred: S.Predicate = S.spec.zero; + +const strPred: S.Predicate = S.spec.str; + +const stringPred: S.Predicate = S.spec.string; + +const fnPred: S.Predicate = S.spec.fn; + +const symPred: S.Predicate = S.spec.sym; + +const symbolPred: S.Predicate = S.spec.symbol; + +const nilPred: S.Predicate = S.spec.nil; + +const boolPred: S.Predicate = S.spec.bool; + +const booleanPred: S.Predicate = S.spec.boolean; + +const datePred: S.Predicate = S.spec.date; + +const objPred: S.Predicate = S.spec.obj; + +const objectPred: S.Predicate = S.spec.object; + +const arrayPred: S.Predicate = S.spec.array; + +const setPred: S.Predicate = S.spec.set; + +const collPred: S.Predicate = S.spec.coll; diff --git a/types/js.spec/tsconfig.json b/types/js.spec/tsconfig.json new file mode 100644 index 0000000000..b3afe65da2 --- /dev/null +++ b/types/js.spec/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "js.spec-tests.ts" + ] +} diff --git a/types/js.spec/tslint.json b/types/js.spec/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/js.spec/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/node-cleanup/index.d.ts b/types/node-cleanup/index.d.ts new file mode 100644 index 0000000000..103f0bc813 --- /dev/null +++ b/types/node-cleanup/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for node-cleanup 2.1 +// Project: https://github.com/jtlapp/node-cleanup +// Definitions by: 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; +} diff --git a/types/node-cleanup/node-cleanup-tests.ts b/types/node-cleanup/node-cleanup-tests.ts new file mode 100644 index 0000000000..ec42821dff --- /dev/null +++ b/types/node-cleanup/node-cleanup-tests.ts @@ -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(); diff --git a/types/node-cleanup/tsconfig.json b/types/node-cleanup/tsconfig.json new file mode 100644 index 0000000000..c05b3b90bf --- /dev/null +++ b/types/node-cleanup/tsconfig.json @@ -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" + ] +} diff --git a/types/node-cleanup/tslint.json b/types/node-cleanup/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/node-cleanup/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index 1a7d15ec34..60b46b137c 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -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 +// Agadar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +/// -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; @@ -23,27 +28,38 @@ declare class TelegramBot { sendMessage(chatId: number | string, text: string, options?: any): Promise; answerInlineQuery(inlineQueryId: string, results: any[], options?: any): Promise; forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number | string, options?: any): Promise; - sendPhoto(chatId: number | string, photo: any, options?: any): Promise; - sendAudio(chatId: number | string, audio: any, options?: any): Promise; - sendDocument(chatId: number | string, doc: any, options?: any, fileOpts?: any): Promise; - sendSticker(chatId: number | string, sticker: any, options?: any): Promise; - sendVideo(chatId: number | string, video: any, options?: any): Promise; - sendVoice(chatId: number | string, voice: any, options?: any): Promise; + sendPhoto(chatId: number | string, photo: string | Stream | Buffer, options?: any): Promise; + sendAudio(chatId: number | string, audio: string | Stream | Buffer, options?: any): Promise; + sendDocument(chatId: number | string, doc: string | Stream | Buffer, options?: any, fileOpts?: any): Promise; + sendSticker(chatId: number | string, sticker: string | Stream | Buffer, options?: any): Promise; + sendVideo(chatId: number | string, video: string | Stream | Buffer, options?: any): Promise; + sendVideoNote(chatId: number | string, videoNote: string | Stream | Buffer, options?: any): Promise; + sendVoice(chatId: number | string, voice: string | Stream | Buffer, options?: any): Promise; sendChatAction(chatId: number | string, action: string): Promise; kickChatMember(chatId: number | string, userId: string): Promise; unbanChatMember(chatId: number | string, userId: string): Promise; - answerCallbackQuery(callbackQueryId: number | string, text: string, showAlert: boolean, options?: any): Promise; + restrictChatMember(chatId: number | string, userId: string, options?: any): Promise; + promoteChatMember(chatId: number | string, userId: string, options?: any): Promise; + exportChatInviteLink(chatId: number | string): Promise; + sendChatPhoto(chatId: number | string, photo: string | Stream | Buffer): Promise; + deleteChatPhoto(chatId: number | string): Promise; + setChatTitle(chatId: number | string, title: string): Promise; + setChatDescription(chatId: number | string, description: string): Promise; + pinChatMessage(chatId: number | string, messageId: string): Promise; + unpinChatMessage(chatId: number | string): Promise; + answerCallbackQuery(options?: any): Promise; editMessageText(text: string, options?: any): Promise; editMessageCaption(caption: string, options?: any): Promise; editMessageReplyMarkup(replyMarkup: any, options?: any): Promise; - getUserProfilePhotos(userId: string, options?: any): Promise; + getUserProfilePhotos(userId: number | string, options?: any): Promise; sendLocation(chatId: number | string, latitude: number, longitude: number, options?: any): Promise; sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, options?: any): Promise; sendContact(chatId: number | string, phoneNumber: string, firstName: string, options?: any): Promise; getFile(fileId: string): Promise; getFileLink(fileId: string): Promise; downloadFile(fileId: string, downloadDir: string): Promise; - 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; @@ -54,6 +70,11 @@ declare class TelegramBot { sendGame(chatId: number | string, gameShortName: string, options?: any): Promise; setGameScore(userId: string, score: number, options?: any): Promise; getGameHighScores(userId: string, options?: any): Promise; + deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; + sendInvoice(chatId: number | string, title: string, description: string, payload: string, providerToken: string, startParameter: string, + currency: string, prices: any[], options?: any): Promise; + answerShippingQuery(shippingQueryId: string, ok: boolean, options?: any): Promise; + answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, options?: any): Promise; } export = TelegramBot; diff --git a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts index 80b44216fb..70482a7b38 100644 --- a/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts +++ b/types/node-telegram-bot-api/node-telegram-bot-api-tests.ts @@ -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" });