Permalink
Browse files

Use bs.string for Screenshot.options _type field

And add documentation for the makeOptions function.
  • Loading branch information...
zploskey committed Jun 14, 2018
1 parent 5c7ae0d commit 2e7c5678cc2e387f207c2aa9eda5a1eae9dea1d5
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/Screenshot.re
@@ -1,19 +1,29 @@
type options = {
.
"path": Js.Nullable.t(string),
"_type": Js.Nullable.t(string), /* "jpeg" | "png" (default) */
"_type": Js.Nullable.t(string),
"quality": Js.Nullable.t(float),
"fullPage": Js.Nullable.t(bool),
"clip": Js.Nullable.t(BoundingBox.t),
"omitBackground": Js.Nullable.t(bool),
/* TODO: Should handle the two options. */
};

/** Create a screenshot options object.
*
* If no [path] is provided, the screenshot will not be saved to disk.
* [_type] defaults to [`png].
* [quality] should be between 0 and 100. Does not apply to png images.
* [fullpage]: If true, take screenshot of full scrollable page.
* Defaults to false.
* [clip]: [BoundingBox.t] representing the region to clip the screenshot to.
* [omitBackground]: Whether to hide default white background.
* Defaults to false.
*/
[@bs.obj]
external makeOptions :
(
~path: string=?,
~_type: string=?,
~_type: [@bs.string] [ | `jpeg | `png]=?,
~quality: float=?,
~fullPage: bool=?,
~clip: BoundingBox.t=?,

0 comments on commit 2e7c567

Please sign in to comment.