Class: Response
An object containing information on a completed TagScript process.
Constructors
constructor
• new Response(variables?, keyValues?)
Parameters
| Name | Type |
|---|---|
variables | Object |
keyValues | IKeyValues |
Properties
actions
• actions: IActions
An object containing information on a completed TagScript process. If you are creating a parser where you need to store info in actions, then you need to extend this interface.
import 'tagscript';
declare module 'tagscript' {
interface IActions {
foo?: string;
}
}body
• body: null | string
The cleaned message with all tags interpreted.
keyValues
• keyValues: IKeyValues
raw
• raw: string
The raw string that was used to generate this response.
variables
• variables: Object
An object with all the variables that parsers such as the LooseVarsParser can access.
Index signature
▪ [key: string]: ITransformer
Methods
setValues
▸ setValues(output, raw): Response
Parameters
| Name | Type |
|---|---|
output | string |
raw | string |
Returns
toJSON
▸ toJSON(): Object
Returns
Object
| Name | Type |
|---|---|
actions | IActions |
body | null | string |
keyValues | IKeyValues |
raw | string |
variables | { [key: string]: ITransformer; } |