From 63cb9fea2c6cae2e4da83e42ef8c318194f24dce Mon Sep 17 00:00:00 2001 From: Alex Muench Date: Mon, 6 May 2019 03:05:45 -0500 Subject: [PATCH] [node-telegram-bot-api] Mark several properties on the WebHookOptions interface as optional (#35218) * Update WebHookOptions interface in response to #35206 * Set `key`, `cert` and `pfx` within the Webhook Options to be optional values, per issue #35206 * Update definition tests to test the new changes * Resolve lint issues with chagnes to node-telegram-bot-api --- types/node-telegram-bot-api/index.d.ts | 8 ++++---- .../node-telegram-bot-api/node-telegram-bot-api-tests.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index d16fd490df..8cfd494d31 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-telegram-bot-api 0.30 +// Type definitions for node-telegram-bot-api 0.31 // Project: https://github.com/yagop/node-telegram-bot-api // Definitions by: Alex Muench // Agadar @@ -78,9 +78,9 @@ declare namespace TelegramBot { interface WebHookOptions { host?: string; port?: number; - key: string; - cert: string; - pfx: string; + key?: string; + cert?: string; + pfx?: string; autoOpen?: boolean; https?: ServerOptions; healthEndpoint?: string; 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 b2d7cea2e6..61f1589f6f 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 @@ -1,6 +1,6 @@ import TelegramBot = require('node-telegram-bot-api'); -const MyTelegramBot = new TelegramBot('token'); +const MyTelegramBot = new TelegramBot('token', { webHook: { host: 'myhost'}}); MyTelegramBot.startPolling({restart: true}); MyTelegramBot.stopPolling();