interface SendMessageData {
    code: string
    data: any | null
}
const tool = {
    
    sendMessage2App: (msg: SendMessageData, callback: Function | null = null) => {
        window.top.jsonRenderMessager?.sendMessage2App(msg, callback)
    },
    
    getIframeInfo: ()=>{
        let iframeDoc: any = null
        const iframeNode = window.top.document.querySelector('iframe')
        if(iframeNode){
            iframeDoc = iframeNode.contentDocument || iframeNode.contentWindow?.document
        }
        return [iframeDoc, iframeNode]
    }
}
export default tool