UNPKG

@lynx-js/web-core

Version:

This is an internal experimental package, do not use

31 lines (30 loc) 1.9 kB
import { type RpcCallType } from '@lynx-js/web-worker-rpc'; import { postTimingFlagsEndpoint, publicComponentEventEndpoint, publishEventEndpoint, sendGlobalEventEndpoint, dispatchI18nResourceEndpoint, updateDataEndpoint, updateGlobalPropsEndpoint, updateBTSChunkEndpoint } from '../endpoints.js'; import type { Cloneable, NapiModulesMap, NativeModulesMap } from '../../types/index.js'; import { LynxCrossThreadContext } from '../LynxCrossThreadContext.js'; import { type LynxViewInstance } from './LynxViewInstance.js'; export declare class BackgroundThread implements AsyncDisposable { #private; static contextIdToBackgroundWorker: ({ worker: Worker; runningCards: number; } | undefined)[]; readonly jsContext: LynxCrossThreadContext; readonly postTimingFlags: RpcCallType<typeof postTimingFlagsEndpoint>; readonly sendGlobalEvent: RpcCallType<typeof sendGlobalEventEndpoint>; readonly publicComponentEvent: RpcCallType<typeof publicComponentEventEndpoint>; readonly publishEvent: RpcCallType<typeof publishEventEndpoint>; readonly dispatchI18nResource: RpcCallType<typeof dispatchI18nResourceEndpoint>; readonly updateData: RpcCallType<typeof updateDataEndpoint>; readonly updateGlobalProps: RpcCallType<typeof updateGlobalPropsEndpoint>; readonly updateBTSChunk: RpcCallType<typeof updateBTSChunkEndpoint>; constructor(lynxGroupId: number | undefined, lynxViewInstance: LynxViewInstance); startWebWorker(initData: Cloneable, globalProps: Cloneable, cardType: string, customSections: Record<string, Cloneable>, nativeModulesMap: NativeModulesMap, napiModulesMap: NapiModulesMap): void; startBTS(): void; markTiming(timingKey: string, pipelineId?: string, timeStamp?: number): void; /** * Flush the timing info immediately. */ flushTimingInfo(): void; [Symbol.asyncDispose](): Promise<void>; }