@ekidpro/bridge
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -6,5 +6,6 @@ export interface ResponseType<Channel, DataType> { | ||
} | ||
export interface RequestType<Channel> { | ||
export interface RequestType<Channel, Extra = void> { | ||
id: string; | ||
channel: Channel; | ||
data?: Extra; | ||
} |
@@ -29,1 +29,12 @@ import { ResponseType, RequestType } from './base-type'; | ||
export declare type GetDeviceInfoResponse = ResponseType<typeof GetDeviceInfoChannel, DeviceInfo>; | ||
export declare const SetStatusBarChannel = "CHANNEL_SET_STATUS_BAR"; | ||
export declare type StatusBarType = 'default' | 'light-content' | 'dark-content'; | ||
export declare type SetStatusBarRequest = RequestType<typeof SetStatusBarChannel, StatusBarType>; | ||
export declare type SetStatusBarResponse = ResponseType<typeof SetStatusBarChannel, StatusBarType>; | ||
export declare const SetBackButtonStatusChannel = "CHANNEL_SET_BACK_BUTTON_STATUS"; | ||
export declare type BackButtonStatus = 'show' | 'hidden'; | ||
export declare type SetBackButtonStatusRequest = RequestType<typeof SetBackButtonStatusChannel, BackButtonStatus>; | ||
export declare type SetBackButtonStatusResponse = ResponseType<typeof SetBackButtonStatusChannel, BackButtonStatus>; | ||
export declare const GoBackChannel = "CHANNEL_NAVIGATION_GO_BACK"; | ||
export declare type SetNavigationGoBackRequest = RequestType<typeof GoBackChannel>; | ||
export declare type SetNavigationGoBackResponse = ResponseType<typeof GoBackChannel, boolean>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GetDeviceInfoChannel = void 0; | ||
exports.GoBackChannel = exports.SetBackButtonStatusChannel = exports.SetStatusBarChannel = exports.GetDeviceInfoChannel = void 0; | ||
exports.GetDeviceInfoChannel = 'CHANNEL_GET_DEVICE_INFO'; | ||
exports.SetStatusBarChannel = 'CHANNEL_SET_STATUS_BAR'; | ||
exports.SetBackButtonStatusChannel = 'CHANNEL_SET_BACK_BUTTON_STATUS'; | ||
exports.GoBackChannel = 'CHANNEL_NAVIGATION_GO_BACK'; | ||
//# sourceMappingURL=device-info.js.map |
@@ -1,6 +0,6 @@ | ||
import { GetDeviceInfoRequest, GetDeviceInfoResponse } from './device-info'; | ||
import { GetDeviceInfoRequest, GetDeviceInfoResponse, SetBackButtonStatusRequest, SetBackButtonStatusResponse, SetStatusBarRequest, SetStatusBarResponse, SetNavigationGoBackRequest, SetNavigationGoBackResponse } from './device-info'; | ||
import { GetUserInfoRequest, GetUserInfoResponse } from './user-info'; | ||
import { ScanQRRequest, ScanQRResponse } from './scan-qr'; | ||
export declare type Request = GetDeviceInfoRequest | GetUserInfoRequest | ScanQRRequest; | ||
export declare type Response = GetDeviceInfoResponse | GetUserInfoResponse | ScanQRResponse; | ||
export declare type Request = GetDeviceInfoRequest | GetUserInfoRequest | ScanQRRequest | SetBackButtonStatusRequest | SetStatusBarRequest | SetNavigationGoBackRequest; | ||
export declare type Response = GetDeviceInfoResponse | GetUserInfoResponse | ScanQRResponse | SetBackButtonStatusResponse | SetStatusBarResponse | SetNavigationGoBackResponse; | ||
export { RequestType, ResponseType } from './base-type'; | ||
@@ -7,0 +7,0 @@ export * from './device-info'; |
@@ -1,2 +0,5 @@ | ||
import { DeviceInfo } from '../../types'; | ||
import { DeviceInfo, StatusBarType, BackButtonStatus } from '../../types'; | ||
export declare const getDeviceInfo: () => Promise<DeviceInfo>; | ||
export declare const setStatusBarStyle: (input: StatusBarType) => Promise<StatusBarType>; | ||
export declare const setButtonStatus: (input: BackButtonStatus) => Promise<BackButtonStatus>; | ||
export declare const goBack: () => Promise<boolean>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDeviceInfo = void 0; | ||
exports.goBack = exports.setButtonStatus = exports.setStatusBarStyle = exports.getDeviceInfo = void 0; | ||
const controller_1 = require("../controller"); | ||
@@ -20,2 +20,28 @@ const uuid_1 = require("uuid"); | ||
}; | ||
exports.setStatusBarStyle = async (input) => { | ||
const data = await controller_1.controller.request({ | ||
id: uuid_1.v4(), | ||
channel: types_1.SetStatusBarChannel, | ||
data: input, | ||
}); | ||
const tmp = data.data; | ||
return tmp; | ||
}; | ||
exports.setButtonStatus = async (input) => { | ||
const data = await controller_1.controller.request({ | ||
id: uuid_1.v4(), | ||
channel: types_1.SetBackButtonStatusChannel, | ||
data: input, | ||
}); | ||
const tmp = data.data; | ||
return tmp; | ||
}; | ||
exports.goBack = async () => { | ||
const data = await controller_1.controller.request({ | ||
id: uuid_1.v4(), | ||
channel: types_1.GoBackChannel, | ||
}); | ||
const tmp = data.data; | ||
return tmp; | ||
}; | ||
//# sourceMappingURL=device-info.js.map |
@@ -5,2 +5,5 @@ declare const _default: { | ||
scanQr: () => Promise<string>; | ||
setButtonStatus: (input: import("../..").BackButtonStatus) => Promise<import("../..").BackButtonStatus>; | ||
setStatusBarStyle: (input: import("../..").StatusBarType) => Promise<import("../..").StatusBarType>; | ||
goBack: () => Promise<boolean>; | ||
}; | ||
@@ -7,0 +10,0 @@ userinfo: { |
@@ -10,2 +10,5 @@ "use strict"; | ||
scanQr: scan_qr_1.scanQr, | ||
setButtonStatus: device_info_1.setButtonStatus, | ||
setStatusBarStyle: device_info_1.setStatusBarStyle, | ||
goBack: device_info_1.goBack, | ||
}, | ||
@@ -12,0 +15,0 @@ userinfo: { |
@@ -15,2 +15,3 @@ import { Listener } from './listener'; | ||
}; | ||
deeplink?: string; | ||
}; | ||
@@ -17,0 +18,0 @@ webkitRTCPeerConnection: any; |
{ | ||
"name": "@ekidpro/bridge", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Bridge between ekidpro app with website", | ||
@@ -27,5 +27,2 @@ "homepage": "https://github.com/ekidpro-vn/bridge", | ||
"fix": "gts fix", | ||
"prepare": "npm run compile", | ||
"pretest": "npm run compile", | ||
"posttest": "npm run check", | ||
"watch": "tsc -w" | ||
@@ -49,6 +46,4 @@ }, | ||
"qrcode.react": "^1.0.0", | ||
"react": "^16.11.0", | ||
"react-router-dom": "^5.2.0", | ||
"uuid": "^8.1.0" | ||
} | ||
} | ||
} |
@@ -49,13 +49,13 @@ ![ekidpro](./documents/image.png 'eKidPro Logo') | ||
``` | ||
$ npm run build | ||
``` | ||
$ npm run build | ||
OR | ||
OR | ||
$ yarn build | ||
``` | ||
$ yarn build | ||
``` | ||
Sau đó zip folder build rồi up lên CMS | ||
Sau đó zip folder build rồi up lên CMS | ||
// TODO: Hướng dẫn up build lên cms | ||
// TODO: Hướng dẫn up build lên cms | ||
@@ -86,10 +86,10 @@ ## Cài đặt SDK | ||
```js | ||
import { controller } from '@ekidpro/web' | ||
... | ||
controller.start() | ||
import { controller } from '@ekidpro/web' | ||
... | ||
controller.start() | ||
... | ||
controller.stop() | ||
... | ||
controller.stop() | ||
... | ||
... | ||
``` | ||
@@ -100,9 +100,9 @@ | ||
``` | ||
useEffect(() => { | ||
controller.start(); | ||
useEffect(() => { | ||
controller.start(); | ||
return () => { | ||
controller.stop(); | ||
}; | ||
}, []); | ||
return () => { | ||
controller.stop(); | ||
}; | ||
}, []); | ||
``` | ||
@@ -131,15 +131,15 @@ | ||
``` | ||
useEffect(() => { | ||
const listener = Listener.start(); | ||
useEffect(() => { | ||
const listener = Listener.start(); | ||
listener.onNetworkChange = (e) => { | ||
console.log(e); | ||
}; | ||
listener.onNetworkChange = (e) => { | ||
console.log(e); | ||
}; | ||
listener.onOrientationChange = (e) => { | ||
console.log(e); | ||
}; | ||
listener.onOrientationChange = (e) => { | ||
console.log(e); | ||
}; | ||
return () => listener.stop(); | ||
}, []); | ||
return () => listener.stop(); | ||
}, []); | ||
``` | ||
@@ -155,6 +155,12 @@ | ||
- command.user.getUserInfo() => Promise<UserInfo> | ||
- command.userinfo.getUserInfo() => Promise<UserInfo> | ||
- command.user.scanQr() => Promise<string> | ||
- command.userinfo.scanQr() => Promise<string> | ||
- // TODO: getUserInfo() | ||
- command.device.setButtonStatus() => Promise<'show' | 'hidden'> | ||
- command.device.setStatusBarStyle() => Promise<'default' | 'light-content' | 'dark-content'> | ||
- command.device.goBack() => Promise<boolean> | ||
* // TODO: getUserInfo() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38663
4
595
162
+ Addedreact@16.11.0(transitive)
- Removedreact@^16.11.0
- Removedreact-router-dom@^5.2.0
- Removedreact@16.14.0(transitive)