@letsscrapedata/controller 0.0.65 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -7,6 +7,7 @@ import { LogFunction } from '@letsscrapedata/utils';
7
7
  import { Serializable as Serializable$1 } from 'child_process';
8
8
 
9
9
  type BrowserControllerType = "playwright" | "puppeteer" | "patchright" | "camoufox";
10
+ type PlaywrightBrowserControllerType = "playwright" | "patchright" | "camoufox";
10
11
  type AllBrowser = Browser | Browser$1 | Browser$2;
11
12
  type AllBrowserContext = BrowserContext | BrowserContext$1 | BrowserContext$2;
12
13
  type AllElement = Locator | ElementHandle | Locator$1;
@@ -20,6 +21,41 @@ type BrowserCreationMethod = "launch" | "connect";
20
21
  type BrowserContextCreationMethod = "launch" | "new";
21
22
  type BrowserContextStatus = "free" | "busy" | "closed";
22
23
  type LsdBrowserType = "chromium" | "firefox" | "webkit";
24
+ /**
25
+ * events emittd by controllers, such as playwright
26
+ */
27
+ declare enum ControllerEvent {
28
+ BROWSERCONTEXT_CLOSE = "close",
29
+ BROWSERCONTEXT_PAGE = "page",// PlaywrightBrowserControllerType
30
+ BROWSERCONTEXT_TARGETCREATED = "targetcreated",// puppeteer
31
+ BROWSER_DISCONNECTED = "disconnected",
32
+ PAGE_CLOSE = "close",
33
+ PAGE_POUP = "popup",
34
+ PAGE_REQUEST = "request",// puppeteer (use route in playwright)
35
+ PAGE_RESPONSE = "response"
36
+ }
37
+ /**
38
+ * user could listen to them if needed
39
+ ** eventData: LsdPage
40
+ */
41
+ declare enum LsdPageEvent {
42
+ PAGE_CLOSE = "pageClose",
43
+ PAGE_POPUP = "pagePopup"
44
+ }
45
+ /**
46
+ * listened by LsdBrowserContext; user does NOT need to listen to them
47
+ ** eventData: LsdPage
48
+ */
49
+ declare enum LsdBrowserContextEvent {
50
+ PAGE_CLOSE = "pageClose"
51
+ }
52
+ /**
53
+ * listened by LsdBrowser; user does NOT need to listen to them
54
+ ** eventData: LsdBrowserContext
55
+ */
56
+ declare enum LsdBrowserEvent {
57
+ BROWSER_CONTEXT_CLOSE = "browserContextClose"
58
+ }
23
59
  interface BrowserContextRequirements {
24
60
  browserControllerTypes: BrowserControllerType[];
25
61
  browserTypes: LsdBrowserType[];
@@ -930,7 +966,6 @@ interface WaitNavigationOptions {
930
966
  */
931
967
  waitUntil?: NavigationWaitUntil;
932
968
  }
933
- type PageEvent = "pageClose" | "pagePopup";
934
969
  interface LsdPage extends EventEmitter {
935
970
  /**
936
971
  * Adds a script which would be evaluated in one of the following scenarios:
@@ -1674,4 +1709,4 @@ declare class LsdBrowserController implements LsdBrowserController$1 {
1674
1709
  }
1675
1710
  declare const controller: LsdBrowserController;
1676
1711
 
1677
- export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageEvent, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
1712
+ export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, ControllerEvent, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, LsdBrowserContextEvent, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, LsdBrowserEvent, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, LsdPageEvent, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserControllerType, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import { LogFunction } from '@letsscrapedata/utils';
7
7
  import { Serializable as Serializable$1 } from 'child_process';
8
8
 
9
9
  type BrowserControllerType = "playwright" | "puppeteer" | "patchright" | "camoufox";
10
+ type PlaywrightBrowserControllerType = "playwright" | "patchright" | "camoufox";
10
11
  type AllBrowser = Browser | Browser$1 | Browser$2;
11
12
  type AllBrowserContext = BrowserContext | BrowserContext$1 | BrowserContext$2;
12
13
  type AllElement = Locator | ElementHandle | Locator$1;
@@ -20,6 +21,41 @@ type BrowserCreationMethod = "launch" | "connect";
20
21
  type BrowserContextCreationMethod = "launch" | "new";
21
22
  type BrowserContextStatus = "free" | "busy" | "closed";
22
23
  type LsdBrowserType = "chromium" | "firefox" | "webkit";
24
+ /**
25
+ * events emittd by controllers, such as playwright
26
+ */
27
+ declare enum ControllerEvent {
28
+ BROWSERCONTEXT_CLOSE = "close",
29
+ BROWSERCONTEXT_PAGE = "page",// PlaywrightBrowserControllerType
30
+ BROWSERCONTEXT_TARGETCREATED = "targetcreated",// puppeteer
31
+ BROWSER_DISCONNECTED = "disconnected",
32
+ PAGE_CLOSE = "close",
33
+ PAGE_POUP = "popup",
34
+ PAGE_REQUEST = "request",// puppeteer (use route in playwright)
35
+ PAGE_RESPONSE = "response"
36
+ }
37
+ /**
38
+ * user could listen to them if needed
39
+ ** eventData: LsdPage
40
+ */
41
+ declare enum LsdPageEvent {
42
+ PAGE_CLOSE = "pageClose",
43
+ PAGE_POPUP = "pagePopup"
44
+ }
45
+ /**
46
+ * listened by LsdBrowserContext; user does NOT need to listen to them
47
+ ** eventData: LsdPage
48
+ */
49
+ declare enum LsdBrowserContextEvent {
50
+ PAGE_CLOSE = "pageClose"
51
+ }
52
+ /**
53
+ * listened by LsdBrowser; user does NOT need to listen to them
54
+ ** eventData: LsdBrowserContext
55
+ */
56
+ declare enum LsdBrowserEvent {
57
+ BROWSER_CONTEXT_CLOSE = "browserContextClose"
58
+ }
23
59
  interface BrowserContextRequirements {
24
60
  browserControllerTypes: BrowserControllerType[];
25
61
  browserTypes: LsdBrowserType[];
@@ -930,7 +966,6 @@ interface WaitNavigationOptions {
930
966
  */
931
967
  waitUntil?: NavigationWaitUntil;
932
968
  }
933
- type PageEvent = "pageClose" | "pagePopup";
934
969
  interface LsdPage extends EventEmitter {
935
970
  /**
936
971
  * Adds a script which would be evaluated in one of the following scenarios:
@@ -1674,4 +1709,4 @@ declare class LsdBrowserController implements LsdBrowserController$1 {
1674
1709
  }
1675
1710
  declare const controller: LsdBrowserController;
1676
1711
 
1677
- export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageEvent, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };
1712
+ export { type AllApiRequestContext, type AllBrowser, type AllBrowserContext, type AllElement, type AllElementHandle, type AllFrame, type AllPage, type AllResponse, type BrowserContextCreationMethod, type BrowserContextRequirements, type BrowserContextStatus, type BrowserControllerType, type BrowserCreationMethod, type BrowserLaunchMethod, type BrowserStateData, CheerioElement, type CheerioNode, CheerioPage, type ClientCertificate, ControllerEvent, type CookieItem, type FrameAddScriptTagOptions, type GotoOptions, type IframeOption, type InputOptions, type KeyInput, type KeyPressOptions, type LocalStorageItem, type LocalStorageOrigin, type LowerCasePaperFormat, type LsdApiContext, type LsdApiContextOptions, type LsdApiResponse, type LsdBrowser, type LsdBrowserContext, LsdBrowserContextEvent, type LsdBrowserContextOptions, type LsdBrowserController$1 as LsdBrowserController, LsdBrowserEvent, type LsdBrowserType, type LsdConnectOptions, type LsdElement, type LsdFetchOptions, type LsdLaunchOptions, type LsdPage, LsdPageEvent, type MouseClickOptions, type MouseClickType, type NavigationWaitUntil, type PDFMargin, type PDFOptions, type PageExtInPatchright, type PageExtInPlaywright, type PageExtInPuppeteer, type PageInfo, type PageMouseClickOptions, type PageOpenType, type PageStatus, type PaperFormat, type PatchrightBrowserTypes, PlaywrightBrowser, PlaywrightBrowserContext, type PlaywrightBrowserControllerType, type PlaywrightBrowserTypes, PlaywrightElement, PlaywrightPage, type ProxyInController, PuppeteerBrowser, PuppeteerBrowserContext, PuppeteerElement, PuppeteerPage, type RequestInterceptionAction, type RequestInterceptionOption, type RequestMatch, type RequestMethod, type RequestResourceType, type ResponseHandler, type ResponseHandlerOptions, type ResponseInterceptionItem, type ResponseInterceptionOption, type ResponseMatch, type ResponsePageData, type ScreenshotOptions, type SelectOptions, type UpdatablePageInfo, type ViewportSize, type WaitElementOptions, type WaitElementState, type WaitNavigationOptions, controller, setControllerLogFun };