import { Pair, RequestObjectParams, ResponseParams } from '../../'; /** * Class-based controller options interface. */ export interface ClassBasedViewOptions { /** * Predefined route to trigger the controller. * If no value is provided, Fulminate will try to automatically get the route by its name. * @example TestAction, TestController or TestView will be triggered by '/test'. */ route?: string | RegExp; /** * Template to be rendered with the controller. * You need to set up rendering views with Fulminate to be able to use this feature. * If no template is provided, JSON response will be rendered. */ template?: string; /** * HTTP method. * @default 'GET' */ method?: string; /** * Object created as a result of triggering the controller. * You do not need to set this option, it is injected automatically. */ object?: any; /** * Params injected into the view, like QueryParams, Headers, etc. */ params?: RequestObjectParams; /** * Params injected into the response object. */ settableParams?: ResponseParams; /** * Define if response should be rendered as JSON. * Enabling this option overrides the response logic and ignores template if it is provided. */ asJson?: boolean; /** * Provide headers to be set on the response object. * May be used as an alternative to using @SetHeader() decorator. */ headers?: Pair[]; }