@satumjs/async-override
Advanced tools
override async for sandbox
Weekly downloads
Readme
override async for sandbox
// 用于行内代码,生成 fakeUrl 用于缓存等
getFileFakeUrl(fileName:string, appName?:string): string
// 改写 fetch 方法
satumMicroFetchFactory(
data: IMicroApp | { system: IActorSystem, appName?: string },
fetch?: typeof fetch,
): (req: string | RequestInfo, options?: RequestInit) => Promise<Response | undefined>
// 改写 ajax 类
satumMicroFetchFactory(
data: IMicroApp | { system: IActorSystem, appName?: string },
customAjaxClass?: typeof XMLHttpRequest,
): XMLHttpRequest
// 改写 document.createElement 方法
satumMicroCreateElementFactory(
data: IMicroApp | { system: IActorSystem, appName?: string },
createElement?: typeof document.createElement,
fakeWinName?: string, // window 对象上 沙箱的 property
): (tagName: keyof HTMLElementTagNameMap, options?: ElementCreationOptions) => HTMLElement | null