Skip to content

Commit

Permalink
Merge pull request #157 from ilyapishchulin/master
Browse files Browse the repository at this point in the history
Delete deprecated methods, add new methods and fixed props
  • Loading branch information
mainsmirnov authored Jul 31, 2020
2 parents e555b97 + 5671967 commit f74b154
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
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.2.4",
"version": "2.2.5",
"description": "Connects a Mini App with VK client",
"license": "MIT",
"main": "dist/index.js",
Expand Down
30 changes: 7 additions & 23 deletions src/types/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ export type RetargetingPixelOptions = {
export type RequestPropsMap = {
VKWebAppInit: {};
VKWebAppAddToCommunity: {};
VKWebAppAddToHomeScreen: {};
VKWebAppAddToHomeScreenInfo: {},
VKWebAppAllowMessagesFromGroup: { group_id: number; key?: string };
VKWebAppAllowNotifications: {};
VKWebAppCallAPIMethod: { method: string; params: Record<string, string | number> };
Expand All @@ -754,9 +756,6 @@ export type RequestPropsMap = {
VKWebAppFlashSetLevel: { level: number };
VKWebAppGetClientVersion: {};
VKWebAppGetCommunityToken: CommunityTokenRequestOptions;
VKWebAppGetCommunityAuthToken: CommunityTokenRequestOptions; // Web. Deprecated in favor `VKWebAppGetCommunityToken`
VKWebAppCommunityAccessToken: CommunityTokenRequestOptions; // iOS. Deprecated in favor `VKWebAppGetCommunityToken`
VKWebAppCommunityToken: CommunityTokenRequestOptions; // Android. Deprecated in favor `VKWebAppGetCommunityToken`
VKWebAppAudioPause: {};
VKWebAppGetEmail: {};
VKWebAppGetFriends: { multi?: boolean };
Expand All @@ -777,8 +776,6 @@ export type RequestPropsMap = {
VKWebAppSetViewSettings: {
status_bar_style: AppearanceType;
action_bar_color?: string;
/** Only for android */
navigation_bar_color?: string;
};
VKWebAppShare: { link: string };
VKWebAppShowCommunityWidgetPreviewBox: WidgetPreviewRequestOptions;
Expand Down Expand Up @@ -819,6 +816,8 @@ export type RequestPropsMap = {
export type ReceiveDataMap = {
VKWebAppInit: { result: true };
VKWebAppAddToCommunity: { group_id: number };
VKWebAppAddToHomeScreen: { result: true };
VKWebAppAddToHomeScreenInfo: { is_feature_supported: boolean, is_added_to_home_screen: boolean },
VKWebAppAllowMessagesFromGroup: { result: true };
VKWebAppAllowNotifications: { result: true };
VKWebAppCallAPIMethod: { response: any };
Expand All @@ -833,7 +832,7 @@ export type ReceiveDataMap = {
VKWebAppGetClientVersion: { platform: string; version: string };
VKWebAppGetEmail: { email: string; sign: string };
VKWebAppGetFriends: { users: Array<{ id: number; first_name: string; last_name: string }> };
VKWebAppGetGeodata: { available: boolean | number; lat: string; long: string };
VKWebAppGetGeodata: { available: 0 } | { available: 1; lat: number; long: number };
VKWebAppGetPersonalCard: PersonalCardData;
VKWebAppGetPhoneNumber: { phone_number: string; sign: string; is_verified: boolean };
VKWebAppGetUserInfo: UserInfo;
Expand Down Expand Up @@ -866,12 +865,6 @@ export type ReceiveDataMap = {
VKWebAppAddToFavorites: { result: true };
VKWebAppSendPayload: { result: true };
VKWebAppGetCommunityToken: { access_token: string };
/** Web. Deprecated in favor `VKWebAppGetCommunityToken` */
VKWebAppGetCommunityAuthToken: { access_token: string };
/** iOS. Deprecated in favor `VKWebAppGetCommunityToken` */
VKWebAppCommunityAccessToken: { access_token: string };
/** Android. Deprecated in favor `VKWebAppGetCommunityToken` */
VKWebAppCommunityToken: { access_token: string };
VKWebAppAudioPause: { result: true };
VKWebAppAudioPaused: { position: number; type: string; id: string };
VKWebAppAudioStopped: {}; // Always empty
Expand Down Expand Up @@ -913,6 +906,8 @@ type EventReceiveNames<T extends keyof RequestPropsMap, R extends string, F exte
*/
export type ReceiveEventMap = EventReceiveNames<'VKWebAppInit', 'VKWebAppInitResult', 'VKWebAppInitFailed'> &
EventReceiveNames<'VKWebAppAddToCommunity', 'VKWebAppAddToCommunityResult', 'VKWebAppAddToCommunityFailed'> &
EventReceiveNames<'VKWebAppAddToHomeScreen', 'VKWebAppAddToHomeScreenResult', 'VKWebAppAddToHomeScreenFailed'> &
EventReceiveNames<'VKWebAppAddToHomeScreenInfo', 'VKWebAppAddToHomeScreenInfoResult', 'VKWebAppAddToHomeScreenInfoFailed'> &
EventReceiveNames<
'VKWebAppAllowMessagesFromGroup',
'VKWebAppAllowMessagesFromGroupResult',
Expand All @@ -935,17 +930,6 @@ export type ReceiveEventMap = EventReceiveNames<'VKWebAppInit', 'VKWebAppInitRes
EventReceiveNames<'VKWebAppFlashSetLevel', 'VKWebAppFlashSetLevelResult', 'VKWebAppFlashSetLevelFailed'> &
EventReceiveNames<'VKWebAppGetClientVersion', 'VKWebAppGetClientVersionResult', 'VKWebAppGetClientVersionFailed'> &
EventReceiveNames<'VKWebAppGetCommunityToken', 'VKWebAppGetCommunityTokenResult', 'VKWebAppGetCommunityTokenFailed'> &
EventReceiveNames<
'VKWebAppGetCommunityAuthToken',
'VKWebAppGetCommunityAuthTokenResult',
'VKWebAppGetCommunityAuthTokenFailed'
> &
EventReceiveNames<
'VKWebAppCommunityAccessToken',
'VKWebAppCommunityAccessTokenResult',
'VKWebAppCommunityAccessTokenFailed'
> &
EventReceiveNames<'VKWebAppCommunityToken', 'VKWebAppCommunityTokenResult', 'VKWebAppCommunityTokenFailed'> &
EventReceiveNames<'VKWebAppAudioPause', 'VKWebAppAudioPauseResult', 'VKWebAppAudioPauseFailed'> &
EventReceiveNames<'VKWebAppGetEmail', 'VKWebAppGetEmailResult', 'VKWebAppGetEmailFailed'> &
EventReceiveNames<'VKWebAppGetFriends', 'VKWebAppGetFriendsResult', 'VKWebAppGetFriendsFailed'> &
Expand Down

0 comments on commit f74b154

Please sign in to comment.