@xiaobai-world/api
Advanced tools
Comparing version 0.0.24 to 0.0.25
10
index.ts
@@ -7,3 +7,3 @@ declare global { | ||
import { IContextMenuItem, IWindow } from './src/types' | ||
import { IContextMenuItem } from './src/types' | ||
@@ -36,3 +36,3 @@ /* | ||
*/ | ||
export function mount(render: (selector: string, data: IWindow) => void): Promise<void> { | ||
export function mount(render: (selector: string, appInfo: IXiaobaiWorldMessageData) => void): Promise<void> { | ||
if (!window.xiaobaiApi) { | ||
@@ -48,4 +48,4 @@ return Promise.reject() | ||
} | ||
const id = `#${data.id}` | ||
const node = document.querySelector(id); | ||
const mountPointId = `#${data.mountPointId}` | ||
const node = document.querySelector(mountPointId); | ||
// @ts-ignore: Unreachable code error | ||
@@ -57,3 +57,3 @@ if (!appPackage.name) { | ||
if (node && node.getAttribute('name') === appPackage.name) { | ||
render(id, data.appInfo) | ||
render(mountPointId, data) | ||
} | ||
@@ -60,0 +60,0 @@ } |
{ | ||
"name": "@xiaobai-world/api", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "xiaobai world api", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
export interface IXiaobaiWorldMessageData { | ||
XIAOBAI_EVENT: "XIAOBAI_APP_JAVASCRIPT_ENTRY_LOADED", | ||
id: string, | ||
mountPointId: string, | ||
windowId:string, | ||
name: string, | ||
title: string, | ||
appInfo: IWindow | ||
} | ||
@@ -8,0 +8,0 @@ |
6364