Commit Graph

43 Commits

Author SHA1 Message Date
Jack Franklin
9fdf2ba280
chore(docs): migrate page.pdf() docs (#6228)
Also took the opportunity to pull out the PDF types into their own file
to clear up `Page.ts` slightly and give the PDF code a more natural
place to live.
2020-07-17 13:58:56 +01:00
Jack Franklin
3effcafcd1
chore: generate docs for the protocol (#6213) 2020-07-13 14:01:35 +01:00
Jack Franklin
9b3005c105
feat(types): improve page.evaluate types (#6193) 2020-07-10 11:52:13 +01:00
Jack Franklin
03a87e814d
chore(docs): tidy Puppeteer class docs (#6181)
* Mark properties as `private` or `@internal` so they don't get
  documented.
* Fix the `@returns` on a getter which gets ignored.
2020-07-09 14:49:27 +01:00
Jack Franklin
24cb6a28ad
chore(docs): document Frame class (#6188)
* chore: document Frame class
2020-07-09 14:22:58 +01:00
Jack Franklin
0e938803ef
chore(docs): migrate Connection + CDP event defs (#6180) 2020-07-08 11:11:01 +01:00
Jack Franklin
2256b8d7d7
chore(docs): migrate BrowserContext events (#6168) 2020-07-07 11:21:14 +02:00
Jack Franklin
e2e050259f
chore(docs): fix DOMWorld doc warnings (#6166)
I noticed that DOMWorld was spitting a lot of warnings out when we
generated the docs. It was mostly easy tidy-ups and removing old JSDoc
comments and now the warnings are gone :)
2020-07-06 12:37:16 +01:00
Jack Franklin
782c1d4873
chore(docs): define events enum for Browser (#6165) 2020-07-06 12:23:40 +01:00
Jack Franklin
ba7624a6df
chore(docs): migrate & document all Page events (#6154)
* chore(docs): migrate & document all Page events

Rather than a generic `Events.ts` file we can instead document events as
an enum within each individual class. It's easier to document and work
with, and it's clearer where events originate from.
2020-07-06 11:34:55 +01:00
Christian Bromann
e67a860eb0
feat: add Mouse#wheel (#6141) 2020-07-06 09:27:17 +02:00
Jack Franklin
f7857d27c4
chore(docs): document HTTPRequest with TSDoc (#6146)
* chore(docs): document HTTPRequest with TSDoc

* doclint

* example
2020-07-03 14:28:45 +01:00
Jack Franklin
054fa2e45d
chore(docs): fix more documentation warnings (#6145) 2020-07-02 16:13:22 +01:00
Jack Franklin
29f7e161b1
chore(docs): reduce warnings when generating docs (#6138)
* chore(docs): reduce warnings when generating docs

This is a bunch of small miscellaneous fixes that reduce the amount of
warnings logged when generating our new docs. The long term goal is to
get this list down to 0 warnings, but I'll do it in multiple PRs.

* satisfy doclint
2020-07-02 12:15:39 +01:00
Jack Franklin
6474edb9ba
feat(types): add types for $eval (#6135)
This pulls in the types (based on the DefinitelyTyped repo) for
`page.$eval` (and the `$eval` method on other classes). The `$eval`
method is quite hard to type due to the way we wrap and unwrap
ElementHandles that are passed to / returned from the `pageFunction`
that users provide.

Longer term we can improve the types by providing type overloads as
DefinitelyTyped does but I've deferred that for now (see the `TODO` in
the code for more details).
2020-07-02 10:09:34 +01:00
Jack Franklin
8370ec88ae
feat(types): add (and fix) evaluateHandle types (#6130)
This change started as a small change to pull types from DefinitelyTyped over to
Puppeteer for the `evaluateHandle` function but instead ended up also fixing
what looks to be a long standing issue with our existing documentation.

`evaluateHandle` can in fact return an `ElementHandle` rather than a `JSHandle`.
Note that `ElementHandle` extends `JSHandle` so whilst the docs are technically
correct (all ElementHandles are JSHandles) it's confusing because JSHandles
don't have methods like `click` on them, but ElementHandles do.

if you return something that is an HTML element:

```
const button = page.evaluateHandle(() => document.querySelector('button'));
// this is an ElementHandle, not a JSHandle
```

Therefore I've updated the original docs and added a large explanation to the
TSDoc for `page.evaluateHandle`.

In TypeScript land we'll assume the function will return a `JSHandle` but you
can tell TS otherwise via the generic argument, which can only be `JSHandle`
(the default) or `ElementHandle`:

```
const button = page.evaluateHandle<ElementHandle>(() => document.querySelector('button'));
```
2020-07-01 12:44:08 +01:00
Yang Guo
123c377512
docs(new): Add TSDoc to Coverage class (#6106) 2020-06-29 09:53:28 +01:00
Changhao Han
adeffbaac1
docs(new): migrate Page.ts to TSDoc (part 0 / 2) (#6104)
* docs(new): migrate Page.ts to TSDoc (part 0 / 2)

Co-authored-by: Changhao Han <changhaohan@chromium.org>
2020-06-26 09:24:56 +02:00
Mathias Bynens
df96f16921
docs(new): migrate JSHandle docs to TSDoc (#6102) 2020-06-25 15:49:35 +01:00
Jack Franklin
46fc6ca41a
feat(types): improve typing of .evaluate() (#6096)
* feat(types): improve typing of `.evaluate()`

This is the start of the work to take the types from the
`@types/puppeteer` repository and port them into our repo so we can ship
our built-in types out the box.

This change types the `evaluate` function properly. It takes a generic
type which is the type of the function you're passing, and the arguments
and the return that you get back from the `evaluate` call are typed
correctly.
2020-06-25 13:38:01 +01:00
Jack Franklin
5b6d2bfb0e docs(new): add TSDoc comments to Keyboard (#6099)
Co-authored-by: Tim van der Lippe <tvanderlippe@google.com>
2020-06-25 13:01:46 +02:00
Changhao Han
4696f7abda docs(new): migrate HTTPResponse docs to TSDoc (#6085)
Co-authored-by: Changhao Han <changhaohan@chromium.org>
2020-06-25 13:01:46 +02:00
Jack Franklin
48c5a8ed01 docs(new): add TSDoc comments to Puppeteer (#6032) (#6094)
Co-authored-by: Martin Splitt <mr.avgp@googlemail.com>
2020-06-25 13:01:46 +02:00
Martin Splitt
f1f7339a3b docs(new): add TSDoc comments to Puppeteer (#6032) 2020-06-25 13:01:46 +02:00
Martin Splitt
a46c78fc91 docs(new): Adds TSDoc to Tracing class (#6088)
* Adds tsdoc to Tracing class

* Updates tsdocs

Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:46 +02:00
Martin Splitt
60904da4cd docs(new): migrate FileChooser docs to TSDoc (#6092)
Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:36 +02:00
Martin Splitt
f481922175 docs(new): Adds TSDoc to Mouse class (#6086)
* Adds tsdoc to Mouse class

* Updates puppeteer class tsdoc

* docs(new): add TSDoc comments to BrowserFetcher (#6078)

* Adds tsdoc for Touchscreen (#6087)

Co-authored-by: martinsplitt <martin@geekonaut.de>

* Adds tsdoc to Mouse class

* Fixes tsdoc comment for Mouse class

Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:36 +02:00
Martin Splitt
2ad42dc398 docs(new): migrate Touchscreen docs to TSDoc (#6087)
Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-25 13:01:12 +02:00
Martin Splitt
73b97956cc
docs(new): add TSDoc comments to BrowserFetcher (#6078) 2020-06-24 09:33:19 +01:00
Jack Franklin
70a900e93b
chore: fix ESLint violation and lessen rule strictness (#6081) 2020-06-23 12:55:42 +01:00
Tim van der Lippe
4659ee8daa docs(new): add TSDoc comments to BrowserContext (#6066) 2020-06-23 07:22:10 +02:00
Peter Marshall
ccae54644c
docs(new): migrate Browser docs to TSDoc (#6070) 2020-06-23 07:19:15 +02:00
Alex Rudenko
6657364364
docs(new): migrate ElementHandle to TSDoc (#6073)
* docs(new): migrate ElementHandle to TSDoc

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2020-06-22 17:21:57 +02:00
Paul Lewis
819afbebf7
docs(new): migrate ConsoleMessage docs to TSDoc (#6065) 2020-06-22 13:52:39 +01:00
Alex Rudenko
983a7b67df
docs(new): migrate CDPSession to TSDoc (#6064) 2020-06-22 12:05:10 +02:00
Alex Rudenko
1cf3f06055
docs(new): migrate TimeoutError to TSDoc (#6062)
* docs(new): migrate TimeoutError to TSDoc

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2020-06-22 10:34:57 +02:00
Mathias Bynens
7978315de7
docs(new): migrate SecurityDetails docs to TSDoc (#6053) 2020-06-19 15:30:28 +02:00
Martin Splitt
44402b75a0
feat(new-docs): add tsdoc comments to WebWorker (#6029)
* feat(new-docs): add TSDoc comments to `WebWorker`

Co-authored-by: martinsplitt <martin@geekonaut.de>
2020-06-17 16:26:10 +01:00
Jack Franklin
b659969a38
chore: migrate away from Node's EventEmitter (#5979) 2020-06-15 11:52:19 +01:00
Jack Franklin
23f18d8cc0
docs(new): start documenting the Page class (#6001)
This PR starts exploring the Page class and how to best document it. It explores how best to document events in the system, and I think pulling them out into an `enum` is the best solution here. It lets us end up with a page of docs that explicitly lists all the events the page class can ever emit.
2020-06-12 11:10:12 +01:00
Jack Franklin
ca8b0d685c
feat(new-docs): migrate Dialog documentation to TSDoc (#5981) 2020-06-09 09:19:42 +01:00
Jack Franklin
0b3d52a70e
feat(new-docs): add TSDoc comments to Accessibility (#5971)
* feat(new-docs): add tsdoc to `Accessibility`
2020-06-05 15:20:11 +01:00
Jack Franklin
086c08998b
chore: commit base new-docs (#5973)
This adds the new docs that are generated by API Extractor via TSDoc.
They are sparse because we do not yet use TSDoc in the codebase. This is
the starting point and from here we can work through all the different
classes and improve the documentation.
2020-06-04 15:56:45 +01:00