From b9c7c367ef2b03523a82062fd464916858b635bc Mon Sep 17 00:00:00 2001 From: JoelEinbinder Date: Thu, 17 Aug 2017 20:24:11 -0700 Subject: [PATCH] Add Serializable type into the docs (#318) --- docs/api.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api.md b/docs/api.md index 07bbb138..ccb2e82d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -350,8 +350,8 @@ List of all available devices is available in the source code: [DeviceDescriptor #### page.evaluate(pageFunction, ...args) - `pageFunction` <[function]|[string]> Function to be evaluated in the page context -- `...args` Arguments to pass to `pageFunction` -- returns: <[Promise]> Resolves to the return value of `pageFunction` +- `...args` <...[Serializable]> Arguments to pass to `pageFunction` +- returns: <[Promise]<[Serializable]>> Resolves to the return value of `pageFunction` If the function, passed to the `page.evaluate`, returns a [Promise], then `page.evaluate` would wait for the promise to resolve and return it's value. @@ -377,7 +377,7 @@ Shortcut for [page.mainFrame().evaluate(pageFunction, ...args)](#frameevaluatepa #### page.evaluateOnNewDocument(pageFunction, ...args) - `pageFunction` <[function]|[string]> Function to be evaluated in browser context -- `...args` Arguments to pass to `pageFunction` +- `...args` <...[Serializable]> Arguments to pass to `pageFunction` - returns: <[Promise]> Adds a function which would be invoked in one of the following scenarios: @@ -389,7 +389,7 @@ The function is invoked after the document was created but before any of its scr #### page.exposeFunction(name, puppeteerFunction) - `name` <[string]> Name of the function on the window object - `puppeteerFunction` <[function]> Callback function which will be called in Puppeteer's context. -- returns: <[Promise]> Promise which resolves with the result of `puppeteerFunction`. +- returns: <[Promise]> The method adds a function called `name` on the page's `window` object. When called, the function executes `puppeteerFunction` in node.js and returns a [Promise] which resolves to the return value of `puppeteerFunction`. @@ -717,7 +717,7 @@ Shortcut for [page.mainFrame().waitFor(selectorOrFunctionOrTimeout[, options])]( - `raf` - to constantly execute `pageFunction` in `requestAnimationFrame` callback. This is the tightest polling mode which is suitable to observe styling changes. - `mutation` - to execute `pageFunction` on every DOM mutation. - `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). -- `...args` <...[Object]> Arguments to pass to `pageFunction` +- `...args` <...[Serializable]> Arguments to pass to `pageFunction` - returns: <[Promise]> Promise which resolves when element specified by selector string is added to DOM. The `waitForFunction` could be used to observe viewport size change: @@ -958,8 +958,8 @@ Adds a `