How to use the @teleporthq/teleport-plugin-common.ASTUtils.getTSAnnotationForType function in @teleporthq/teleport-plugin-common

To help you get started, we’ve selected a few @teleporthq/teleport-plugin-common 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 teleporthq / teleport-code-generators / packages / teleport-plugin-stencil-base-component / src / utils.ts View on Github external
const stateDeclaration = Object.keys(stateDefinitions).map((stateKey) =>
    t.classProperty(
      t.identifier(stateKey),
      ASTUtils.convertValueToLiteral(stateDefinitions[stateKey].defaultValue),
      t.tsTypeAnnotation(ASTUtils.getTSAnnotationForType(stateDefinitions[stateKey].type)),
      [t.decorator(t.callExpression(t.identifier('State'), []))]
    )
  )
github teleporthq / teleport-code-generators / packages / teleport-plugin-angular-base-component / src / utils.ts View on Github external
const dataDeclaration = Object.keys(dataObject).map((dataKey) => {
    return t.classProperty(
      t.identifier(dataKey),
      ASTUtils.convertValueToLiteral(dataObject[dataKey]),
      t.tsTypeAnnotation(ASTUtils.getTSAnnotationForType(typeof dataObject[dataKey]))
    )
  })
github teleporthq / teleport-code-generators / packages / teleport-plugin-angular-base-component / src / utils.ts View on Github external
return t.classProperty(
        t.identifier(propKey),
        t.newExpression(t.identifier('EventEmitter'), []),
        t.typeAnnotation(
          t.genericTypeAnnotation(
            t.identifier('EventEmitter'),
            t.typeParameterInstantiation([t.anyTypeAnnotation()])
          )
        ),
        [t.decorator(t.callExpression(t.identifier('Output'), []))]
      )
    }
    return t.classProperty(
      t.identifier(propKey),
      ASTUtils.convertValueToLiteral(propDefinitions[propKey].defaultValue),
      t.tsTypeAnnotation(ASTUtils.getTSAnnotationForType(propDefinitions[propKey].type)),
      [t.decorator(t.callExpression(t.identifier('Input'), []))]
    )
  })
github teleporthq / teleport-code-generators / packages / teleport-plugin-lit-element-base-component / src / utils.ts View on Github external
const propDeclaration = Object.keys(propDefinitions).map((propKey) =>
    t.classProperty(
      t.identifier(propKey),
      ASTUtils.convertValueToLiteral(propDefinitions[propKey].defaultValue),
      types.tsTypeAnnotation(ASTUtils.getTSAnnotationForType(propDefinitions[propKey].type)),
      [t.decorator(t.callExpression(t.identifier('property'), []))]
    )
  )

@teleporthq/teleport-plugin-common

Common building and modelating functions for ASTs and HASTs

MIT
Latest version published 2 days ago

Package Health Score

82 / 100
Full package analysis

Similar packages