checkly 5.3.1 → 5.4.0-prerelease-6249ef2
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.
- package/dist/auth/index.js +125 -132
- package/dist/auth/index.js.map +1 -1
- package/dist/commands/authCommand.js +1 -1
- package/dist/commands/authCommand.js.map +1 -1
- package/dist/commands/baseCommand.d.ts +2 -0
- package/dist/commands/baseCommand.js +7 -9
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/deploy.js +55 -57
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/destroy.js +15 -16
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/env/add.js +28 -29
- package/dist/commands/env/add.js.map +1 -1
- package/dist/commands/env/ls.js +2 -2
- package/dist/commands/env/ls.js.map +1 -1
- package/dist/commands/env/pull.js +17 -17
- package/dist/commands/env/pull.js.map +1 -1
- package/dist/commands/env/rm.js +17 -18
- package/dist/commands/env/rm.js.map +1 -1
- package/dist/commands/env/update.js +29 -30
- package/dist/commands/env/update.js.map +1 -1
- package/dist/commands/help.js +2 -2
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/import/apply.d.ts +14 -0
- package/dist/commands/import/apply.js +157 -0
- package/dist/commands/import/apply.js.map +1 -0
- package/dist/commands/import/cancel.d.ts +11 -0
- package/dist/commands/import/cancel.js +119 -0
- package/dist/commands/import/cancel.js.map +1 -0
- package/dist/commands/import/commit.d.ts +14 -0
- package/dist/commands/import/commit.js +141 -0
- package/dist/commands/import/commit.js.map +1 -0
- package/dist/commands/import/plan.d.ts +20 -0
- package/dist/commands/import/plan.js +1237 -0
- package/dist/commands/import/plan.js.map +1 -0
- package/dist/commands/login.js +38 -48
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +9 -9
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/runtimes.js +2 -2
- package/dist/commands/runtimes.js.map +1 -1
- package/dist/commands/switch.js +9 -9
- package/dist/commands/switch.js.map +1 -1
- package/dist/commands/sync-playwright.js +7 -7
- package/dist/commands/sync-playwright.js.map +1 -1
- package/dist/commands/test.js +107 -111
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/trigger.js +74 -78
- package/dist/commands/trigger.js.map +1 -1
- package/dist/commands/whoami.js +2 -2
- package/dist/commands/whoami.js.map +1 -1
- package/dist/constructs/alert-channel-codegen.d.ts +35 -0
- package/dist/constructs/alert-channel-codegen.js +98 -0
- package/dist/constructs/alert-channel-codegen.js.map +1 -0
- package/dist/constructs/alert-channel-subscription-codegen.d.ts +11 -0
- package/dist/constructs/alert-channel-subscription-codegen.js +23 -0
- package/dist/constructs/alert-channel-subscription-codegen.js.map +1 -0
- package/dist/constructs/alert-channel-subscription.js +5 -1
- package/dist/constructs/alert-channel-subscription.js.map +1 -1
- package/dist/constructs/alert-channel.d.ts +17 -3
- package/dist/constructs/alert-channel.js +15 -4
- package/dist/constructs/alert-channel.js.map +1 -1
- package/dist/constructs/alert-escalation-policy-codegen.d.ts +4 -0
- package/dist/constructs/alert-escalation-policy-codegen.js +59 -0
- package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -0
- package/dist/constructs/alert-escalation-policy.js +8 -9
- package/dist/constructs/alert-escalation-policy.js.map +1 -1
- package/dist/constructs/api-check-codegen.d.ts +21 -0
- package/dist/constructs/api-check-codegen.js +163 -0
- package/dist/constructs/api-check-codegen.js.map +1 -0
- package/dist/constructs/api-check.js +9 -0
- package/dist/constructs/api-check.js.map +1 -1
- package/dist/constructs/browser-check-codegen.d.ts +14 -0
- package/dist/constructs/browser-check-codegen.js +48 -0
- package/dist/constructs/browser-check-codegen.js.map +1 -0
- package/dist/constructs/browser-check.js +12 -6
- package/dist/constructs/browser-check.js.map +1 -1
- package/dist/constructs/check-codegen.d.ts +42 -0
- package/dist/constructs/check-codegen.js +208 -0
- package/dist/constructs/check-codegen.js.map +1 -0
- package/dist/constructs/check-group-codegen.d.ts +45 -0
- package/dist/constructs/check-group-codegen.js +266 -0
- package/dist/constructs/check-group-codegen.js.map +1 -0
- package/dist/constructs/check-group.d.ts +21 -8
- package/dist/constructs/check-group.js +65 -15
- package/dist/constructs/check-group.js.map +1 -1
- package/dist/constructs/check.d.ts +8 -8
- package/dist/constructs/check.js +31 -14
- package/dist/constructs/check.js.map +1 -1
- package/dist/constructs/construct-codegen.d.ts +39 -0
- package/dist/constructs/construct-codegen.js +100 -0
- package/dist/constructs/construct-codegen.js.map +1 -0
- package/dist/constructs/construct.js +5 -1
- package/dist/constructs/construct.js.map +1 -1
- package/dist/constructs/dashboard-codegen.d.ts +29 -0
- package/dist/constructs/dashboard-codegen.js +108 -0
- package/dist/constructs/dashboard-codegen.js.map +1 -0
- package/dist/constructs/dashboard.js +23 -1
- package/dist/constructs/dashboard.js.map +1 -1
- package/dist/constructs/email-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/email-alert-channel-codegen.js +38 -0
- package/dist/constructs/email-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/email-alert-channel.js +1 -0
- package/dist/constructs/email-alert-channel.js.map +1 -1
- package/dist/constructs/frequency-codegen.d.ts +4 -0
- package/dist/constructs/frequency-codegen.js +49 -0
- package/dist/constructs/frequency-codegen.js.map +1 -0
- package/dist/constructs/frequency.js +17 -15
- package/dist/constructs/frequency.js.map +1 -1
- package/dist/constructs/heartbeat-check-codegen.d.ts +11 -0
- package/dist/constructs/heartbeat-check-codegen.js +33 -0
- package/dist/constructs/heartbeat-check-codegen.js.map +1 -0
- package/dist/constructs/heartbeat-check.js +1 -0
- package/dist/constructs/heartbeat-check.js.map +1 -1
- package/dist/constructs/incidentio-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/incidentio-alert-channel-codegen.js +89 -0
- package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/incidentio-alert-channel.d.ts +6 -0
- package/dist/constructs/incidentio-alert-channel.js +17 -16
- package/dist/constructs/incidentio-alert-channel.js.map +1 -1
- package/dist/constructs/internal/assertion-codegen.d.ts +4 -0
- package/dist/constructs/internal/assertion-codegen.js +141 -0
- package/dist/constructs/internal/assertion-codegen.js.map +1 -0
- package/dist/constructs/internal/assertion.js +7 -4
- package/dist/constructs/internal/assertion.js.map +1 -1
- package/dist/constructs/internal/codegen/codegen.d.ts +9 -0
- package/dist/constructs/internal/codegen/codegen.js +14 -0
- package/dist/constructs/internal/codegen/codegen.js.map +1 -0
- package/dist/constructs/internal/codegen/context.d.ts +62 -0
- package/dist/constructs/internal/codegen/context.js +445 -0
- package/dist/constructs/internal/codegen/context.js.map +1 -0
- package/dist/constructs/internal/codegen/index.d.ts +4 -0
- package/dist/constructs/internal/codegen/index.js +13 -0
- package/dist/constructs/internal/codegen/index.js.map +1 -0
- package/dist/constructs/internal/codegen/safety.d.ts +2 -0
- package/dist/constructs/internal/codegen/safety.js +7 -0
- package/dist/constructs/internal/codegen/safety.js.map +1 -0
- package/dist/constructs/internal/codegen/snippet.d.ts +12 -0
- package/dist/constructs/internal/codegen/snippet.js +48 -0
- package/dist/constructs/internal/codegen/snippet.js.map +1 -0
- package/dist/constructs/key-value-pair-codegen.d.ts +4 -0
- package/dist/constructs/key-value-pair-codegen.js +39 -0
- package/dist/constructs/key-value-pair-codegen.js.map +1 -0
- package/dist/constructs/maintenance-window-codegen.d.ts +14 -0
- package/dist/constructs/maintenance-window-codegen.js +57 -0
- package/dist/constructs/maintenance-window-codegen.js.map +1 -0
- package/dist/constructs/maintenance-window.js +8 -1
- package/dist/constructs/maintenance-window.js.map +1 -1
- package/dist/constructs/msteams-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/msteams-alert-channel-codegen.js +75 -0
- package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/msteams-alert-channel.d.ts +6 -0
- package/dist/constructs/msteams-alert-channel.js +14 -13
- package/dist/constructs/msteams-alert-channel.js.map +1 -1
- package/dist/constructs/multi-step-check-codegen.d.ts +13 -0
- package/dist/constructs/multi-step-check-codegen.js +39 -0
- package/dist/constructs/multi-step-check-codegen.js.map +1 -0
- package/dist/constructs/multi-step-check.js +8 -8
- package/dist/constructs/multi-step-check.js.map +1 -1
- package/dist/constructs/opsgenie-alert-channel-codegen.d.ts +16 -0
- package/dist/constructs/opsgenie-alert-channel-codegen.js +41 -0
- package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/opsgenie-alert-channel.js +4 -0
- package/dist/constructs/opsgenie-alert-channel.js.map +1 -1
- package/dist/constructs/pagerduty-alert-channel-codegen.d.ts +15 -0
- package/dist/constructs/pagerduty-alert-channel-codegen.js +53 -0
- package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/pagerduty-alert-channel.js +3 -0
- package/dist/constructs/pagerduty-alert-channel.js.map +1 -1
- package/dist/constructs/phone-call-alert-channel-codegen.d.ts +14 -0
- package/dist/constructs/phone-call-alert-channel-codegen.js +46 -0
- package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/phone-call-alert-channel.js +2 -0
- package/dist/constructs/phone-call-alert-channel.js.map +1 -1
- package/dist/constructs/playwright-config-codegen.d.ts +4 -0
- package/dist/constructs/playwright-config-codegen.js +9 -0
- package/dist/constructs/playwright-config-codegen.js.map +1 -0
- package/dist/constructs/private-location-check-assignment-codegen.d.ts +10 -0
- package/dist/constructs/private-location-check-assignment-codegen.js +18 -0
- package/dist/constructs/private-location-check-assignment-codegen.js.map +1 -0
- package/dist/constructs/private-location-check-assignment.js +3 -1
- package/dist/constructs/private-location-check-assignment.js.map +1 -1
- package/dist/constructs/private-location-codegen.d.ts +15 -0
- package/dist/constructs/private-location-codegen.js +51 -0
- package/dist/constructs/private-location-codegen.js.map +1 -0
- package/dist/constructs/private-location-group-assignment-codegen.d.ts +10 -0
- package/dist/constructs/private-location-group-assignment-codegen.js +18 -0
- package/dist/constructs/private-location-group-assignment-codegen.js.map +1 -0
- package/dist/constructs/private-location-group-assignment.js +3 -1
- package/dist/constructs/private-location-group-assignment.js.map +1 -1
- package/dist/constructs/private-location.d.ts +8 -4
- package/dist/constructs/private-location.js +14 -4
- package/dist/constructs/private-location.js.map +1 -1
- package/dist/constructs/project.d.ts +10 -0
- package/dist/constructs/project.js +74 -18
- package/dist/constructs/project.js.map +1 -1
- package/dist/constructs/ref-codegen.d.ts +3 -0
- package/dist/constructs/ref-codegen.js +15 -0
- package/dist/constructs/ref-codegen.js.map +1 -0
- package/dist/constructs/ref.js +1 -0
- package/dist/constructs/ref.js.map +1 -1
- package/dist/constructs/retry-strategy-codegen.d.ts +4 -0
- package/dist/constructs/retry-strategy-codegen.js +69 -0
- package/dist/constructs/retry-strategy-codegen.js.map +1 -0
- package/dist/constructs/retry-strategy.js +8 -9
- package/dist/constructs/retry-strategy.js.map +1 -1
- package/dist/constructs/slack-alert-channel-codegen.d.ts +14 -0
- package/dist/constructs/slack-alert-channel-codegen.js +46 -0
- package/dist/constructs/slack-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/slack-alert-channel.js +2 -0
- package/dist/constructs/slack-alert-channel.js.map +1 -1
- package/dist/constructs/sms-alert-channel-codegen.d.ts +14 -0
- package/dist/constructs/sms-alert-channel-codegen.js +46 -0
- package/dist/constructs/sms-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/sms-alert-channel.js +2 -0
- package/dist/constructs/sms-alert-channel.js.map +1 -1
- package/dist/constructs/status-page-codegen.d.ts +23 -0
- package/dist/constructs/status-page-codegen.js +71 -0
- package/dist/constructs/status-page-codegen.js.map +1 -0
- package/dist/constructs/status-page-service-codegen.d.ts +12 -0
- package/dist/constructs/status-page-service-codegen.js +44 -0
- package/dist/constructs/status-page-service-codegen.js.map +1 -0
- package/dist/constructs/status-page-service.d.ts +10 -0
- package/dist/constructs/status-page-service.js +21 -2
- package/dist/constructs/status-page-service.js.map +1 -1
- package/dist/constructs/status-page.js +15 -9
- package/dist/constructs/status-page.js.map +1 -1
- package/dist/constructs/tcp-check-codegen.d.ts +15 -0
- package/dist/constructs/tcp-check-codegen.js +69 -0
- package/dist/constructs/tcp-check-codegen.js.map +1 -0
- package/dist/constructs/tcp-check.js +3 -0
- package/dist/constructs/tcp-check.js.map +1 -1
- package/dist/constructs/telegram-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/telegram-alert-channel-codegen.js +105 -0
- package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/telegram-alert-channel.d.ts +6 -0
- package/dist/constructs/telegram-alert-channel.js +8 -4
- package/dist/constructs/telegram-alert-channel.js.map +1 -1
- package/dist/constructs/webhook-alert-channel-codegen.d.ts +34 -0
- package/dist/constructs/webhook-alert-channel-codegen.js +152 -0
- package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/webhook-alert-channel.js +8 -0
- package/dist/constructs/webhook-alert-channel.js.map +1 -1
- package/dist/help/help-extension.js +1 -2
- package/dist/help/help-extension.js.map +1 -1
- package/dist/helpers/command-style.d.ts +18 -0
- package/dist/helpers/command-style.js +87 -0
- package/dist/helpers/command-style.js.map +1 -0
- package/dist/helpers/wrap.d.ts +6 -0
- package/dist/helpers/wrap.js +53 -0
- package/dist/helpers/wrap.js.map +1 -0
- package/dist/loader/index.d.ts +6 -0
- package/dist/loader/index.js +21 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/loader/jiti.d.ts +27 -0
- package/dist/loader/jiti.js +63 -0
- package/dist/loader/jiti.js.map +1 -0
- package/dist/loader/loader.d.ts +29 -0
- package/dist/loader/loader.js +32 -0
- package/dist/loader/loader.js.map +1 -0
- package/dist/loader/match.d.ts +15 -0
- package/dist/loader/match.js +47 -0
- package/dist/loader/match.js.map +1 -0
- package/dist/loader/mixed.d.ts +7 -0
- package/dist/loader/mixed.js +39 -0
- package/dist/loader/mixed.js.map +1 -0
- package/dist/loader/native.d.ts +10 -0
- package/dist/loader/native.js +36 -0
- package/dist/loader/native.js.map +1 -0
- package/dist/loader/ts-node.d.ts +25 -0
- package/dist/loader/ts-node.js +85 -0
- package/dist/loader/ts-node.js.map +1 -0
- package/dist/playwright/playwright-config-loader.d.ts +1 -1
- package/dist/playwright/playwright-config-loader.js +7 -4
- package/dist/playwright/playwright-config-loader.js.map +1 -1
- package/dist/playwright/playwright-config-template.js +1 -0
- package/dist/playwright/playwright-config-template.js.map +1 -1
- package/dist/reporters/abstract-list.js +10 -6
- package/dist/reporters/abstract-list.js.map +1 -1
- package/dist/reporters/github.js +13 -6
- package/dist/reporters/github.js.map +1 -1
- package/dist/reporters/json.js +7 -4
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/list.js +4 -6
- package/dist/reporters/list.js.map +1 -1
- package/dist/reporters/util.js +15 -20
- package/dist/reporters/util.js.map +1 -1
- package/dist/rest/accounts.js +1 -0
- package/dist/rest/accounts.js.map +1 -1
- package/dist/rest/api.js +3 -5
- package/dist/rest/api.js.map +1 -1
- package/dist/rest/assets.js +1 -0
- package/dist/rest/assets.js.map +1 -1
- package/dist/rest/checkly-storage.js +1 -0
- package/dist/rest/checkly-storage.js.map +1 -1
- package/dist/rest/environment-variables.js +1 -0
- package/dist/rest/environment-variables.js.map +1 -1
- package/dist/rest/heartbeat-checks.js +1 -0
- package/dist/rest/heartbeat-checks.js.map +1 -1
- package/dist/rest/locations.js +1 -0
- package/dist/rest/locations.js.map +1 -1
- package/dist/rest/private-locations.js +1 -0
- package/dist/rest/private-locations.js.map +1 -1
- package/dist/rest/projects.d.ts +69 -1
- package/dist/rest/projects.js +76 -4
- package/dist/rest/projects.js.map +1 -1
- package/dist/rest/runtimes.js +1 -0
- package/dist/rest/runtimes.js.map +1 -1
- package/dist/rest/test-sessions.js +1 -0
- package/dist/rest/test-sessions.js.map +1 -1
- package/dist/rest/users.js +1 -0
- package/dist/rest/users.js.map +1 -1
- package/dist/services/abstract-check-runner.js +10 -0
- package/dist/services/abstract-check-runner.js.map +1 -1
- package/dist/services/check-parser/collector.js +6 -4
- package/dist/services/check-parser/collector.js.map +1 -1
- package/dist/services/check-parser/errors.js +4 -0
- package/dist/services/check-parser/errors.js.map +1 -1
- package/dist/services/check-parser/package-files/extension.js +2 -0
- package/dist/services/check-parser/package-files/extension.js.map +1 -1
- package/dist/services/check-parser/package-files/jsconfig-json-file.js +5 -22
- package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -1
- package/dist/services/check-parser/package-files/json-source-file.d.ts +1 -1
- package/dist/services/check-parser/package-files/json-source-file.js +5 -17
- package/dist/services/check-parser/package-files/json-source-file.js.map +1 -1
- package/dist/services/check-parser/package-files/loader.js +2 -1
- package/dist/services/check-parser/package-files/loader.js.map +1 -1
- package/dist/services/check-parser/package-files/lookup.js +3 -17
- package/dist/services/check-parser/package-files/lookup.js.map +1 -1
- package/dist/services/check-parser/package-files/package-json-file.d.ts +14 -1
- package/dist/services/check-parser/package-files/package-json-file.js +87 -19
- package/dist/services/check-parser/package-files/package-json-file.js.map +1 -1
- package/dist/services/check-parser/package-files/package-manager.d.ts +91 -0
- package/dist/services/check-parser/package-files/package-manager.js +321 -0
- package/dist/services/check-parser/package-files/package-manager.js.map +1 -0
- package/dist/services/check-parser/package-files/paths.js +39 -0
- package/dist/services/check-parser/package-files/paths.js.map +1 -1
- package/dist/services/check-parser/package-files/resolver.d.ts +6 -3
- package/dist/services/check-parser/package-files/resolver.js +58 -50
- package/dist/services/check-parser/package-files/resolver.js.map +1 -1
- package/dist/services/check-parser/package-files/source-file.d.ts +1 -1
- package/dist/services/check-parser/package-files/source-file.js +8 -17
- package/dist/services/check-parser/package-files/source-file.js.map +1 -1
- package/dist/services/check-parser/package-files/tsconfig-json-file.js +16 -27
- package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -1
- package/dist/services/check-parser/parser.js +18 -11
- package/dist/services/check-parser/parser.js.map +1 -1
- package/dist/services/checkly-config-codegen.d.ts +4 -0
- package/dist/services/checkly-config-codegen.js +196 -0
- package/dist/services/checkly-config-codegen.js.map +1 -0
- package/dist/services/checkly-config-loader.d.ts +6 -2
- package/dist/services/checkly-config-loader.js +27 -12
- package/dist/services/checkly-config-loader.js.map +1 -1
- package/dist/services/config.js +5 -6
- package/dist/services/config.js.map +1 -1
- package/dist/services/project-parser.js +5 -12
- package/dist/services/project-parser.js.map +1 -1
- package/dist/services/snapshot-service.js +2 -2
- package/dist/services/snapshot-service.js.map +1 -1
- package/dist/services/test-filters.js +1 -1
- package/dist/services/test-filters.js.map +1 -1
- package/dist/services/test-runner.js +12 -5
- package/dist/services/test-runner.js.map +1 -1
- package/dist/services/trigger-runner.js +12 -5
- package/dist/services/trigger-runner.js.map +1 -1
- package/dist/services/util.d.ts +0 -1
- package/dist/services/util.js +12 -107
- package/dist/services/util.js.map +1 -1
- package/dist/sourcegen/args.d.ts +7 -0
- package/dist/sourcegen/args.js +26 -0
- package/dist/sourcegen/args.js.map +1 -0
- package/dist/sourcegen/argsbuilder.d.ts +22 -0
- package/dist/sourcegen/argsbuilder.js +111 -0
- package/dist/sourcegen/argsbuilder.js.map +1 -0
- package/dist/sourcegen/array.d.ts +8 -0
- package/dist/sourcegen/array.js +32 -0
- package/dist/sourcegen/array.js.map +1 -0
- package/dist/sourcegen/arraybuilder.d.ts +21 -0
- package/dist/sourcegen/arraybuilder.js +109 -0
- package/dist/sourcegen/arraybuilder.js.map +1 -0
- package/dist/sourcegen/boolean.d.ts +7 -0
- package/dist/sourcegen/boolean.js +22 -0
- package/dist/sourcegen/boolean.js.map +1 -0
- package/dist/sourcegen/case.d.ts +9 -0
- package/dist/sourcegen/case.js +107 -0
- package/dist/sourcegen/case.js.map +1 -0
- package/dist/sourcegen/comment.d.ts +32 -0
- package/dist/sourcegen/comment.js +124 -0
- package/dist/sourcegen/comment.js.map +1 -0
- package/dist/sourcegen/decl.d.ts +43 -0
- package/dist/sourcegen/decl.js +95 -0
- package/dist/sourcegen/decl.js.map +1 -0
- package/dist/sourcegen/declbuilder.d.ts +14 -0
- package/dist/sourcegen/declbuilder.js +39 -0
- package/dist/sourcegen/declbuilder.js.map +1 -0
- package/dist/sourcegen/expr.d.ts +39 -0
- package/dist/sourcegen/expr.js +86 -0
- package/dist/sourcegen/expr.js.map +1 -0
- package/dist/sourcegen/exprbuilder.d.ts +13 -0
- package/dist/sourcegen/exprbuilder.js +54 -0
- package/dist/sourcegen/exprbuilder.js.map +1 -0
- package/dist/sourcegen/identifier.d.ts +12 -0
- package/dist/sourcegen/identifier.js +27 -0
- package/dist/sourcegen/identifier.js.map +1 -0
- package/dist/sourcegen/index.d.ts +22 -0
- package/dist/sourcegen/index.js +76 -0
- package/dist/sourcegen/index.js.map +1 -0
- package/dist/sourcegen/null.d.ts +5 -0
- package/dist/sourcegen/null.js +11 -0
- package/dist/sourcegen/null.js.map +1 -0
- package/dist/sourcegen/number.d.ts +7 -0
- package/dist/sourcegen/number.js +22 -0
- package/dist/sourcegen/number.js.map +1 -0
- package/dist/sourcegen/object.d.ts +28 -0
- package/dist/sourcegen/object.js +88 -0
- package/dist/sourcegen/object.js.map +1 -0
- package/dist/sourcegen/objectbuilder.d.ts +25 -0
- package/dist/sourcegen/objectbuilder.js +127 -0
- package/dist/sourcegen/objectbuilder.js.map +1 -0
- package/dist/sourcegen/output.d.ts +14 -0
- package/dist/sourcegen/output.js +85 -0
- package/dist/sourcegen/output.js.map +1 -0
- package/dist/sourcegen/program.d.ts +55 -0
- package/dist/sourcegen/program.js +284 -0
- package/dist/sourcegen/program.js.map +1 -0
- package/dist/sourcegen/string.d.ts +8 -0
- package/dist/sourcegen/string.js +28 -0
- package/dist/sourcegen/string.js.map +1 -0
- package/dist/sourcegen/undefined.d.ts +5 -0
- package/dist/sourcegen/undefined.js +11 -0
- package/dist/sourcegen/undefined.js.map +1 -0
- package/dist/sourcegen/unknown.d.ts +2 -0
- package/dist/sourcegen/unknown.js +40 -0
- package/dist/sourcegen/unknown.js.map +1 -0
- package/dist/sourcegen/value.d.ts +4 -0
- package/dist/sourcegen/value.js +7 -0
- package/dist/sourcegen/value.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util/index.d.ts +9 -0
- package/dist/util/index.js +27 -0
- package/dist/util/index.js.map +1 -0
- package/oclif.manifest.json +173 -1
- package/package.json +14 -37
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanValue = void 0;
|
|
4
|
+
const value_1 = require("./value");
|
|
5
|
+
class BooleanValue extends value_1.Value {
|
|
6
|
+
value;
|
|
7
|
+
constructor(value) {
|
|
8
|
+
super();
|
|
9
|
+
if (value === null) {
|
|
10
|
+
throw new Error('Boolean value cannot be null');
|
|
11
|
+
}
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
throw new Error('Boolean value cannot be undefined');
|
|
14
|
+
}
|
|
15
|
+
this.value = value;
|
|
16
|
+
}
|
|
17
|
+
render(output) {
|
|
18
|
+
output.append(this.value.toString());
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.BooleanValue = BooleanValue;
|
|
22
|
+
//# sourceMappingURL=boolean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../src/sourcegen/boolean.ts"],"names":[],"mappings":";;;AACA,mCAA+B;AAE/B,MAAa,YAAa,SAAQ,aAAK;IACrC,KAAK,CAAS;IAEd,YAAa,KAAc;QACzB,KAAK,EAAE,CAAA;QAEP,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;QACjD,CAAC;QAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;QACtD,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IACtC,CAAC;CACF;AApBD,oCAoBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type CaseFormat = 'identity' | 'camelCase' | 'PascalCase' | 'Train-Case' | 'snake_case' | 'SCREAMING_SNAKE_CASE' | 'kebab-case' | 'SCREAMING-KEBAB-CASE';
|
|
2
|
+
export declare function camelCase(value: string): string;
|
|
3
|
+
export declare function pascalCase(value: string): string;
|
|
4
|
+
export declare function trainCase(value: string): string;
|
|
5
|
+
export declare function snakeCase(value: string): string;
|
|
6
|
+
export declare function screamingSnakeCase(value: string): string;
|
|
7
|
+
export declare function kebabCase(value: string): string;
|
|
8
|
+
export declare function screamingKebabCase(value: string): string;
|
|
9
|
+
export declare function cased(value: string, format: CaseFormat): string;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cased = exports.screamingKebabCase = exports.kebabCase = exports.screamingSnakeCase = exports.snakeCase = exports.trainCase = exports.pascalCase = exports.camelCase = void 0;
|
|
4
|
+
function camelCase(value) {
|
|
5
|
+
return wordify(value).map((word, index) => {
|
|
6
|
+
if (index === 0) {
|
|
7
|
+
return word.toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
const initial = word.slice(0, 1).toUpperCase();
|
|
10
|
+
const rest = word.slice(1).toLowerCase();
|
|
11
|
+
return initial + rest;
|
|
12
|
+
}).join('');
|
|
13
|
+
}
|
|
14
|
+
exports.camelCase = camelCase;
|
|
15
|
+
function pascalCase(value) {
|
|
16
|
+
return wordify(value).map(word => {
|
|
17
|
+
const initial = word.slice(0, 1).toUpperCase();
|
|
18
|
+
const rest = word.slice(1).toLowerCase();
|
|
19
|
+
return initial + rest;
|
|
20
|
+
}).join('');
|
|
21
|
+
}
|
|
22
|
+
exports.pascalCase = pascalCase;
|
|
23
|
+
function trainCase(value) {
|
|
24
|
+
return wordify(value).map(word => {
|
|
25
|
+
const initial = word.slice(0, 1).toUpperCase();
|
|
26
|
+
const rest = word.slice(1).toLowerCase();
|
|
27
|
+
return initial + rest;
|
|
28
|
+
}).join('-');
|
|
29
|
+
}
|
|
30
|
+
exports.trainCase = trainCase;
|
|
31
|
+
function snakeCase(value) {
|
|
32
|
+
return wordify(value).map(word => word.toLowerCase()).join('_');
|
|
33
|
+
}
|
|
34
|
+
exports.snakeCase = snakeCase;
|
|
35
|
+
function screamingSnakeCase(value) {
|
|
36
|
+
return wordify(value).map(word => word.toUpperCase()).join('_');
|
|
37
|
+
}
|
|
38
|
+
exports.screamingSnakeCase = screamingSnakeCase;
|
|
39
|
+
function kebabCase(value) {
|
|
40
|
+
return wordify(value).map(word => word.toLowerCase()).join('-');
|
|
41
|
+
}
|
|
42
|
+
exports.kebabCase = kebabCase;
|
|
43
|
+
function screamingKebabCase(value) {
|
|
44
|
+
return wordify(value).map(word => word.toUpperCase()).join('-');
|
|
45
|
+
}
|
|
46
|
+
exports.screamingKebabCase = screamingKebabCase;
|
|
47
|
+
function cased(value, format) {
|
|
48
|
+
switch (format) {
|
|
49
|
+
case 'identity':
|
|
50
|
+
return value;
|
|
51
|
+
case 'camelCase':
|
|
52
|
+
return camelCase(value);
|
|
53
|
+
case 'PascalCase':
|
|
54
|
+
return pascalCase(value);
|
|
55
|
+
case 'Train-Case':
|
|
56
|
+
return trainCase(value);
|
|
57
|
+
case 'snake_case':
|
|
58
|
+
return snakeCase(value);
|
|
59
|
+
case 'SCREAMING_SNAKE_CASE':
|
|
60
|
+
return screamingSnakeCase(value);
|
|
61
|
+
case 'kebab-case':
|
|
62
|
+
return kebabCase(value);
|
|
63
|
+
case 'SCREAMING-KEBAB-CASE':
|
|
64
|
+
return screamingKebabCase(value);
|
|
65
|
+
default:
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.cased = cased;
|
|
70
|
+
function wordify(value) {
|
|
71
|
+
const words = [];
|
|
72
|
+
let word = '';
|
|
73
|
+
let small = false;
|
|
74
|
+
for (const char of value.split('')) {
|
|
75
|
+
if (char >= 'a' && char <= 'z') {
|
|
76
|
+
word += char;
|
|
77
|
+
small = true;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (char >= '0' && char <= '9') {
|
|
81
|
+
word += char;
|
|
82
|
+
small = true;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (char >= 'A' && char <= 'Z') {
|
|
86
|
+
if (small) {
|
|
87
|
+
words.push(word);
|
|
88
|
+
word = char;
|
|
89
|
+
small = false;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
word += char;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (word.length !== 0) {
|
|
96
|
+
words.push(word);
|
|
97
|
+
word = '';
|
|
98
|
+
small = false;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (word.length !== 0) {
|
|
103
|
+
words.push(word);
|
|
104
|
+
}
|
|
105
|
+
return words;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.js","sourceRoot":"","sources":["../../src/sourcegen/case.ts"],"names":[],"mappings":";;;AAUA,SAAgB,SAAS,CAAE,KAAa;IACtC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACxC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;QAC3B,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;QAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;QACxC,OAAO,OAAO,GAAG,IAAI,CAAA;IACvB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE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C,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;YAC/B,IAAI,IAAI,IAAI,CAAA;YACZ,KAAK,GAAG,IAAI,CAAA;YACZ,SAAQ;QACV,CAAC;QAED,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;YAC/B,IAAI,IAAI,IAAI,CAAA;YACZ,KAAK,GAAG,IAAI,CAAA;YACZ,SAAQ;QACV,CAAC;QAED,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;YAC/B,IAAI,KAAK,EAAE,CAAC;gBACV,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBAChB,IAAI,GAAG,IAAI,CAAA;gBACX,KAAK,GAAG,KAAK,CAAA;gBACb,SAAQ;YACV,CAAC;YAED,IAAI,IAAI,IAAI,CAAA;YACZ,SAAQ;QACV,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChB,IAAI,GAAG,EAAE,CAAA;YACT,KAAK,GAAG,KAAK,CAAA;YACb,SAAQ;QACV,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Output } from './output';
|
|
2
|
+
import { Value } from './value';
|
|
3
|
+
export interface CommentValueOptions {
|
|
4
|
+
leading?: boolean;
|
|
5
|
+
newline?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class CommentValue extends Value {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(comment: Comment, value: Value, options?: CommentValueOptions);
|
|
10
|
+
render(output: Output): void;
|
|
11
|
+
}
|
|
12
|
+
export interface CommentOptions {
|
|
13
|
+
stylized?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare abstract class Comment {
|
|
16
|
+
comment: string;
|
|
17
|
+
options: CommentOptions;
|
|
18
|
+
constructor(comment: string, options?: CommentOptions);
|
|
19
|
+
abstract render(output: Output): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class BlockComment extends Comment {
|
|
22
|
+
render(output: Output): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function blockComment(comment: string, options?: CommentOptions): Comment;
|
|
25
|
+
export declare class LineComment extends Comment {
|
|
26
|
+
render(output: Output): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function lineComment(comment: string, options?: CommentOptions): Comment;
|
|
29
|
+
export declare class DocComment extends Comment {
|
|
30
|
+
render(output: Output): void;
|
|
31
|
+
}
|
|
32
|
+
export declare function docComment(comment: string, options?: CommentOptions): Comment;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.docComment = exports.DocComment = exports.lineComment = exports.LineComment = exports.blockComment = exports.BlockComment = exports.Comment = exports.CommentValue = void 0;
|
|
4
|
+
const value_1 = require("./value");
|
|
5
|
+
class CommentValue extends value_1.Value {
|
|
6
|
+
#comment;
|
|
7
|
+
#value;
|
|
8
|
+
#leading;
|
|
9
|
+
#newline;
|
|
10
|
+
constructor(comment, value, options) {
|
|
11
|
+
super();
|
|
12
|
+
this.#comment = comment;
|
|
13
|
+
this.#value = value;
|
|
14
|
+
this.#leading = options?.leading ?? false;
|
|
15
|
+
this.#newline = options?.newline ?? false;
|
|
16
|
+
}
|
|
17
|
+
render(output) {
|
|
18
|
+
if (this.#leading) {
|
|
19
|
+
this.#comment.render(output);
|
|
20
|
+
if (this.#newline) {
|
|
21
|
+
output.endLine();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
output.cosmeticWhitespace();
|
|
25
|
+
}
|
|
26
|
+
this.#value.render(output);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.#value.render(output);
|
|
30
|
+
if (this.#newline) {
|
|
31
|
+
output.endLine();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
output.cosmeticWhitespace();
|
|
35
|
+
}
|
|
36
|
+
this.#comment.render(output);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.CommentValue = CommentValue;
|
|
41
|
+
class Comment {
|
|
42
|
+
comment;
|
|
43
|
+
options;
|
|
44
|
+
constructor(comment, options) {
|
|
45
|
+
this.comment = comment;
|
|
46
|
+
this.options = {
|
|
47
|
+
stylized: true,
|
|
48
|
+
...options,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.Comment = Comment;
|
|
53
|
+
class BlockComment extends Comment {
|
|
54
|
+
render(output) {
|
|
55
|
+
if (this.options.stylized) {
|
|
56
|
+
const lines = this.comment.split('\n');
|
|
57
|
+
if (lines.length === 1) {
|
|
58
|
+
output.append('/*');
|
|
59
|
+
output.cosmeticWhitespace();
|
|
60
|
+
output.append(this.comment);
|
|
61
|
+
output.cosmeticWhitespace();
|
|
62
|
+
output.append('*/');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
output.append('/*');
|
|
66
|
+
output.endLine();
|
|
67
|
+
for (const line of lines) {
|
|
68
|
+
output.append(line);
|
|
69
|
+
output.endLine();
|
|
70
|
+
}
|
|
71
|
+
output.append('*/');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
output.append('/*');
|
|
76
|
+
output.append(this.comment);
|
|
77
|
+
output.append('*/');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.BlockComment = BlockComment;
|
|
82
|
+
function blockComment(comment, options) {
|
|
83
|
+
return new BlockComment(comment, options);
|
|
84
|
+
}
|
|
85
|
+
exports.blockComment = blockComment;
|
|
86
|
+
class LineComment extends Comment {
|
|
87
|
+
render(output) {
|
|
88
|
+
const lines = this.comment.split('\n');
|
|
89
|
+
for (const line of lines) {
|
|
90
|
+
output.append('//');
|
|
91
|
+
if (this.options.stylized) {
|
|
92
|
+
if (line.length !== 0) {
|
|
93
|
+
output.cosmeticWhitespace();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
output.append(line);
|
|
97
|
+
output.endLine();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.LineComment = LineComment;
|
|
102
|
+
function lineComment(comment, options) {
|
|
103
|
+
return new LineComment(comment, options);
|
|
104
|
+
}
|
|
105
|
+
exports.lineComment = lineComment;
|
|
106
|
+
class DocComment extends Comment {
|
|
107
|
+
render(output) {
|
|
108
|
+
const lines = this.comment.split('\n');
|
|
109
|
+
output.append('/**');
|
|
110
|
+
output.endLine();
|
|
111
|
+
for (const line of lines) {
|
|
112
|
+
output.append(' * ');
|
|
113
|
+
output.append(line);
|
|
114
|
+
output.endLine();
|
|
115
|
+
}
|
|
116
|
+
output.append(' */');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.DocComment = DocComment;
|
|
120
|
+
function docComment(comment, options) {
|
|
121
|
+
return new DocComment(comment, options);
|
|
122
|
+
}
|
|
123
|
+
exports.docComment = docComment;
|
|
124
|
+
//# sourceMappingURL=comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/sourcegen/comment.ts"],"names":[],"mappings":";;;AACA,mCAA+B;AAO/B,MAAa,YAAa,SAAQ,aAAK;IACrC,QAAQ,CAAS;IACjB,MAAM,CAAO;IACb,QAAQ,CAAS;IACjB,QAAQ,CAAS;IAEjB,YAAa,OAAgB,EAAE,KAAY,EAAE,OAA6B;QACxE,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAA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AAC,CAAA;YACnB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBAC1B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACtB,MAAM,CAAC,kBAAkB,EAAE,CAAA;gBAC7B,CAAC;YACH,CAAC;YACD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACnB,MAAM,CAAC,OAAO,EAAE,CAAA;QAClB,CAAC;IACH,CAAC;CACF;AAdD,kCAcC;AAED,SAAgB,WAAW,CAAE,OAAe,EAAE,OAAwB;IACpE,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAC1C,CAAC;AAFD,kCAEC;AAED,MAAa,UAAW,SAAQ,OAAO;IACrC,MAAM,CAAE,MAAc;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACtC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACpB,MAAM,CAAC,OAAO,EAAE,CAAA;QAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACnB,MAAM,CAAC,OAAO,EAAE,CAAA;QAClB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC;CACF;AAZD,gCAYC;AAED,SAAgB,UAAU,CAAE,OAAe,EAAE,OAAwB;IACnE,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzC,CAAC;AAFD,gCAEC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Comment } from './comment';
|
|
2
|
+
import { IdentifierValue } from './identifier';
|
|
3
|
+
import { Output } from './output';
|
|
4
|
+
import { Value } from './value';
|
|
5
|
+
export declare abstract class Declaration {
|
|
6
|
+
abstract render(output: Output): void;
|
|
7
|
+
}
|
|
8
|
+
export declare class IdentifierDeclaration extends Declaration {
|
|
9
|
+
identifier: IdentifierValue;
|
|
10
|
+
constructor(identifier: IdentifierValue);
|
|
11
|
+
render(output: Output): void;
|
|
12
|
+
}
|
|
13
|
+
export interface VariableDeclarationOptions {
|
|
14
|
+
mutable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class VariableDeclaration extends Declaration {
|
|
17
|
+
identifier: IdentifierValue;
|
|
18
|
+
value: Value;
|
|
19
|
+
options?: VariableDeclarationOptions;
|
|
20
|
+
constructor(identifier: IdentifierValue, value: Value, options?: VariableDeclarationOptions);
|
|
21
|
+
render(output: Output): void;
|
|
22
|
+
}
|
|
23
|
+
export interface ExportDeclarationOptions {
|
|
24
|
+
default?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare class ExportDeclaration extends Declaration {
|
|
27
|
+
decl: Declaration;
|
|
28
|
+
default: boolean;
|
|
29
|
+
constructor(decl: Declaration, options?: ExportDeclarationOptions);
|
|
30
|
+
render(output: Output): void;
|
|
31
|
+
}
|
|
32
|
+
export declare class LeadingCommentDeclaration extends Declaration {
|
|
33
|
+
decl: Declaration;
|
|
34
|
+
comment: Comment;
|
|
35
|
+
constructor(comment: Comment, decl: Declaration);
|
|
36
|
+
render(output: Output): void;
|
|
37
|
+
}
|
|
38
|
+
export declare class TrailingCommentDeclaration extends Declaration {
|
|
39
|
+
decl: Declaration;
|
|
40
|
+
comment: Comment;
|
|
41
|
+
constructor(comment: Comment, decl: Declaration);
|
|
42
|
+
render(output: Output): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrailingCommentDeclaration = exports.LeadingCommentDeclaration = exports.ExportDeclaration = exports.VariableDeclaration = exports.IdentifierDeclaration = exports.Declaration = void 0;
|
|
4
|
+
class Declaration {
|
|
5
|
+
}
|
|
6
|
+
exports.Declaration = Declaration;
|
|
7
|
+
class IdentifierDeclaration extends Declaration {
|
|
8
|
+
identifier;
|
|
9
|
+
constructor(identifier) {
|
|
10
|
+
super();
|
|
11
|
+
this.identifier = identifier;
|
|
12
|
+
}
|
|
13
|
+
render(output) {
|
|
14
|
+
this.identifier.render(output);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.IdentifierDeclaration = IdentifierDeclaration;
|
|
18
|
+
class VariableDeclaration extends Declaration {
|
|
19
|
+
identifier;
|
|
20
|
+
value;
|
|
21
|
+
options;
|
|
22
|
+
constructor(identifier, value, options) {
|
|
23
|
+
super();
|
|
24
|
+
this.identifier = identifier;
|
|
25
|
+
this.value = value;
|
|
26
|
+
this.options = options;
|
|
27
|
+
}
|
|
28
|
+
render(output) {
|
|
29
|
+
if (this.options?.mutable) {
|
|
30
|
+
output.append('let');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
output.append('const');
|
|
34
|
+
}
|
|
35
|
+
output.significantWhitespace();
|
|
36
|
+
this.identifier.render(output);
|
|
37
|
+
output.cosmeticWhitespace();
|
|
38
|
+
output.append('=');
|
|
39
|
+
output.cosmeticWhitespace();
|
|
40
|
+
this.value.render(output);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.VariableDeclaration = VariableDeclaration;
|
|
44
|
+
class ExportDeclaration extends Declaration {
|
|
45
|
+
decl;
|
|
46
|
+
default;
|
|
47
|
+
constructor(decl, options) {
|
|
48
|
+
super();
|
|
49
|
+
this.decl = decl;
|
|
50
|
+
this.default = options?.default ?? false;
|
|
51
|
+
}
|
|
52
|
+
render(output) {
|
|
53
|
+
output.append('export');
|
|
54
|
+
output.significantWhitespace();
|
|
55
|
+
if (this.default) {
|
|
56
|
+
output.append('default');
|
|
57
|
+
output.significantWhitespace();
|
|
58
|
+
}
|
|
59
|
+
this.decl.render(output);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.ExportDeclaration = ExportDeclaration;
|
|
63
|
+
class LeadingCommentDeclaration extends Declaration {
|
|
64
|
+
decl;
|
|
65
|
+
comment;
|
|
66
|
+
constructor(comment, decl) {
|
|
67
|
+
super();
|
|
68
|
+
this.decl = decl;
|
|
69
|
+
this.comment = comment;
|
|
70
|
+
}
|
|
71
|
+
render(output) {
|
|
72
|
+
this.comment.render(output);
|
|
73
|
+
output.endLine({
|
|
74
|
+
collapse: true,
|
|
75
|
+
});
|
|
76
|
+
this.decl.render(output);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.LeadingCommentDeclaration = LeadingCommentDeclaration;
|
|
80
|
+
class TrailingCommentDeclaration extends Declaration {
|
|
81
|
+
decl;
|
|
82
|
+
comment;
|
|
83
|
+
constructor(comment, decl) {
|
|
84
|
+
super();
|
|
85
|
+
this.decl = decl;
|
|
86
|
+
this.comment = comment;
|
|
87
|
+
}
|
|
88
|
+
render(output) {
|
|
89
|
+
this.decl.render(output);
|
|
90
|
+
output.cosmeticWhitespace();
|
|
91
|
+
this.comment.render(output);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.TrailingCommentDeclaration = TrailingCommentDeclaration;
|
|
95
|
+
//# sourceMappingURL=decl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decl.js","sourceRoot":"","sources":["../../src/sourcegen/decl.ts"],"names":[],"mappings":";;;AAKA,MAAsB,WAAW;CAEhC;AAFD,kCAEC;AAED,MAAa,qBAAsB,SAAQ,WAAW;IACpD,UAAU,CAAiB;IAE3B,YAAa,UAA2B;QACtC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC;CACF;AAXD,sDAWC;AAMD,MAAa,mBAAoB,SAAQ,WAAW;IAClD,UAAU,CAAiB;IAC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AAM,CAAC,qBAAqB,EAAE,CAAA;QAChC,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1B,CAAC;CACF;AAnBD,8CAmBC;AAED,MAAa,yBAA0B,SAAQ,WAAW;IACxD,IAAI,CAAa;IACjB,OAAO,CAAS;IAEhB,YAAa,OAAgB,EAAE,IAAiB;QAC9C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC3B,MAAM,CAAC,OAAO,CAAC;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1B,CAAC;CACF;AAjBD,8DAiBC;AAED,MAAa,0BAA2B,SAAQ,WAAW;IACzD,IAAI,CAAa;IACjB,OAAO,CAAS;IAEhB,YAAa,OAAgB,EAAE,IAAiB;QAC9C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACxB,MAAM,CAAC,kBAAkB,EAAE,CAAA;QAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;CACF;AAfD,gEAeC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Comment } from './comment';
|
|
2
|
+
import { Declaration, VariableDeclarationOptions, ExportDeclarationOptions } from './decl';
|
|
3
|
+
import { IdentifierValue } from './identifier';
|
|
4
|
+
import { Value } from './value';
|
|
5
|
+
export declare function decl(identifier: IdentifierValue, build: (builder: DeclarationBuilder) => void): Declaration;
|
|
6
|
+
export declare class DeclarationBuilder {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(identifier: IdentifierValue);
|
|
9
|
+
variable(value: Value, options?: VariableDeclarationOptions): this;
|
|
10
|
+
export(options?: ExportDeclarationOptions): this;
|
|
11
|
+
leadingComment(comment: Comment): this;
|
|
12
|
+
trailingComment(comment: Comment): this;
|
|
13
|
+
build(): Declaration;
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeclarationBuilder = exports.decl = void 0;
|
|
4
|
+
const decl_1 = require("./decl");
|
|
5
|
+
function decl(identifier, build) {
|
|
6
|
+
const builder = new DeclarationBuilder(identifier);
|
|
7
|
+
build(builder);
|
|
8
|
+
return builder.build();
|
|
9
|
+
}
|
|
10
|
+
exports.decl = decl;
|
|
11
|
+
class DeclarationBuilder {
|
|
12
|
+
#identifier;
|
|
13
|
+
#decl;
|
|
14
|
+
constructor(identifier) {
|
|
15
|
+
this.#identifier = identifier;
|
|
16
|
+
this.#decl = new decl_1.IdentifierDeclaration(identifier);
|
|
17
|
+
}
|
|
18
|
+
variable(value, options) {
|
|
19
|
+
this.#decl = new decl_1.VariableDeclaration(this.#identifier, value, options);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
export(options) {
|
|
23
|
+
this.#decl = new decl_1.ExportDeclaration(this.#decl, options);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
leadingComment(comment) {
|
|
27
|
+
this.#decl = new decl_1.LeadingCommentDeclaration(comment, this.#decl);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
trailingComment(comment) {
|
|
31
|
+
this.#decl = new decl_1.TrailingCommentDeclaration(comment, this.#decl);
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
build() {
|
|
35
|
+
return this.#decl;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.DeclarationBuilder = DeclarationBuilder;
|
|
39
|
+
//# sourceMappingURL=declbuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declbuilder.js","sourceRoot":"","sources":["../../src/sourcegen/declbuilder.ts"],"names":[],"mappings":";;;AACA,iCAAgN;AAIhN,SAAgB,IAAI,CAAE,UAA2B,EAAE,KAA4C;IAC7F,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAA;IAClD,KAAK,CAAC,OAAO,CAAC,CAAA;IACd,OAAO,OAAO,CAAC,KAAK,EAAE,CAAA;AACxB,CAAC;AAJD,oBAIC;AAED,MAAa,kBAAkB;IAC7B,WAAW,CAAiB;IAC5B,KAAK,CAAa;IAElB,YAAa,UAA2B;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAA;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,4BAAqB,CAAC,UAAU,CAAC,CAAA;IACpD,CAAC;IAED,QAAQ,CAAE,KAAY,EAAE,OAAoC;QAC1D,IAAI,CAAC,KAAK,GAAG,IAAI,0BAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;QACtE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAE,OAAkC;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,wBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QACvD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,cAAc,CAAE,OAAgB;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAC/D,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe,CAAE,OAAgB;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,iCAA0B,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAChE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;CACF;AAhCD,gDAgCC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ArgumentsValue } from './args';
|
|
2
|
+
import { Output } from './output';
|
|
3
|
+
import { Value } from './value';
|
|
4
|
+
export declare abstract class ExpressionValue extends Value {
|
|
5
|
+
}
|
|
6
|
+
export declare class NewExpressionValue extends ExpressionValue {
|
|
7
|
+
callee: Value;
|
|
8
|
+
args: ArgumentsValue;
|
|
9
|
+
constructor(callee: Value, args: ArgumentsValue);
|
|
10
|
+
render(output: Output): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class CallExpressionValue extends ExpressionValue {
|
|
13
|
+
callee: Value;
|
|
14
|
+
args: ArgumentsValue;
|
|
15
|
+
constructor(callee: Value, args: ArgumentsValue);
|
|
16
|
+
render(output: Output): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class MemberExpressionValue extends ExpressionValue {
|
|
19
|
+
object: Value;
|
|
20
|
+
property: Value;
|
|
21
|
+
constructor(object: Value, property: Value);
|
|
22
|
+
render(output: Output): void;
|
|
23
|
+
}
|
|
24
|
+
type BinaryOperator = '+' | '-' | '&&' | '||';
|
|
25
|
+
export declare class BinaryExpressionValue extends ExpressionValue {
|
|
26
|
+
left: Value;
|
|
27
|
+
right: Value;
|
|
28
|
+
op: BinaryOperator;
|
|
29
|
+
constructor(left: Value, right: Value, op: BinaryOperator);
|
|
30
|
+
render(output: Output): void;
|
|
31
|
+
}
|
|
32
|
+
type UnaryOperator = '!';
|
|
33
|
+
export declare class UnaryExpressionValue extends ExpressionValue {
|
|
34
|
+
value: Value;
|
|
35
|
+
op: UnaryOperator;
|
|
36
|
+
constructor(value: Value, op: UnaryOperator);
|
|
37
|
+
render(output: Output): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnaryExpressionValue = exports.BinaryExpressionValue = exports.MemberExpressionValue = exports.CallExpressionValue = exports.NewExpressionValue = exports.ExpressionValue = void 0;
|
|
4
|
+
const value_1 = require("./value");
|
|
5
|
+
class ExpressionValue extends value_1.Value {
|
|
6
|
+
}
|
|
7
|
+
exports.ExpressionValue = ExpressionValue;
|
|
8
|
+
class NewExpressionValue extends ExpressionValue {
|
|
9
|
+
callee;
|
|
10
|
+
args;
|
|
11
|
+
constructor(callee, args) {
|
|
12
|
+
super();
|
|
13
|
+
this.callee = callee;
|
|
14
|
+
this.args = args;
|
|
15
|
+
}
|
|
16
|
+
render(output) {
|
|
17
|
+
output.append('new');
|
|
18
|
+
output.significantWhitespace();
|
|
19
|
+
this.callee.render(output);
|
|
20
|
+
this.args.render(output);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.NewExpressionValue = NewExpressionValue;
|
|
24
|
+
class CallExpressionValue extends ExpressionValue {
|
|
25
|
+
callee;
|
|
26
|
+
args;
|
|
27
|
+
constructor(callee, args) {
|
|
28
|
+
super();
|
|
29
|
+
this.callee = callee;
|
|
30
|
+
this.args = args;
|
|
31
|
+
}
|
|
32
|
+
render(output) {
|
|
33
|
+
this.callee.render(output);
|
|
34
|
+
this.args.render(output);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.CallExpressionValue = CallExpressionValue;
|
|
38
|
+
class MemberExpressionValue extends ExpressionValue {
|
|
39
|
+
object;
|
|
40
|
+
property;
|
|
41
|
+
constructor(object, property) {
|
|
42
|
+
super();
|
|
43
|
+
this.object = object;
|
|
44
|
+
this.property = property;
|
|
45
|
+
}
|
|
46
|
+
render(output) {
|
|
47
|
+
this.object.render(output);
|
|
48
|
+
output.append('.');
|
|
49
|
+
this.property.render(output); // @TODO: . vs ['']
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.MemberExpressionValue = MemberExpressionValue;
|
|
53
|
+
class BinaryExpressionValue extends ExpressionValue {
|
|
54
|
+
left;
|
|
55
|
+
right;
|
|
56
|
+
op;
|
|
57
|
+
constructor(left, right, op) {
|
|
58
|
+
super();
|
|
59
|
+
this.left = left;
|
|
60
|
+
this.right = right;
|
|
61
|
+
this.op = op;
|
|
62
|
+
}
|
|
63
|
+
render(output) {
|
|
64
|
+
this.left.render(output);
|
|
65
|
+
output.cosmeticWhitespace();
|
|
66
|
+
output.append(this.op);
|
|
67
|
+
output.cosmeticWhitespace();
|
|
68
|
+
this.right.render(output);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.BinaryExpressionValue = BinaryExpressionValue;
|
|
72
|
+
class UnaryExpressionValue extends ExpressionValue {
|
|
73
|
+
value;
|
|
74
|
+
op;
|
|
75
|
+
constructor(value, op) {
|
|
76
|
+
super();
|
|
77
|
+
this.value = value;
|
|
78
|
+
this.op = op;
|
|
79
|
+
}
|
|
80
|
+
render(output) {
|
|
81
|
+
output.append(this.op);
|
|
82
|
+
this.value.render(output);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.UnaryExpressionValue = UnaryExpressionValue;
|
|
86
|
+
//# sourceMappingURL=expr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expr.js","sourceRoot":"","sources":["../../src/sourcegen/expr.ts"],"names":[],"mappings":";;;AAEA,mCAA+B;AAE/B,MAAsB,eAAgB,SAAQ,aAAK;CAClD;AADD,0CACC;AAED,MAAa,kBAAmB,SAAQ,eAAe;IACrD,MAAM,CAAO;IACb,IAAI,CAAgB;IAEpB,YAAa,MAAa,EAAE,IAAoB;QAC9C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,MAAM,CAAC,MAAM,CAA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AAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACxB,MAAM,CAAC,kBAAkB,EAAE,CAAA;QAC3B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACtB,MAAM,CAAC,kBAAkB,EAAE,CAAA;QAC3B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;CACF;AAnBD,sDAmBC;AAID,MAAa,oBAAqB,SAAQ,eAAe;IACvD,KAAK,CAAO;IACZ,EAAE,CAAe;IAEjB,YAAa,KAAY,EAAE,EAAiB;QAC1C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,MAAM,CAAE,MAAc;QACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC3B,CAAC;CACF;AAdD,oDAcC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ArgumentsValueBuilder } from './argsbuilder';
|
|
2
|
+
import { ExpressionValue } from './expr';
|
|
3
|
+
import { Value } from './value';
|
|
4
|
+
export declare function expr(context: Value, build: (builder: ExpressionValueBuilder) => void): ExpressionValue;
|
|
5
|
+
export declare class ExpressionValueBuilder {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(value: Value);
|
|
8
|
+
new(build: (builder: ArgumentsValueBuilder) => void): this;
|
|
9
|
+
call(build: (builder: ArgumentsValueBuilder) => void): this;
|
|
10
|
+
member(property: Value): this;
|
|
11
|
+
context(value: Value): this;
|
|
12
|
+
build(): ExpressionValue;
|
|
13
|
+
}
|