Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

zybridge

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zybridge - npm Package Compare versions

Comparing version
2.0.1
to
2.0.2
+47
-2
lib/main.d.ts
declare class Bridge {
static CALL_NAME: string;
/**
* 打开我的徽章页面
*/
openMyBadge(): void;
/**
* 打开邀请好友页面
*/
openInviteFriends(): void;
/**
* 关闭去开启设置的弹框
*/
closeToOpen(): void;
/**
* 打开草坪页
*/
openPersonalHomePage(id: string): void;
/**
* 跳转至系统设置页面
*
*/
openSystemMessage(): void;
/**
* 弹出设置对话框
*
*/
openModal(): void;
/**
* 系统通知是否开启
*
*/
checkPushSwitch(): void;
/**
* 查询徽章
*
* @param id badge_id
*/
checkBadge(id: string): void;
/**
* 去首页
*/
openHomePage(): void;
/**
* 去发布
*/
openPublishPage(): void;
/**
* 打开文章详页

@@ -59,3 +104,3 @@ * @param id 内容id 兼容1.8.1以下

*/
openURL(URL: string, title?: string): void;
openURL(URL: string, title?: string, isShowModal?: boolean): void;
/**

@@ -70,3 +115,3 @@ * 设置 Webview 标题

*/
eventRegisterAsyn(name: string, fn: () => void): void;
eventRegisterAsyn(name: string, fn: (val?: any) => void): void;
/**

@@ -73,0 +118,0 @@ * 事件监听同步步

@@ -7,2 +7,89 @@ import core from './core';

/**
* 打开我的徽章页面
*/
Bridge.prototype.openMyBadge = function () {
return this.openPage({
pageType: PageType.OPEN_MY_BADGE
});
};
/**
* 打开邀请好友页面
*/
Bridge.prototype.openInviteFriends = function () {
return this.openPage({
pageType: PageType.OPEN_INVITE_FRIENDS
});
};
/**
* 关闭去开启设置的弹框
*/
Bridge.prototype.closeToOpen = function () {
return this.call({
actionType: ActionType.CLOST_TO_OPEN
});
};
/**
* 打开草坪页
*/
Bridge.prototype.openPersonalHomePage = function (id) {
return this.openPage({
pageType: PageType.PERSONAL_HOME_PAGE,
args: { id: id }
});
};
/**
* 跳转至系统设置页面
*
*/
Bridge.prototype.openSystemMessage = function () {
return this.call({
actionType: ActionType.OPEN_SYSTEM_MESSAGE
});
};
/**
* 弹出设置对话框
*
*/
Bridge.prototype.openModal = function () {
return this.call({
actionType: ActionType.OPEN_MODAL
});
};
/**
* 系统通知是否开启
*
*/
Bridge.prototype.checkPushSwitch = function () {
return this.call({
actionType: ActionType.CHECK_PUSH_SWITCH
});
};
/**
* 查询徽章
*
* @param id badge_id
*/
Bridge.prototype.checkBadge = function (id) {
return this.call({
actionType: ActionType.CHECK_BADGE,
options: { id: id }
});
};
/**
* 去首页
*/
Bridge.prototype.openHomePage = function () {
return this.openPage({
pageType: PageType.HOME_PAGE
});
};
/**
* 去发布
*/
Bridge.prototype.openPublishPage = function () {
return this.openPage({
pageType: PageType.PUBLISH_PAGE
});
};
/**
* 打开文章详页

@@ -108,6 +195,6 @@ * @param id 内容id 兼容1.8.1以下

*/
Bridge.prototype.openURL = function (URL, title) {
Bridge.prototype.openURL = function (URL, title, isShowModal) {
return this.call({
actionType: ActionType.OPEN_URL,
options: { URL: URL, title: title }
options: { URL: URL, title: title, isShowModal: isShowModal }
});

@@ -114,0 +201,0 @@ };

@@ -10,3 +10,8 @@ export declare enum PageType {

PRODUCT_COMMENT_PAGE = 7,
REFUND_DETAILS_PAGE = 8
REFUND_DETAILS_PAGE = 8,
HOME_PAGE = 9,
PUBLISH_PAGE = 10,
PERSONAL_HOME_PAGE = 11,
OPEN_INVITE_FRIENDS = 12,
OPEN_MY_BADGE = 13
}

@@ -17,3 +22,8 @@ export declare enum ActionType {

SET_TITLE = 2,
CLOSE = 3
CLOSE = 3,
CHECK_BADGE = 4,
CHECK_PUSH_SWITCH = 5,
OPEN_MODAL = 6,
OPEN_SYSTEM_MESSAGE = 7,
CLOST_TO_OPEN = 8
}

@@ -35,2 +45,3 @@ export interface IOpenPageOptions {

title?: string;
isShowModal?: boolean;
};

@@ -47,3 +58,21 @@ }

}
export declare type ICallParams = IOpenURLParams | IOpenPageParams | ICloseParams | ISetTitleParams;
export interface ICheckBadgeParams {
actionType: ActionType.CHECK_BADGE;
options: {
id: string;
};
}
export interface ICheckPushSwitchParams {
actionType: ActionType.CHECK_PUSH_SWITCH;
}
export interface IOpenModal {
actionType: ActionType.OPEN_MODAL;
}
export interface IOpenSystemParams {
actionType: ActionType.OPEN_SYSTEM_MESSAGE;
}
export interface ICloseToOpenParams {
actionType: ActionType.CLOST_TO_OPEN;
}
export declare type ICallParams = IOpenURLParams | IOpenPageParams | ICloseParams | ISetTitleParams | ICheckBadgeParams | ICheckPushSwitchParams | IOpenModal | IOpenSystemParams | ICloseToOpenParams;
export declare type IBaseResp = {

@@ -50,0 +79,0 @@ status: true;

@@ -12,2 +12,7 @@ export var PageType;

PageType[PageType["REFUND_DETAILS_PAGE"] = 8] = "REFUND_DETAILS_PAGE";
PageType[PageType["HOME_PAGE"] = 9] = "HOME_PAGE";
PageType[PageType["PUBLISH_PAGE"] = 10] = "PUBLISH_PAGE";
PageType[PageType["PERSONAL_HOME_PAGE"] = 11] = "PERSONAL_HOME_PAGE";
PageType[PageType["OPEN_INVITE_FRIENDS"] = 12] = "OPEN_INVITE_FRIENDS";
PageType[PageType["OPEN_MY_BADGE"] = 13] = "OPEN_MY_BADGE";
})(PageType || (PageType = {}));

@@ -20,2 +25,7 @@ export var ActionType;

ActionType[ActionType["CLOSE"] = 3] = "CLOSE";
ActionType[ActionType["CHECK_BADGE"] = 4] = "CHECK_BADGE";
ActionType[ActionType["CHECK_PUSH_SWITCH"] = 5] = "CHECK_PUSH_SWITCH";
ActionType[ActionType["OPEN_MODAL"] = 6] = "OPEN_MODAL";
ActionType[ActionType["OPEN_SYSTEM_MESSAGE"] = 7] = "OPEN_SYSTEM_MESSAGE";
ActionType[ActionType["CLOST_TO_OPEN"] = 8] = "CLOST_TO_OPEN";
})(ActionType || (ActionType = {}));
+1
-1
{
"name": "zybridge",
"version": "2.0.1",
"version": "2.0.2",
"main": "lib/main.js",

@@ -5,0 +5,0 @@ "typings": "lib/main.d.ts",