UNPKG

@lastos/page-spy-plugin-mp-data-harbor

Version:
42 lines (41 loc) 1.56 kB
import type { SpyMessage, PageSpyPlugin, PluginOrder } from '@lastos/page-spy-types'; import { type Client, type SocketStoreBase, type MPPluginInitParams } from '@lastos/page-spy-mp-base'; import { InitConfigBase } from '@lastos/page-spy-base'; import { MemoryHarbor } from './harbor/memoryHarbor'; import { DataType, WholeActionParams } from './harbor/base'; interface DataHarborConfig { caredData?: Record<DataType, boolean>; filename?: () => string; onAfterUpload?: (replayUrl: string) => void; } export default class MPDataHarborPlugin implements PageSpyPlugin { enforce: PluginOrder; name: string; harbor: MemoryHarbor; apiBase: string; isPaused: boolean; $socketStore: SocketStoreBase | null; $pageSpyConfig: InitConfigBase | null; $harborConfig: Required<DataHarborConfig>; client: Client | null; static hasInited: boolean; constructor(config?: DataHarborConfig); onInit({ socketStore, config, client, mp, }: MPPluginInitParams<InitConfigBase>): Promise<void>; onActionSheet(): { text: string; action: () => Promise<void>; }[]; upload(params?: WholeActionParams): Promise<string>; onReset(): void; pause(): void; resume(): void; reharbor(): void; isCaredPublicData(message: SpyMessage.MessageItem): boolean; protected makeMetaInfo(): { type: string; timestamp: number; data: import("@lastos/page-spy-types/lib/client").DataItem | undefined; }; getDebugUrl(result: H.UploadResult | null): string; } export {};