@cdktn/hcl2cdk 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +95 -0
  2. package/ambient.d.ts +14 -0
  3. package/jest.config.js +16 -0
  4. package/lib/__tests__/coerceType.test.d.ts +2 -0
  5. package/lib/__tests__/coerceType.test.js +165 -0
  6. package/lib/__tests__/expressionToTs.test.d.ts +6 -0
  7. package/lib/__tests__/expressionToTs.test.js +693 -0
  8. package/lib/__tests__/expressions.test.d.ts +4 -0
  9. package/lib/__tests__/expressions.test.js +415 -0
  10. package/lib/__tests__/findExpressionType.test.d.ts +6 -0
  11. package/lib/__tests__/findExpressionType.test.js +105 -0
  12. package/lib/__tests__/functions.test.d.ts +6 -0
  13. package/lib/__tests__/functions.test.js +605 -0
  14. package/lib/__tests__/generation.test.d.ts +6 -0
  15. package/lib/__tests__/generation.test.js +45 -0
  16. package/lib/__tests__/jsii-rosetta-workarounds.test.d.ts +2 -0
  17. package/lib/__tests__/jsii-rosetta-workarounds.test.js +86 -0
  18. package/lib/__tests__/partialCode.test.d.ts +6 -0
  19. package/lib/__tests__/partialCode.test.js +390 -0
  20. package/lib/__tests__/terraformSchema.test.d.ts +6 -0
  21. package/lib/__tests__/terraformSchema.test.js +105 -0
  22. package/lib/__tests__/testHelpers.d.ts +7 -0
  23. package/lib/__tests__/testHelpers.js +16 -0
  24. package/lib/coerceType.d.ts +7 -0
  25. package/lib/coerceType.js +240 -0
  26. package/lib/dynamic-blocks.d.ts +8 -0
  27. package/lib/dynamic-blocks.js +44 -0
  28. package/lib/expressions.d.ts +9 -0
  29. package/lib/expressions.js +634 -0
  30. package/lib/function-bindings/functions.d.ts +31 -0
  31. package/lib/function-bindings/functions.generated.d.ts +806 -0
  32. package/lib/function-bindings/functions.generated.js +1142 -0
  33. package/lib/function-bindings/functions.js +73 -0
  34. package/lib/generation.d.ts +26 -0
  35. package/lib/generation.js +676 -0
  36. package/lib/index.d.ts +136 -0
  37. package/lib/index.js +364 -0
  38. package/lib/iteration.d.ts +23 -0
  39. package/lib/iteration.js +87 -0
  40. package/lib/jsii-rosetta-workarounds.d.ts +5 -0
  41. package/lib/jsii-rosetta-workarounds.js +126 -0
  42. package/lib/partialCode.d.ts +11 -0
  43. package/lib/partialCode.js +116 -0
  44. package/lib/provider.d.ts +8 -0
  45. package/lib/provider.js +40 -0
  46. package/lib/references.d.ts +11 -0
  47. package/lib/references.js +141 -0
  48. package/lib/schema.d.ts +297 -0
  49. package/lib/schema.js +81 -0
  50. package/lib/telemetryAllowList.json +24 -0
  51. package/lib/terraformSchema.d.ts +6 -0
  52. package/lib/terraformSchema.js +136 -0
  53. package/lib/types.d.ts +50 -0
  54. package/lib/types.js +3 -0
  55. package/lib/utils.d.ts +6 -0
  56. package/lib/utils.js +25 -0
  57. package/lib/variables.d.ts +10 -0
  58. package/lib/variables.js +172 -0
  59. package/package.json +71 -0
  60. package/package.sh +9 -0
  61. package/tsconfig.json +42 -0
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+ import { AttributeType } from "@cdktn/commons";
6
+ type FunctionCall = any;
7
+ type FunctionMeta = {
8
+ name: string;
9
+ returnType: AttributeType;
10
+ parameters: {
11
+ type: AttributeType;
12
+ optional?: boolean;
13
+ variadic?: boolean;
14
+ }[];
15
+ /**
16
+ * Allows transforming the function call before it is handled. This is currently used to handle
17
+ * different APIs between TF supporting join(sep, listA, listB) and CDKTN only supporting join(sep, list)
18
+ * (as the alternative due to JSIIs lack of support for variadic parametes would be join(sep, lists) which
19
+ * would have a worse UX as most often just a single list is passed)
20
+ * In the case of join() the transformer will convert the function call to join(sep, concat(listA, listB))
21
+ * before handling it
22
+ *
23
+ * Caution: Beware of infinite recursion if the returned function call is to the same function that has this
24
+ * transformer. Return the same instance of the passed functionCall to break out of that recursion.
25
+ */
26
+ transformer?: (functionCall: FunctionCall) => FunctionCall;
27
+ };
28
+ export declare const functionsMap: Record<string, FunctionMeta>;
29
+ export declare const tsFunctionsMap: Record<string, FunctionMeta>;
30
+ export {};
31
+ //# sourceMappingURL=functions.d.ts.map