js: declare iosUsingObject option
This commit is contained in:
10
doric-js/lib/src/native/notification.d.ts
vendored
10
doric-js/lib/src/native/notification.d.ts
vendored
@@ -1,17 +1,27 @@
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
export declare function notification(context: BridgeContext): {
|
||||
/**
|
||||
* @param androidSystem: when set true, using global broadcast instead of local broadcast by default
|
||||
* @param iosUsingObject: when set true, using object instead of userInfo by default
|
||||
*/
|
||||
publish: (args: {
|
||||
biz?: string;
|
||||
name: string;
|
||||
data?: object;
|
||||
androidSystem?: boolean;
|
||||
iosUsingObject?: boolean;
|
||||
permission?: string;
|
||||
}) => Promise<any>;
|
||||
/**
|
||||
* @param androidSystem: when set true, using global broadcast instead of local broadcast by default
|
||||
* @param iosUsingObject: when set true, using object instead of userInfo by default
|
||||
*/
|
||||
subscribe: (args: {
|
||||
biz?: string | undefined;
|
||||
name: string;
|
||||
callback: (data?: any) => void;
|
||||
androidSystem?: boolean | undefined;
|
||||
iosUsingObject?: boolean | undefined;
|
||||
permission?: string | undefined;
|
||||
}) => Promise<string>;
|
||||
unsubscribe: (subscribeId: string) => Promise<any>;
|
||||
|
@@ -1,11 +1,19 @@
|
||||
export function notification(context) {
|
||||
return {
|
||||
/**
|
||||
* @param androidSystem: when set true, using global broadcast instead of local broadcast by default
|
||||
* @param iosUsingObject: when set true, using object instead of userInfo by default
|
||||
*/
|
||||
publish: (args) => {
|
||||
if (args.data !== undefined) {
|
||||
args.data = JSON.stringify(args.data);
|
||||
}
|
||||
return context.callNative('notification', 'publish', args);
|
||||
},
|
||||
/**
|
||||
* @param androidSystem: when set true, using global broadcast instead of local broadcast by default
|
||||
* @param iosUsingObject: when set true, using object instead of userInfo by default
|
||||
*/
|
||||
subscribe: (args) => {
|
||||
args.callback = context.function2Id(args.callback);
|
||||
return context.callNative('notification', 'subscribe', args);
|
||||
|
Reference in New Issue
Block a user