How to use the adaptive-expressions.ReturnType.Boolean 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 / 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;
}
github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / buildinFunctions.ts View on Github external
],
  [
    'max',
    new FunctionEntity(['...numbers: number[]'], ReturnType.Number, 'Returns the largest value from a collection'),
  ],
  [
    'average',
    new FunctionEntity(['...numbers: number[]'], ReturnType.Number, 'Returns the average value from a collection'),
  ],
  [
    'sum',
    new FunctionEntity(['...numbers: number[]'], ReturnType.Number, 'Return the result from adding numbers in a list.'),
  ],
  [
    'exists',
    new FunctionEntity(['expression: expression'], ReturnType.Boolean, 'Returns the smallest value from a collection'),
  ],
  ['length', new FunctionEntity(['str: string'], ReturnType.Number, 'Returns the length of a string')],
  [
    'replace',
    new FunctionEntity(
      ['text: string', 'oldText: string', 'newText: string'],
      ReturnType.String,
      'Replace a substring with the specified string, and return the updated string. case sensitive'
    ),
  ],
  [
    'replaceIgnoreCase',
    new FunctionEntity(
      ['text: string', 'oldText: string', 'newText: string'],
      ReturnType.String,
      'Replace a substring with the specified string, and return the updated string. Case in-sensitive'
github microsoft / BotBuilder-Samples / experimental / adaptive-tool / src / lg / buildinFunctions.ts View on Github external
'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,
      'Check whether all expressions are true. Return true when all expressions are true, or return false when at least one expression is false.'
    ),
  ],
  [
    'or',
    new FunctionEntity(
      ['...input: any[]'],
      ReturnType.Boolean,