UNPKG

@goa/goa

Version:

The Goa Source Code For Compilation Into @Goa/Koa That Includes Modules, Tests, Types And Dependencies.

134 lines (129 loc) 5.55 kB
<types namespace="_goa"> <import from="http" name="IncomingMessage" /> <import from="http" name="ServerResponse" /> <import from="stream" name="Stream" /> <import from="net" name="Socket" /> <import from=".." ns="_goa" name="Application" /> <import from=".." ns="_goa" name="Context" /> <import from=".." ns="_goa" name="Request" /> <type interface name="ContextDelegatedResponse" desc="The response API available via Context."> <fn void name="attachment"> <arg string name="filename" opt>The filename.</arg> <arg type="!_goa.ContentDisposition" name="options" opt> _Content-Disposition_ options. </arg> Set _Content-Disposition_ header to "attachment" with optional `filename`. </fn> <fn void name="redirect" example="../example/jsdoc/response/redirect.js"> <arg type="string" name="url"> The URL to redirect to. </arg> <arg type="string" name="referrer" opt> The referrer to set when redirecting. </arg> Perform a 302 redirect to `url`. The string "back" is special-cased to provide Referrer support, when Referrer is not present `alt` or "/" is used. </fn> <fn name="remove" void> <arg string name="field">The name of the header to remove.</arg> Remove header `field`. </fn> <fn void name="set" example="../example/jsdoc/response/set.js"> <arg type="string|!Object" name="field"> The field to set, or an object of header fields. </arg> <arg type="string|!Array|number" name="val" opt> The value to set, when passing a single field. </arg> Set header `field` to `val`, or pass an object of header fields. </fn> <fn void name="vary"> <arg string name="field">The name of the header to vary on.</arg> Vary on `field`. </fn> <fn void name="append" example="../example/jsdoc/response/append.js"> <arg string name="field">The header name to append values to.</arg> <arg type="string|!Array" name="val">The value or values to append.</arg> Append additional header `field` with value `val`. </fn> <fn void name="flushHeaders"> Flush any set headers, and begin the body. </fn> <prop number name="status"> Get/set response status code. </prop> <prop string name="message"> Get/set response status message. </prop> <prop type="string|!Buffer|Object|!stream.Stream" name="body"> Get/set response body. </prop> <prop type="?number" name="length"> Return parsed response `Content-Length` when present. Set `Content-Length` field to `n`. </prop> <prop string name="type" example="../example/jsdoc/response/type.js"> Return the response mime type void of parameters such as "charset". Set Content-Type response header with `type` through `mime.lookup()` when it does not contain a charset. </prop> <prop boolean name="writable"> Checks if the request is writable. Tests for the existence of the socket as _Node.JS_ sometimes does not set it. </prop> <prop type="string|Date" name="lastModified" example="../example/jsdoc/response/last-modified.js"> Get the Last-Modified date in Date form, if it exists. Set the Last-Modified date using a string or a Date. </prop> <prop boolean name="headerSent"> Check if a header has been written to the socket. </prop> <prop string name="etag" example="../example/jsdoc/response/etag.js"> Get/Set the ETag of a response. This will normalize the quotes if necessary. </prop> </type> <type interface extends="_goa.ContextDelegatedResponse" name="BaseResponse" desc="The additional API not available via Context."> <prop type="!net.Socket" name="socket"> Return the request socket. </prop> <prop type="!Object<string, string>" name="header"> Return response header (_OutgoingHttpHeaders_). </prop> <prop type="!Object<string, string>" name="headers"> Return response header, alias as `response.header` (_OutgoingHttpHeaders_). </prop> <fn return="string" name="get" example="../example/jsdoc/response/get.js"> <arg string name="header">The name of the response header.</arg> Return response header. </fn> <fn return="string|boolean" name="is"> <arg type="!Array<string>|string" name="type"> The type to check as a parameter, or multiple types as an array. </arg> <arg type="string" name="...types"> Types to check as parameters. </arg> Check whether the response is one of the listed types. Pretty much the same as `this.request.is()`. </fn> </type> <type interface extends="_goa.BaseResponse" name="Response" desc="The response object."> <prop type="!_goa.Application" name="app"> The reference to the application. </prop> <prop type="!_goa.Context" name="ctx"> The reference to the context instance. </prop> <prop type="!_goa.Request" name="request"> The reference to the request instance. </prop> <prop type="!http.IncomingMessage" name="req"> The message from the client. </prop> <prop type="!http.ServerResponse" name="res"> The response from the server. </prop> </type> <record name="ContentDisposition" desc="Options for setting the attachment."> <prop string name="type" default="attachment"> The type. </prop> <prop type="boolean|string" name="fallback" default="true"> Fallback filename. </prop> </record> </types>