feat:add toast bridge
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
*/
|
||||
export * from 'reflect-metadata'
|
||||
|
||||
export type BridgeContext = { [index: string]: { [index: string]: (args?: any) => Promise<any> } }
|
||||
|
||||
declare global {
|
||||
const context: { [index: string]: { [index: string]: (args?: any) => Promise<any> } };
|
||||
const context: BridgeContext
|
||||
function Entry(constructor: { new(...args: any[]): {} }): any
|
||||
}
|
||||
export { }
|
11
js-framework/src/util/modal.ts
Normal file
11
js-framework/src/util/modal.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
|
||||
|
||||
|
||||
export function modal(context: BridgeContext) {
|
||||
return {
|
||||
toast: (msg: string) => {
|
||||
context.modal.toast({ msg })
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user