How to use the adaptive-expressions.ReturnType.String function in adaptive-expressions

To help you get started, we’ve selected a few adaptive-expressions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / buildinFunctions.ts View on Github external
'isBoolean',
  new FunctionEntity(['input: any'], ReturnType.Boolean, 'determine whether a given input is a boolean.'),
],
['isArray', new FunctionEntity(['input: any'], ReturnType.Boolean, 'determine whether a given input is an array.')],
['isObject', new FunctionEntity(['input: any'], ReturnType.Boolean, 'determine whether a given input is an object.')],
[
  'isDateTime',
  new FunctionEntity(
    ['input: any'],
    ReturnType.Boolean,
    'determine whether a given input is a UTC ISO format timestamp.'
  ),
],
['isString', new FunctionEntity(['input: any'], ReturnType.Boolean, 'determine whether a given input is a string.')],
['formatEpoch', new FunctionEntity(['epoch: number', 'format?: string'], ReturnType.String, 'Return a timestamp from UNIX Epoch time (Unix time, POSIX time).')],
['formatTicks', new FunctionEntity(['ticks: number', 'format?: string'], ReturnType.String, 'Return a timestamp from ticks.')],

['isPresent', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, 'Return true if the TimexProperty or Timex expression refers to the present.')],
['isDuration', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, 'Return true if the TimexProperty or Timex expression refers to a duration.')],
['isTime', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, 'Return true if the TimexProperty or Timex expression refers to a time.')],
['isDate', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, 'Return true if the TimexProperty or Timex expression refers to a date.')],
['isTimeRange', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, 'Return true if the TimexProperty or Timex expression refers to a time range.')],
['isDateRange', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, 'Return true if the TimexProperty or Timex expression refers to a date range.')],
['isDefinite', new FunctionEntity(['timex: TimexProperty|string'], ReturnType.Boolean, '	Return true if the TimexProperty or Timex expression refers to a definite day.')],

  // Functions injected from LG library
  // https://github.com/microsoft/BotBuilder-Samples/blob/master/experimental/language-generation/docs/Functions-injected-from-LG.md
  [
    'template',
    new FunctionEntity(
      ['templateName: string', '...params: any[]'],
      ReturnType.Object,
github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / buildinFunctions.ts View on Github external
'Return the result from subtracting the second number from the first number.'
    ),
  ],
  [
    'exp',
    new FunctionEntity(
      ['minuend: number', 'subtrahend: number'],
      ReturnType.Number,
      'Return exponentiation of one number to another.'
    ),
  ],
  [
    'concat',
    new FunctionEntity(
      ['...strings: string[]'],
      ReturnType.String,
      'Combine two or more strings and return the resulting string. E.g. concat(‘hello’, ‘world’, ‘…’)'
    ),
  ],
  [
    'not',
    new FunctionEntity(
      ['expression: bool'],
      ReturnType.Boolean,
      'Check whether an expression is false. Return true when the expression is false, or return false when true.'
    ),
  ],
  [
    'and',
    new FunctionEntity(
      ['...input: any[]'],
      ReturnType.Boolean,
github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / util.ts View on Github external
export function getreturnTypeStrFromReturnType(returnType: ReturnType): string {
    let result = '';
    switch(returnType) {
        case ReturnType.Boolean: result = "boolean";break;
        case ReturnType.Number: result = "number";break;
        case ReturnType.Object: result = "any";break;
        case ReturnType.String: result = "string";break;
        case ReturnType.Array: result = "array";break;
    }

    return result;
}