import * as puppeteer from "puppeteer" ; import { Instagram , TFullApiPost , TPost , TSearchResult , TSinglePost } from ".." ; export type DType = TPost | TSinglePost | TFullApiPost | TSearchResult ; export interface IPluginContext < Plugin , PostType > { plugin : Plugin ; state : Instagram < PostType > ; } export interface IPlugin < PostType > { constructionEvent ? ( this ) : void ; requestEvent ? ( this , req , overrides ) : Promise < void > ; responseEvent ? ( this , res , data ) : Promise < void > ; postPageEvent ? ( this , data ) : Promise < void > ; graftingEvent ? ( this ) : Promise < void > ; } export enum AsyncPluginEvents { browser , grafting , postPage , request , response } export type AsyncPluginEventsType = keyof typeof AsyncPluginEvents ; export enum SyncPluginEvents { construction } export type SyncPluginEventsType = keyof typeof SyncPluginEvents ; export type PluginEventsType = SyncPluginEventsType | AsyncPluginEventsType ;