Skip to content

Commit

Permalink
Add Survey events in types (#305)
Browse files Browse the repository at this point in the history
Co-authored-by: Viktor Denisov <[email protected]>
  • Loading branch information
plag and Viktor Denisov authored Jun 28, 2022
1 parent 0e8e5f8 commit 9fa8a63
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
Expand Down
6 changes: 6 additions & 0 deletions src/types/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ export type RequestPropsMap = {
VKWebAppRetargetingPixel: RetargetingPixelOptions;
VKWebAppCheckAllowedScopes: { scopes: string };
VKWebAppConversionHit: ConversionHitRequest;
VKWebAppCheckSurvey: {};
VKWebAppShowSurvey: {};
};

/**
Expand Down Expand Up @@ -1113,6 +1115,8 @@ export type ReceiveDataMap = {
VKWebAppCheckAllowedScopes: { result: VKWebAppCheckAllowedScopesResponseEntry[] };
VKWebAppChangeFragment: ChangeFragmentResponse;
VKWebAppConversionHit: ConversionHitResponse;
VKWebAppCheckSurvey: { result: boolean };
VKWebAppShowSurvey: { result: boolean };
};

type EventReceiveNames<T extends keyof RequestPropsMap, R extends string, F extends string> = Record<
Expand Down Expand Up @@ -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'>;

0 comments on commit 9fa8a63

Please sign in to comment.