Provides functions for typed value conversion.
var types = require('types')
import types from 'types'
The following sections describe the available methods within this module. Each section includes a table that lists the parameters for that method, as well as the parameter's type and description.
Constructs a primitive type. Usually used to return a typed value that is more specific than an action's declared output type. The new type must be an extension or contextualization of the action's declared output type.
For example a FindTickets
action could declare output as event.Ticket
, but in your specific implementation you want to return a myProvider.Ticket
, which extends event.Ticket
. Instead of returning ticketObject
directly, return types.typedValue(ticketObject, "myProvider.Ticket", ticketId)
.
Kind: Static method of types
Returns: A new primitive type as specified by the parameters.
Parameter | Type | Description |
---|---|---|
value | String | The new value. |
type | String | A type name, for example hotel.RoomBedType . |
id | String | A unique id. |
Copyright 2024 Samsung All rights reserved