Fill doc with stubs for missing documentation methods.

This patch fills doc with stubs so that the command `npm run doc`
does not complain.
This commit is contained in:
Andrey Lushnikov 2017-07-07 10:34:35 -07:00
parent 07963ec3f1
commit aa5419a577
2 changed files with 67 additions and 53 deletions

View File

@ -12,11 +12,13 @@
* [browser.version()](#browserversion) * [browser.version()](#browserversion)
- [class: Page](#class-page) - [class: Page](#class-page)
* [page.addScriptTag(url)](#pageaddscripttagurl) * [page.addScriptTag(url)](#pageaddscripttagurl)
* [page.click()](#pageclick)
* [page.close()](#pageclose) * [page.close()](#pageclose)
* [page.evaluate(fun, args)](#pageevaluatefun-args) * [page.evaluate(fun, args)](#pageevaluatefun-args)
* [page.evaluateOnInitialized(fun, args)](#pageevaluateoninitializedfun-args) * [page.evaluateOnInitialized(fun, args)](#pageevaluateoninitializedfun-args)
* [page.httpHeaders()](#pagehttpheaders) * [page.focus()](#pagefocus)
* [page.frames()](#pageframes) * [page.frames()](#pageframes)
* [page.httpHeaders()](#pagehttpheaders)
* [page.injectFile(filePath)](#pageinjectfilefilepath) * [page.injectFile(filePath)](#pageinjectfilefilepath)
* [page.mainFrame()](#pagemainframe) * [page.mainFrame()](#pagemainframe)
* [page.navigate(url)](#pagenavigateurl) * [page.navigate(url)](#pagenavigateurl)
@ -30,6 +32,7 @@
* [page.setUserAgent(userAgent)](#pagesetuseragentuseragent) * [page.setUserAgent(userAgent)](#pagesetuseragentuseragent)
* [page.setViewportSize(size)](#pagesetviewportsizesize) * [page.setViewportSize(size)](#pagesetviewportsizesize)
* [page.title()](#pagetitle) * [page.title()](#pagetitle)
* [page.type()](#pagetype)
* [page.url()](#pageurl) * [page.url()](#pageurl)
* [page.userAgent()](#pageuseragent) * [page.userAgent()](#pageuseragent)
* [page.viewportSize()](#pageviewportsize) * [page.viewportSize()](#pageviewportsize)
@ -47,19 +50,28 @@
* [frame.securityOrigin()](#framesecurityorigin) * [frame.securityOrigin()](#framesecurityorigin)
* [frame.url()](#frameurl) * [frame.url()](#frameurl)
- [class: Request](#class-request) - [class: Request](#class-request)
* [new Request()](#new-request) * [request.response()](#requestresponse)
* [request.abort()](#requestabort) - [class: Response](#class-response)
* [request.continue()](#requestcontinue) * [response.request()](#responserequest)
* [request.handled()](#requesthandled) - [class: InterceptedRequest](#class-interceptedrequest)
* [request.headers()](#requestheaders) * [interceptedRequest.abort()](#interceptedrequestabort)
* [request.method()](#requestmethod) * [interceptedRequest.continue()](#interceptedrequestcontinue)
* [request.method()](#requestmethod-1) * [interceptedRequest.isHandled()](#interceptedrequestishandled)
* [request.postData()](#requestpostdata) - [class: Headers](#class-headers)
* [request.setHeader()](#requestsetheader) * [headers.append()](#headersappend)
* [request.setMethod()](#requestsetmethod) * [headers.delete()](#headersdelete)
* [request.setPostData()](#requestsetpostdata) * [headers.entries()](#headersentries)
* [request.setUrl()](#requestseturl) * [headers.get()](#headersget)
* [request.url()](#requesturl) * [headers.has()](#headershas)
* [headers.keys()](#headerskeys)
* [headers.set()](#headersset)
* [headers.values()](#headersvalues)
- [class: Body](#class-body)
* [body.arrayBuffer()](#bodyarraybuffer)
* [body.bodyUsed()](#bodybodyused)
* [body.buffer()](#bodybuffer)
* [body.json()](#bodyjson)
* [body.text()](#bodytext)
<!-- tocstop --> <!-- tocstop -->
@ -113,6 +125,8 @@ Pages could be closed by `page.close()` method.
- `url` <[string]> Url of a script to be added - `url` <[string]> Url of a script to be added
- returns: <[Promise]> Promise which resolves as the script gets added and loads. - returns: <[Promise]> Promise which resolves as the script gets added and loads.
#### page.click()
#### page.close() #### page.close()
- returns: <[Promise]> Returns promise which resolves when page gets closed. - returns: <[Promise]> Returns promise which resolves when page gets closed.
@ -129,13 +143,15 @@ Pages could be closed by `page.close()` method.
- `args` <[Array]<[string]>> Arguments to pass to `fun` - `args` <[Array]<[string]>> Arguments to pass to `fun`
- returns: <[Promise]<[Object]>> Promise which resolves to function - returns: <[Promise]<[Object]>> Promise which resolves to function
#### page.focus()
#### page.frames()
#### page.httpHeaders() #### page.httpHeaders()
- returns: <[Object]> Key-value set of additional http headers, which will be sent with every request. - returns: <[Object]> Key-value set of additional http headers, which will be sent with every request.
#### page.frames()
#### page.injectFile(filePath) #### page.injectFile(filePath)
- `url` <[string]> Path to the javascript file to be injected into page. - `url` <[string]> Path to the javascript file to be injected into page.
@ -216,6 +232,7 @@ Pages could be closed by `page.close()` method.
- returns: <[Promise]<[string]>> Returns page's title. - returns: <[Promise]<[string]>> Returns page's title.
#### page.type()
#### page.url() #### page.url()
@ -233,17 +250,12 @@ Pages could be closed by `page.close()` method.
### class: Dialog ### class: Dialog
#### dialog.accept() #### dialog.accept()
#### dialog.dismiss() #### dialog.dismiss()
#### dialog.message() #### dialog.message()
### class: Frame ### class: Frame
#### frame.childFrames() #### frame.childFrames()
#### frame.evaluate(fun, args) #### frame.evaluate(fun, args)
- `fun` <[function]> Function to be evaluated in browser context - `fun` <[function]> Function to be evaluated in browser context
@ -251,44 +263,39 @@ Pages could be closed by `page.close()` method.
- returns: <[Promise]<[Object]>> Promise which resolves to function return value - returns: <[Promise]<[Object]>> Promise which resolves to function return value
#### frame.isDetached() #### frame.isDetached()
#### frame.isMainFrame() #### frame.isMainFrame()
#### frame.name() #### frame.name()
#### frame.parentFrame() #### frame.parentFrame()
#### frame.securityOrigin() #### frame.securityOrigin()
#### frame.url() #### frame.url()
### class: Request ### class: Request
#### request.response()
#### new Request() ### class: Response
#### response.request()
#### request.abort() ### class: InterceptedRequest
#### interceptedRequest.abort()
#### interceptedRequest.continue()
#### interceptedRequest.isHandled()
#### request.continue() ### class: Headers
#### headers.append()
#### headers.delete()
#### headers.entries()
#### headers.get()
#### headers.has()
#### headers.keys()
#### headers.set()
#### headers.values()
#### request.handled() ### class: Body
#### body.arrayBuffer()
#### request.headers() #### body.bodyUsed()
#### body.buffer()
#### request.method() #### body.json()
#### body.text()
#### request.method()
#### request.postData()
#### request.setHeader()
#### request.setMethod()
#### request.setPostData()
#### request.setUrl()
#### request.url()
[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array" [Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array"
[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean" [boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean"

View File

@ -12,14 +12,21 @@ let EXCLUDE_CLASSES = new Set([
'Helper', 'Helper',
'FrameManager', 'FrameManager',
'Navigator', 'Navigator',
'NetworkManager',
'Connection' 'Connection'
]); ]);
let EXCLUDE_METHODS = new Set([ let EXCLUDE_METHODS = new Set([
'frame.constructor', 'Body.constructor',
'dialog.constructor', 'Dialog.constructor',
'page.create', 'Frame.constructor',
'page.constructor' 'Headers.constructor',
'Headers.fromPayload',
'InterceptedRequest.constructor',
'Page.constructor',
'Page.create',
'Request.constructor',
'Response.constructor',
]); ]);
// Build up documentation from JS sources. // Build up documentation from JS sources.
@ -37,7 +44,7 @@ for (let file of files) {
let methodsArray = cls.methodsArray.filter(method => { let methodsArray = cls.methodsArray.filter(method => {
if (method.name.startsWith('_')) if (method.name.startsWith('_'))
return false; return false;
let shorthand = `${cls.name}.${method.name}`.toLowerCase(); let shorthand = `${cls.name}.${method.name}`;
return !EXCLUDE_METHODS.has(shorthand); return !EXCLUDE_METHODS.has(shorthand);
}); });
jsClassesArray.push(new Documentation.Class(cls.name, methodsArray)); jsClassesArray.push(new Documentation.Class(cls.name, methodsArray));