import type IDatastoreCoreConfigureOptions from '@ulixee/datastore-core/interfaces/IDatastoreCoreConfigureOptions'; import type IExtractorRunOptions from '@ulixee/datastore/interfaces/IExtractorRunOptions'; import type IExtractorSchema from '@ulixee/datastore/interfaces/IExtractorSchema'; import { ConnectionToClient, ConnectionToCore } from '@ulixee/net'; export interface ICacheUpdates { [sessionId: string]: { action: 'cached' | 'evicted'; crawler: string; }; } export default interface IExtractorPluginCore { name: string; version: string; nodeVmRequireWhitelist?: string[]; registerHostedServices?(connectionToClient: ConnectionToClient): void; onCoreStart?(coreConfiguration: IDatastoreCoreConfigureOptions, options?: { createConnectionToServiceHost: (host: string) => ConnectionToCore; getSystemCore: (name: string) => any; }): void | Promise; beforeRunExtractor?(options: IExtractorRunOptions, runtime?: { scriptEntrypoint: string; functionName: string; }): void | Promise; afterRunExtractor?(options: IExtractorRunOptions, output: ISchema['output'], cacheUpdates: ICacheUpdates, runtime?: { scriptEntrypoint: string; functionName: string; }): void | Promise; onCoreClose?(): void | Promise; }