Module

Toppokki

Package
purescript-toppokki
Repository
justinwoo/purescript-toppokki

#Puppeteer Source

data Puppeteer :: Type

#Browser Source

data Browser :: Type

#Page Source

data Page :: Type

#ElementHandle Source

#URL Source

newtype URL

Constructors

Instances

#Selector Source

newtype Selector

Constructors

Instances

#LaunchOptions Source

type LaunchOptions = (args :: Array String, defaultViewport :: Record DefaultViewPort, devtools :: Boolean, dumpio :: Boolean, handleSIGHUP :: Boolean, handleSIGINT :: Boolean, handleSIGTERM :: Boolean, headless :: Boolean, ignoreDefaultArgs :: Array String, ignoreHTTPSErrors :: Boolean, pipe :: Boolean, slowMo :: Number, timeout :: Number, userDataDir :: String)

#DefaultViewPort Source

type DefaultViewPort = (deviceScaleFactor :: Number, hasTouch :: Boolean, height :: Number, isLandscape :: Boolean, isMobile :: Boolean, width :: Number)

#launch Source

launch :: forall options trash. Union options trash LaunchOptions => Record options -> Aff Browser

#goto Source

goto :: URL -> Page -> Aff Unit

#ScreenshotOptions Source

type ScreenshotOptions = (clip :: { height :: Int, width :: Int, x :: Int, y :: Int }, fullPage :: Boolean, omitBackground :: Boolean, path :: String, quality :: Int, type :: String)

#screenshot Source

screenshot :: forall options trash. Union options trash ScreenshotOptions => Record options -> Page -> Aff Buffer

#PDFMargin Source

data PDFMargin :: Type

#PDFMarginOptions Source

type PDFMarginOptions = (bottom :: String, left :: String, right :: String, top :: String)

#makePDFMargin Source

makePDFMargin :: forall options trash. Union options trash PDFMarginOptions => Record options -> PDFMargin

#PDFOptions Source

type PDFOptions = (displayHeaderFooter :: Boolean, footerTemplate :: String, format :: String, headerTemplate :: String, height :: String, landscape :: Boolean, margin :: PDFMargin, pageRanges :: String, path :: String, printBackground :: Boolean, scale :: Int, width :: String)

#pdf Source

pdf :: forall options trash. Union options trash PDFOptions => Record options -> Page -> Aff Buffer

#pageWaitForSelector Source

pageWaitForSelector :: forall options trash. Union options trash (hidden :: Boolean, timeout :: Int, visible :: Boolean) => Selector -> Record options -> Page -> Aff ElementHandle

#type_ Source

type_ :: forall options trash. Union options trash (delay :: Int) => Selector -> String -> Record options -> Page -> Aff Unit

#WaitUntilOption Source

#waitForNavigation Source

waitForNavigation :: forall options trash. Union options trash (waitUntil :: WaitUntilOption) => Record options -> Page -> Aff Unit

#getLocationRef Source

#unsafeEvaluateOnNewDocument Source

unsafeEvaluateOnNewDocument :: String -> Page -> Aff Foreign

The function is invoked after the document was created but before any of its scripts were run.

This is useful to amend the environment, e.g. to seed Math.random.

#unsafeEvaluateStringFunction Source

#unsafePageEval Source

unsafePageEval :: Selector -> String -> Page -> Aff Foreign

This method runs document.querySelector within the page and passes it as the first argument to pageFunction. If there's no element matching selector, the method throws an error.

Second argument is a pageFunction which should be a valid JavaScript function written as a string which we unsafely eval.

If pageFunction returns a Promise, then page.$$eval would wait for the promise to resolve and return its value.

#unsafePageEvalAll Source

unsafePageEvalAll :: Selector -> String -> Page -> Aff Foreign

This method runs Array.from(document.querySelectorAll(selector)) within the page and passes it as the first argument to pageFunction.

Second argument is a pageFunction which should be a valid JavaScript function written as a string which we unsafely eval.

If pageFunction returns a Promise, then page.$$eval would wait for the promise to resolve and return its value.

#runPromiseAffE1 Source

runPromiseAffE1 :: forall a o. Fn1 a (Effect (Promise o)) -> a -> Aff o

#runPromiseAffE2 Source

runPromiseAffE2 :: forall a b o. Fn2 a b (Effect (Promise o)) -> a -> b -> Aff o

#runPromiseAffE3 Source

runPromiseAffE3 :: forall a b c o. Fn3 a b c (Effect (Promise o)) -> a -> b -> c -> Aff o

#runPromiseAffE4 Source

runPromiseAffE4 :: forall a b c d o. Fn4 a b c d (Effect (Promise o)) -> a -> b -> c -> d -> Aff o

#KeyboardKey Source

newtype KeyboardKey

See USKeyboardLayout for a list of all key names.

Constructors

#keyboardDown Source

keyboardDown :: forall options trash. Union options trash (text :: String) => KeyboardKey -> Record options -> Page -> Aff Unit

Dispatches a keydown event.

#keyboardPress Source

keyboardPress :: forall options trash. Union options trash (delay :: Int, text :: String) => KeyboardKey -> Record options -> Page -> Aff Unit

Trigger a single keypress. Shortcut for keyboard.down and keyboard.up.

#keyboardSendCharacter Source

keyboardSendCharacter :: String -> Page -> Aff Unit

Dispatches a keypress and input event. This does not send a keydown or keyup event.

#keyboardType Source

keyboardType :: forall options trash. Union options trash (delay :: Number) => String -> Record options -> Page -> Aff Unit

Sends a keydown, keypress/input, and keyup event for each character in the text. To press a special key, like Control or ArrowDown, use keyboard.press.

#keyboardUp Source

keyboardUp :: forall options trash. Union options trash (text :: String) => KeyboardKey -> Record options -> Page -> Aff Unit

Dispatches a keyup event.

#setUserAgent Source

#_launch Source

_launch :: forall options. Fn1 options (Effect (Promise Browser))

#_screenshot Source

_screenshot :: forall options. Fn2 options Page (Effect (Promise Buffer))

#_pdf Source

_pdf :: forall options. Fn2 options Page (Effect (Promise Buffer))

#_pageWaitForSelector Source

#_type Source

_type :: forall options. Fn4 Selector String options Page (Effect (Promise Unit))

#_waitForNavigation Source

_waitForNavigation :: forall options. Fn2 options Page (Effect (Promise Unit))

#_keyboardDown Source

_keyboardDown :: forall options. Fn3 KeyboardKey options Page (Effect (Promise Unit))

#_keyboardPress Source

_keyboardPress :: forall options. Fn3 KeyboardKey options Page (Effect (Promise Unit))

#_keyboardType Source

_keyboardType :: forall options. Fn3 String options Page (Effect (Promise Unit))

#_keyboardUp Source

_keyboardUp :: forall options. Fn3 KeyboardKey options Page (Effect (Promise Unit))
Modules
Toppokki