@tstdl/base 0.87.3 → 0.87.4

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.
@@ -16,6 +16,8 @@ export declare class DocumentController<T extends Page | Frame = Page | Frame> e
16
16
  readonly context: BrowserContextController;
17
17
  readonly options: DocumentControllerOptions;
18
18
  constructor(document: T, context: BrowserContextController, options: DocumentControllerOptions);
19
+ evaluate<R, A>(fn: string | ((argument: A) => R | Promise<R>), argument: A): Promise<R>;
20
+ evaluate<R, A>(fn: string | ((argument?: A) => R | Promise<R>), argument?: A): Promise<R>;
19
21
  frames(): FrameController[];
20
22
  /**
21
23
  * Get a controller for the frame.
@@ -42,6 +42,9 @@ class DocumentController extends import_locator_controller.LocatorController {
42
42
  this.context = context;
43
43
  this.options = options;
44
44
  }
45
+ async evaluate(fn, argument) {
46
+ return this.document.evaluate(fn, argument);
47
+ }
45
48
  frames() {
46
49
  const frames = (0, import_utils.isPage)(this.document) ? this.document.frames() : this.document.childFrames();
47
50
  return frames.map((page) => this.getControllerByFrame(page));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.87.3",
3
+ "version": "0.87.4",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"