From 9fa8a63da10c87f19bb9ceb72859cbe49000079e Mon Sep 17 00:00:00 2001 From: Victor Denisov Date: Tue, 28 Jun 2022 17:12:28 +0300 Subject: [PATCH] Add Survey events in types (#305) Co-authored-by: Viktor Denisov --- package.json | 2 +- src/bridge.ts | 2 ++ src/types/data.ts | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3874640..e3bc736 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vkontakte/vk-bridge", - "version": "2.6.3", + "version": "2.6.4", "description": "Connects a Mini App with VK client", "license": "MIT", "main": "dist/index.js", diff --git a/src/bridge.ts b/src/bridge.ts index 1491b69..7cd72fb 100644 --- a/src/bridge.ts +++ b/src/bridge.ts @@ -85,6 +85,8 @@ export const DESKTOP_METHODS = [ 'VKWebAppRetargetingPixel', 'VKWebAppConversionHit', 'VKWebAppShowSubscriptionBox', + 'VKWebAppCheckSurvey', + 'VKWebAppShowSurvey', // Desktop web specific events ...(IS_DESKTOP_VK ? ['VKWebAppResizeWindow', 'VKWebAppAddToMenu', 'VKWebAppShowInstallPushBox', 'VKWebAppGetFriends'] : ['VKWebAppShowImages']), diff --git a/src/types/data.ts b/src/types/data.ts index 3d3784a..93e5b59 100644 --- a/src/types/data.ts +++ b/src/types/data.ts @@ -1014,6 +1014,8 @@ export type RequestPropsMap = { VKWebAppRetargetingPixel: RetargetingPixelOptions; VKWebAppCheckAllowedScopes: { scopes: string }; VKWebAppConversionHit: ConversionHitRequest; + VKWebAppCheckSurvey: {}; + VKWebAppShowSurvey: {}; }; /** @@ -1113,6 +1115,8 @@ export type ReceiveDataMap = { VKWebAppCheckAllowedScopes: { result: VKWebAppCheckAllowedScopesResponseEntry[] }; VKWebAppChangeFragment: ChangeFragmentResponse; VKWebAppConversionHit: ConversionHitResponse; + VKWebAppCheckSurvey: { result: boolean }; + VKWebAppShowSurvey: { result: boolean }; }; type EventReceiveNames = Record< @@ -1231,4 +1235,6 @@ export type ReceiveEventMap = EventReceiveNames<'VKWebAppInit', 'VKWebAppInitRes EventReceiveNames<'VKWebAppGetGroupInfo', 'VKWebAppGetGroupInfoResult', 'VKWebAppGetGroupInfoFailed'> & EventReceiveNames<'VKWebAppRetargetingPixel', 'VKWebAppRetargetingPixelResult', 'VKWebAppRetargetingPixelFailed'> & EventReceiveNames<'VKWebAppCheckAllowedScopes', 'VKWebAppCheckAllowedScopesResult', 'VKWebAppCheckAllowedScopesFailed'> & + EventReceiveNames<'VKWebAppCheckSurvey', 'VKWebAppCheckSurveyResult', 'VKWebAppCheckSurveyFailed'> & + EventReceiveNames<'VKWebAppShowSurvey', 'VKWebAppShowSurveyResult', 'VKWebAppShowSurveyFailed'> & EventReceiveNames<'VKWebAppConversionHit', 'VKWebAppConversionHitResult', 'VKWebAppConversionHitFailed'>;