You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
5.8 KiB

<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>bot.response</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Namespace bot.response</h1><a class="source" href="source/lib/atoms/response.js.src.html#l20">code &raquo;</a></header><section></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/atoms/response.js.src.html#l32">code &raquo;</a><a class="member" name="bot.response.ResponseObject">bot.response.ResponseObject</a> : <code class="type">{status: <a href="enum_bot_ErrorCode.html">bot.ErrorCode</a>, value: (*|{message: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>})}</code></div><div>Type definition for a response object, as defined by the JSON wire protocol.</div></summary></details></div></div></section><section id="static-functions"><h2>Global Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/atoms/response.js.src.html#l92">code &raquo;</a><span class="member"><a name="bot.response.checkResponse">bot.response.checkResponse</a> <span class="args">( responseObj )</span> &rArr; <code class="type">!<a href="namespace_bot_response.html#bot.response.ResponseObject">bot.response.ResponseObject</a></code></span></div><p>Checks that a response object does not specify an error as defined by the
WebDriver wire protocol. If the response object defines an error, it will
be thrown. Otherwise, the response will be returned as is.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>responseObj: <code class="type">!<a href="namespace_bot_response.html#bot.response.ResponseObject">bot.response.ResponseObject</a></code><dd>The response object to
check.</dl><tr><th>Returns<tr><td><dl>The checked response object.</dl><tr><th>Throws<tr><td><dl><dt><code class="type"><a href="class_bot_Error.html">bot.Error</a></code><dd>If the response describes an error.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/atoms/response.js.src.html#l66">code &raquo;</a><span class="member"><a name="bot.response.createErrorResponse">bot.response.createErrorResponse</a> <span class="args">( error )</span> &rArr; <code class="type">!<a href="namespace_bot_response.html#bot.response.ResponseObject">bot.response.ResponseObject</a></code></span></div><p>Converts an error value into its JSON representation as defined by the
WebDriver wire protocol.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>error: <code class="type">(<a href="class_bot_Error.html">bot.Error</a>|<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a>|*)</code><dd>The error value to convert.</dl><tr><th>Returns<tr><td><dl>The new response object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/atoms/response.js.src.html#l49">code &raquo;</a><span class="member"><a name="bot.response.createResponse">bot.response.createResponse</a> <span class="args">( value )</span> &rArr; <code class="type">!<a href="namespace_bot_response.html#bot.response.ResponseObject">bot.response.ResponseObject</a></code></span></div><p>Creates a new success response object with the provided value.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>value: <code class="type">*</code><dd>The response value.</dl><tr><th>Returns<tr><td><dl>The new response object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/atoms/response.js.src.html#l39">code &raquo;</a><span class="member"><a name="bot.response.isResponseObject">bot.response.isResponseObject</a> <span class="args">( value )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>value: <code class="type">*</code><dd>The value to test.</dl><tr><th>Returns<tr><td><dl>Whether the given value is a response object.</dl></table></div></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>