import { IControllerAttribute , IParseHandler } from '../modules/types' ; import { AttributeMetadata } from '../modules/metadata' ; import { DataUtility } from '../modules/utility' ; import { toValue , toNumber , toBoolean , toInteger , toRegExp } from '../modules/builtin/parse_handlers' ; Throws export function Parse ( cb , data ? ) { return AttributeMetadata . parse ( cb , data , false ) ; } Throws export function QueryParam ( cb ? , data ? ) { return AttributeMetadata . parse ( DataUtility . isUndefined ( cb ) ? toValue : cb , data , true ) ; } /**
 * Decorate on Action Parameters to transform values to Number
 */ export function BindNumber ( ) { return AttributeMetadata . parse ( toNumber , undefined , false ) ; } /**
 * Decorate on Action Parameters to transform values to Boolean
 */ export function BindBoolean ( ) { return AttributeMetadata . parse ( toBoolean , undefined , false ) ; } /**
 * Decorate on Action Parameters to transform values to Integer
 */ export function BindInteger ( ) { return AttributeMetadata . parse ( toInteger , undefined , false ) ; } /**
 * Decorate on Action Parameters to validate against RegExp
 */ export function BindRegExp ( regex ) { return AttributeMetadata . parse ( toRegExp , regex , false ) ; } /**
 *  Decorate on API actions that sends response using response object
 */ export function SendsResponse ( ) { return AttributeMetadata . sendsResponse ( ) ; } /**
 * Decorate on async API actions
 */ export function Async ( ) { return AttributeMetadata . asyncAttr ( ) ; } Throws export function HttpGet ( route ) { return AttributeMetadata . httpGet ( route ) ; } Throws export function HttpPost ( route ) { return AttributeMetadata . httpPost ( route ) ; } Throws export function HttpDelete ( route ) { return AttributeMetadata . httpDelete ( route ) ; } Throws export function HttpPatch ( route ) { return AttributeMetadata . httpPatch ( route ) ; } Throws export function HttpPut ( route ) { return AttributeMetadata . httpPut ( route ) ; } Throws export function HttpHead ( route ) { return AttributeMetadata . httpHead ( route ) ; } Throws export function HttpAll ( route ) { return AttributeMetadata . httpAll ( route ) ; } Throws export function Controller ( prefix , attr ? ) { return AttributeMetadata . controller ( prefix , attr ) ; } /**
 * Decorate on API actions.
 * Specifies the type of the value returned by the action
 */ export function Returns ( type ) { return AttributeMetadata . returns ( type ) ; }