Bixby Developer Center



Provides functions for typed value conversion.

  • Importing with JavaScript Runtime Version 1:
    var types = require('types')
  • Importing with JavaScript Runtime Version 2:
    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.

types.typedValue(value, type, id)

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 typesReturns: A new primitive type as specified by the parameters.

valueStringThe new value.
typeStringA type name, for example hotel.RoomBedType.
id StringA unique id.