@hyperfixi/core 2.0.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.
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/dist/__test-utils__/context-builders.d.ts +42 -0
- package/dist/__test-utils__/error-testing.d.ts +18 -0
- package/dist/__test-utils__/index.d.ts +6 -0
- package/dist/__test-utils__/mock-types.d.ts +57 -0
- package/dist/__test-utils__/parser-context-mock.d.ts +7 -0
- package/dist/__test-utils__/parser-helpers.d.ts +38 -0
- package/dist/api/dom-processor.d.ts +17 -0
- package/dist/api/hyperscript-api.d.ts +68 -0
- package/dist/api/lokascript-api.d.ts +9 -0
- package/dist/ast-utils/analyzer.d.ts +19 -0
- package/dist/ast-utils/documentation.d.ts +8 -0
- package/dist/ast-utils/generator.d.ts +9 -0
- package/dist/ast-utils/index.d.ts +12 -0
- package/dist/ast-utils/index.js +3366 -0
- package/dist/ast-utils/index.mjs +3320 -0
- package/dist/ast-utils/interchange/from-core.d.ts +8 -0
- package/dist/ast-utils/interchange/index.d.ts +6 -0
- package/dist/ast-utils/interchange/lsp.d.ts +108 -0
- package/dist/ast-utils/interchange/to-core.d.ts +8 -0
- package/dist/ast-utils/interchange/types.d.ts +113 -0
- package/dist/ast-utils/query.d.ts +25 -0
- package/dist/ast-utils/transformer.d.ts +14 -0
- package/dist/ast-utils/types.d.ts +162 -0
- package/dist/ast-utils/visitor.d.ts +40 -0
- package/dist/behaviors/boosted.d.ts +29 -0
- package/dist/behaviors/history-swap.d.ts +24 -0
- package/dist/behaviors/index.d.ts +4 -0
- package/dist/behaviors/index.js +1149 -0
- package/dist/behaviors/index.mjs +1139 -0
- package/dist/bundle-generator/generator.d.ts +4 -0
- package/dist/bundle-generator/index.d.ts +6 -0
- package/dist/bundle-generator/index.js +2294 -0
- package/dist/bundle-generator/index.mjs +2271 -0
- package/dist/bundle-generator/parser-templates.d.ts +6 -0
- package/dist/bundle-generator/template-capabilities.d.ts +10 -0
- package/dist/bundle-generator/templates.d.ts +11 -0
- package/dist/bundle-generator/types.d.ts +34 -0
- package/dist/bundles/test-minimal.d.ts +3 -0
- package/dist/bundles/test-standard.d.ts +3 -0
- package/dist/chunks/bridge-I6ceoWxV.js +2 -0
- package/dist/chunks/browser-modular-Dv6PAV3c.js +2 -0
- package/dist/chunks/feature-eventsource-DWb514fy.js +2 -0
- package/dist/chunks/feature-sockets-3PFuvCVY.js +2 -0
- package/dist/chunks/feature-webworker-DTm_eh-E.js +2 -0
- package/dist/commands/advanced/async.d.ts +28 -0
- package/dist/commands/advanced/js.d.ts +28 -0
- package/dist/commands/animation/measure.d.ts +31 -0
- package/dist/commands/animation/settle.d.ts +26 -0
- package/dist/commands/animation/take.d.ts +28 -0
- package/dist/commands/animation/transition.d.ts +31 -0
- package/dist/commands/async/fetch.d.ts +44 -0
- package/dist/commands/async/wait.d.ts +41 -0
- package/dist/commands/behaviors/install.d.ts +41 -0
- package/dist/commands/content/append.d.ts +27 -0
- package/dist/commands/control-flow/break.d.ts +15 -0
- package/dist/commands/control-flow/continue.d.ts +15 -0
- package/dist/commands/control-flow/exit.d.ts +15 -0
- package/dist/commands/control-flow/halt.d.ts +25 -0
- package/dist/commands/control-flow/if.d.ts +45 -0
- package/dist/commands/control-flow/repeat.d.ts +35 -0
- package/dist/commands/control-flow/return.d.ts +23 -0
- package/dist/commands/control-flow/signal-base.d.ts +25 -0
- package/dist/commands/control-flow/throw.d.ts +22 -0
- package/dist/commands/control-flow/unless.d.ts +3 -0
- package/dist/commands/data/decrement.d.ts +3 -0
- package/dist/commands/data/default.d.ts +31 -0
- package/dist/commands/data/get.d.ts +23 -0
- package/dist/commands/data/increment.d.ts +25 -0
- package/dist/commands/data/set.d.ts +56 -0
- package/dist/commands/decorators/index.d.ts +30 -0
- package/dist/commands/dom/__tests__/add-standalone-helpers.d.ts +11 -0
- package/dist/commands/dom/add.d.ts +31 -0
- package/dist/commands/dom/dom-modification-base.d.ts +48 -0
- package/dist/commands/dom/hide.d.ts +12 -0
- package/dist/commands/dom/make.d.ts +21 -0
- package/dist/commands/dom/process-partials.d.ts +39 -0
- package/dist/commands/dom/put.d.ts +31 -0
- package/dist/commands/dom/remove.d.ts +33 -0
- package/dist/commands/dom/show.d.ts +13 -0
- package/dist/commands/dom/swap.d.ts +38 -0
- package/dist/commands/dom/toggle.d.ts +55 -0
- package/dist/commands/dom/visibility-base.d.ts +20 -0
- package/dist/commands/events/send.d.ts +3 -0
- package/dist/commands/events/trigger.d.ts +36 -0
- package/dist/commands/execution/call.d.ts +24 -0
- package/dist/commands/execution/pseudo-command.d.ts +42 -0
- package/dist/commands/helpers/attribute-manipulation.d.ts +11 -0
- package/dist/commands/helpers/batch-dom-operations.d.ts +12 -0
- package/dist/commands/helpers/class-manipulation.d.ts +11 -0
- package/dist/commands/helpers/condition-helpers.d.ts +4 -0
- package/dist/commands/helpers/dom-mutation.d.ts +15 -0
- package/dist/commands/helpers/duration-parsing.d.ts +8 -0
- package/dist/commands/helpers/element-property-access.d.ts +7 -0
- package/dist/commands/helpers/element-resolution.d.ts +17 -0
- package/dist/commands/helpers/error-helpers.d.ts +17 -0
- package/dist/commands/helpers/event-helpers.d.ts +13 -0
- package/dist/commands/helpers/event-waiting.d.ts +37 -0
- package/dist/commands/helpers/index.d.ts +32 -0
- package/dist/commands/helpers/input-validator.d.ts +23 -0
- package/dist/commands/helpers/loop-executor.d.ts +53 -0
- package/dist/commands/helpers/numeric-target-parser.d.ts +14 -0
- package/dist/commands/helpers/property-target.d.ts +30 -0
- package/dist/commands/helpers/selector-type-detection.d.ts +24 -0
- package/dist/commands/helpers/smart-element.d.ts +16 -0
- package/dist/commands/helpers/style-manipulation.d.ts +16 -0
- package/dist/commands/helpers/temporal-modifiers.d.ts +15 -0
- package/dist/commands/helpers/url-argument-parser.d.ts +10 -0
- package/dist/commands/helpers/url-validation.d.ts +7 -0
- package/dist/commands/helpers/variable-access.d.ts +10 -0
- package/dist/commands/helpers/visibility-target-parser.d.ts +11 -0
- package/dist/commands/index.d.ts +139 -0
- package/dist/commands/index.js +9186 -0
- package/dist/commands/index.mjs +9032 -0
- package/dist/commands/navigation/go.d.ts +35 -0
- package/dist/commands/navigation/push-url.d.ts +35 -0
- package/dist/commands/navigation/replace-url.d.ts +3 -0
- package/dist/commands/templates/render.d.ts +48 -0
- package/dist/commands/utility/beep.d.ts +32 -0
- package/dist/commands/utility/copy.d.ts +29 -0
- package/dist/commands/utility/log.d.ts +24 -0
- package/dist/commands/utility/pick.d.ts +26 -0
- package/dist/commands/utility/tell.d.ts +26 -0
- package/dist/compatibility/browser-bundle-animation-generated.d.ts +16 -0
- package/dist/compatibility/browser-bundle-classic-i18n.d.ts +63 -0
- package/dist/compatibility/browser-bundle-classic.d.ts +17 -0
- package/dist/compatibility/browser-bundle-forms-generated.d.ts +16 -0
- package/dist/compatibility/browser-bundle-hybrid-complete.d.ts +28 -0
- package/dist/compatibility/browser-bundle-hybrid-hx.d.ts +43 -0
- package/dist/compatibility/browser-bundle-lite-plus.d.ts +25 -0
- package/dist/compatibility/browser-bundle-lite.d.ts +23 -0
- package/dist/compatibility/browser-bundle-minimal-generated.d.ts +16 -0
- package/dist/compatibility/browser-bundle-minimal-v2.d.ts +17 -0
- package/dist/compatibility/browser-bundle-minimal.d.ts +8 -0
- package/dist/compatibility/browser-bundle-modular.d.ts +18 -0
- package/dist/compatibility/browser-bundle-multilingual.d.ts +19 -0
- package/dist/compatibility/browser-bundle-semantic-complete.d.ts +24 -0
- package/dist/compatibility/browser-bundle-standard-v2.d.ts +17 -0
- package/dist/compatibility/browser-bundle-standard.d.ts +8 -0
- package/dist/compatibility/browser-bundle-textshelf-minimal.d.ts +16 -0
- package/dist/compatibility/browser-bundle-textshelf-profile.d.ts +18 -0
- package/dist/compatibility/browser-bundle.d.ts +140 -0
- package/dist/compatibility/browser-modular.d.ts +53 -0
- package/dist/compatibility/browser-tests/test-utils.d.ts +21 -0
- package/dist/compatibility/eval-hyperscript.d.ts +15 -0
- package/dist/compatibility/feature-loader.d.ts +8 -0
- package/dist/compatibility/hyperscript-adapter.d.ts +38 -0
- package/dist/compatibility/hyperscript-tests/test-adapter.d.ts +13 -0
- package/dist/core/ast-property-utils.d.ts +2 -0
- package/dist/core/base-expression-evaluator.d.ts +70 -0
- package/dist/core/binary-expression-evaluator.d.ts +7 -0
- package/dist/core/call-expression-evaluator.d.ts +7 -0
- package/dist/core/configurable-expression-evaluator.d.ts +5 -0
- package/dist/core/context.d.ts +15 -0
- package/dist/core/dom.d.ts +15 -0
- package/dist/core/evaluator-types.d.ts +5 -0
- package/dist/core/events.d.ts +48 -0
- package/dist/core/executor.d.ts +34 -0
- package/dist/core/expression-evaluator.d.ts +6 -0
- package/dist/core/lazy-expression-evaluator.d.ts +22 -0
- package/dist/core/parser.d.ts +21 -0
- package/dist/core/selector-evaluator.d.ts +15 -0
- package/dist/core/template-literal-evaluator.d.ts +5 -0
- package/dist/dom/attribute-processor.d.ts +40 -0
- package/dist/dom/minimal-attribute-processor.d.ts +20 -0
- package/dist/experimental/binary-tree/accessor.d.ts +10 -0
- package/dist/experimental/binary-tree/ast-serializer.d.ts +26 -0
- package/dist/experimental/binary-tree/benchmark.d.ts +24 -0
- package/dist/experimental/binary-tree/buffer-context.d.ts +27 -0
- package/dist/experimental/binary-tree/deserializer.d.ts +17 -0
- package/dist/experimental/binary-tree/index.d.ts +22 -0
- package/dist/experimental/binary-tree/serializer.d.ts +4 -0
- package/dist/experimental/binary-tree/types.d.ts +54 -0
- package/dist/expressions/base-expression.d.ts +27 -0
- package/dist/expressions/bundles/common-expressions.d.ts +9 -0
- package/dist/expressions/bundles/core-expressions.d.ts +7 -0
- package/dist/expressions/bundles/full-expressions.d.ts +10 -0
- package/dist/expressions/bundles/index.d.ts +7 -0
- package/dist/expressions/comparison/index.d.ts +80 -0
- package/dist/expressions/comparison/utils.d.ts +2 -0
- package/dist/expressions/conversion/impl/bridge.d.ts +117 -0
- package/dist/expressions/conversion/impl/index.d.ts +59 -0
- package/dist/expressions/conversion/index.d.ts +23 -0
- package/dist/expressions/expression-tiers.d.ts +13 -0
- package/dist/expressions/index.d.ts +11 -0
- package/dist/expressions/index.js +6930 -0
- package/dist/expressions/index.mjs +6912 -0
- package/dist/expressions/logical/impl/index.d.ts +54 -0
- package/dist/expressions/logical/impl/pattern-matching.d.ts +58 -0
- package/dist/expressions/logical/index.d.ts +59 -0
- package/dist/expressions/mathematical/index.d.ts +69 -0
- package/dist/expressions/positional/impl/bridge.d.ts +95 -0
- package/dist/expressions/positional/impl/index.d.ts +73 -0
- package/dist/expressions/positional/index.d.ts +26 -0
- package/dist/expressions/properties/impl/index.d.ts +105 -0
- package/dist/expressions/properties/index.d.ts +26 -0
- package/dist/expressions/property/index.d.ts +55 -0
- package/dist/expressions/property-access-utils.d.ts +23 -0
- package/dist/expressions/references/impl/bridge.d.ts +54 -0
- package/dist/expressions/references/impl/index.d.ts +65 -0
- package/dist/expressions/references/index.d.ts +40 -0
- package/dist/expressions/shared/comparison-utils.d.ts +10 -0
- package/dist/expressions/shared/index.d.ts +9 -0
- package/dist/expressions/shared/number-utils.d.ts +7 -0
- package/dist/expressions/shared/validation-utils.d.ts +13 -0
- package/dist/expressions/special/index.d.ts +104 -0
- package/dist/expressions/type-helpers.d.ts +11 -0
- package/dist/expressions/type-registry.d.ts +57 -0
- package/dist/expressions/validation-helpers.d.ts +15 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/tailwind.d.ts +22 -0
- package/dist/features/behaviors.d.ts +153 -0
- package/dist/features/def.d.ts +135 -0
- package/dist/features/eventsource.d.ts +140 -0
- package/dist/features/init.d.ts +135 -0
- package/dist/features/on.d.ts +131 -0
- package/dist/features/predefined-behaviors/dropdown-behavior.d.ts +20 -0
- package/dist/features/predefined-behaviors/index.d.ts +12 -0
- package/dist/features/predefined-behaviors/modal-behavior.d.ts +18 -0
- package/dist/features/predefined-behaviors/toggle-group-behavior.d.ts +23 -0
- package/dist/features/predefined-behaviors/types.d.ts +14 -0
- package/dist/features/sockets.d.ts +162 -0
- package/dist/features/webworker.d.ts +135 -0
- package/dist/htmx/htmx-attribute-processor.d.ts +84 -0
- package/dist/htmx/htmx-translator.d.ts +19 -0
- package/dist/htmx/index.d.ts +3 -0
- package/dist/hyperfixi-classic-i18n.js +2 -0
- package/dist/hyperfixi-hx.js +1 -0
- package/dist/hyperfixi-hybrid-complete.js +1 -0
- package/dist/hyperfixi-lite-plus.js +1 -0
- package/dist/hyperfixi-lite.js +1 -0
- package/dist/hyperfixi-minimal.js +1 -0
- package/dist/hyperfixi-multilingual.js +2 -0
- package/dist/hyperfixi-standard.js +2 -0
- package/dist/hyperfixi.js +2 -0
- package/dist/hyperfixi.mjs +2 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +65387 -0
- package/dist/index.min.js +2 -0
- package/dist/index.mjs +65343 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/morph-adapter.d.ts +22 -0
- package/dist/lib/swap-executor.d.ts +22 -0
- package/dist/lib/view-transitions.d.ts +33 -0
- package/dist/lokascript-browser-classic-i18n.js +2 -0
- package/dist/lokascript-browser-minimal.js +1 -0
- package/dist/lokascript-browser-standard.js +2 -0
- package/dist/lokascript-browser.js +2 -0
- package/dist/lokascript-hybrid-complete.js +1 -0
- package/dist/lokascript-hybrid-hx.js +1 -0
- package/dist/lokascript-lite-plus.js +1 -0
- package/dist/lokascript-lite.js +1 -0
- package/dist/lokascript-multilingual.js +2 -0
- package/dist/lsp-metadata.d.ts +25 -0
- package/dist/lsp-metadata.js +680 -0
- package/dist/lsp-metadata.mjs +670 -0
- package/dist/metadata.d.ts +213 -0
- package/dist/metadata.js +378 -0
- package/dist/metadata.mjs +368 -0
- package/dist/mod.d.ts +63 -0
- package/dist/multilingual/bridge.d.ts +36 -0
- package/dist/multilingual/index.d.ts +32 -0
- package/dist/multilingual/index.js +285 -0
- package/dist/multilingual/index.mjs +278 -0
- package/dist/parser/__types__/test-helpers.d.ts +25 -0
- package/dist/parser/command-node-builder.d.ts +45 -0
- package/dist/parser/command-parsers/animation-commands.d.ts +5 -0
- package/dist/parser/command-parsers/async-commands.d.ts +5 -0
- package/dist/parser/command-parsers/control-flow-commands.d.ts +7 -0
- package/dist/parser/command-parsers/dom-commands.d.ts +8 -0
- package/dist/parser/command-parsers/event-commands.d.ts +4 -0
- package/dist/parser/command-parsers/utility-commands.d.ts +9 -0
- package/dist/parser/command-parsers/variable-commands.d.ts +12 -0
- package/dist/parser/error-handler.d.ts +34 -0
- package/dist/parser/expression-parser.d.ts +6 -0
- package/dist/parser/full-parser.d.ts +4 -0
- package/dist/parser/full-parser.js +6532 -0
- package/dist/parser/full-parser.mjs +6529 -0
- package/dist/parser/helpers/ast-helpers.d.ts +22 -0
- package/dist/parser/helpers/parsing-helpers.d.ts +19 -0
- package/dist/parser/helpers/token-helpers.d.ts +28 -0
- package/dist/parser/hybrid/aliases.d.ts +7 -0
- package/dist/parser/hybrid/aliases.js +44 -0
- package/dist/parser/hybrid/aliases.mjs +37 -0
- package/dist/parser/hybrid/ast-types.d.ts +97 -0
- package/dist/parser/hybrid/ast-types.js +3 -0
- package/dist/parser/hybrid/ast-types.mjs +2 -0
- package/dist/parser/hybrid/index.d.ts +6 -0
- package/dist/parser/hybrid/index.js +1015 -0
- package/dist/parser/hybrid/index.mjs +1005 -0
- package/dist/parser/hybrid/parser-core.d.ts +57 -0
- package/dist/parser/hybrid/parser-core.js +1001 -0
- package/dist/parser/hybrid/parser-core.mjs +999 -0
- package/dist/parser/hybrid/tokenizer.d.ts +9 -0
- package/dist/parser/hybrid/tokenizer.js +242 -0
- package/dist/parser/hybrid/tokenizer.mjs +239 -0
- package/dist/parser/hybrid-parser.d.ts +10 -0
- package/dist/parser/hybrid-parser.js +1078 -0
- package/dist/parser/hybrid-parser.mjs +1071 -0
- package/dist/parser/parser-constants.d.ts +102 -0
- package/dist/parser/parser-interface.d.ts +11 -0
- package/dist/parser/parser-types.d.ts +175 -0
- package/dist/parser/parser.d.ts +146 -0
- package/dist/parser/regex-parser.d.ts +4 -0
- package/dist/parser/regex-parser.js +412 -0
- package/dist/parser/regex-parser.mjs +409 -0
- package/dist/parser/runtime.d.ts +3 -0
- package/dist/parser/semantic-integration.d.ts +61 -0
- package/dist/parser/token-consumer.d.ts +35 -0
- package/dist/parser/token-predicates.d.ts +77 -0
- package/dist/parser/tokenizer.d.ts +57 -0
- package/dist/parser/types.d.ts +118 -0
- package/dist/performance/expression-cache.d.ts +78 -0
- package/dist/performance/integration.d.ts +40 -0
- package/dist/performance/production-monitor.d.ts +67 -0
- package/dist/reference/index.d.ts +41 -0
- package/dist/reference/index.js +586 -0
- package/dist/reference/index.mjs +577 -0
- package/dist/registry/browser-types.d.ts +20 -0
- package/dist/registry/browser-types.js +81 -0
- package/dist/registry/browser-types.mjs +76 -0
- package/dist/registry/context-provider-registry.d.ts +38 -0
- package/dist/registry/environment.d.ts +19 -0
- package/dist/registry/environment.js +36 -0
- package/dist/registry/environment.mjs +30 -0
- package/dist/registry/event-source-registry.d.ts +54 -0
- package/dist/registry/examples/server-commands.d.ts +6 -0
- package/dist/registry/examples/server-event-source.d.ts +32 -0
- package/dist/registry/index.d.ts +54 -0
- package/dist/registry/index.js +7636 -0
- package/dist/registry/index.mjs +7612 -0
- package/dist/registry/multilingual/examples.d.ts +16 -0
- package/dist/registry/multilingual/index.d.ts +68 -0
- package/dist/registry/runtime-integration.d.ts +30 -0
- package/dist/registry/universal-types.d.ts +34 -0
- package/dist/registry/universal-types.js +91 -0
- package/dist/registry/universal-types.mjs +86 -0
- package/dist/runtime/cleanup-registry.d.ts +47 -0
- package/dist/runtime/command-adapter.d.ts +63 -0
- package/dist/runtime/environment.d.ts +75 -0
- package/dist/runtime/runtime-base.d.ts +78 -0
- package/dist/runtime/runtime-experimental.d.ts +18 -0
- package/dist/runtime/runtime-factory.d.ts +30 -0
- package/dist/runtime/runtime.d.ts +19 -0
- package/dist/runtime/temporal-modifiers.d.ts +37 -0
- package/dist/scripts/code-generator.d.ts +64 -0
- package/dist/scripts/generate-missing-commands.d.ts +4 -0
- package/dist/test-setup.d.ts +45 -0
- package/dist/test-utilities.d.ts +52 -0
- package/dist/tokenizer.d.ts +49 -0
- package/dist/types/base-types.d.ts +336 -0
- package/dist/types/code-fix.d.ts +39 -0
- package/dist/types/command-metadata.d.ts +57 -0
- package/dist/types/command-types.d.ts +272 -0
- package/dist/types/context-types.d.ts +106 -0
- package/dist/types/core-context.d.ts +21 -0
- package/dist/types/core.d.ts +203 -0
- package/dist/types/error-codes.d.ts +207 -0
- package/dist/types/expression-types.d.ts +155 -0
- package/dist/types/feature-types.d.ts +81 -0
- package/dist/types/hooks.d.ts +45 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/result.d.ts +72 -0
- package/dist/types/template-types.d.ts +162 -0
- package/dist/types/type-guards.d.ts +24 -0
- package/dist/types/unified-types.d.ts +99 -0
- package/dist/utils/debug-events.d.ts +41 -0
- package/dist/utils/debug.d.ts +35 -0
- package/dist/utils/dom-utils.d.ts +16 -0
- package/dist/utils/element-check.d.ts +7 -0
- package/dist/utils/keyboard-shortcuts.d.ts +18 -0
- package/dist/utils/performance.d.ts +40 -0
- package/dist/validation/command-pattern-validator.d.ts +53 -0
- package/dist/validation/common-validators.d.ts +24 -0
- package/dist/validation/lightweight-validators.d.ts +113 -0
- package/dist/validation/partial-validation-types.d.ts +50 -0
- package/dist/validation/partial-validator.d.ts +6 -0
- package/dist/validation/partial-warning-formatter.d.ts +6 -0
- package/dist/validation/validate-cli.d.ts +41 -0
- package/package.json +292 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import type { RuntimeValidator } from '../validation/lightweight-validators';
|
|
2
|
+
import type { ValidationResult, ValidationError, HyperScriptValueType, EvaluationResult, TypedExecutionContext } from './base-types';
|
|
3
|
+
export type { ExecutionContext, TypedExecutionContext, TypedExecutionContext as TypedExpressionContext, ValidationResult, TypedResult, LLMDocumentation, } from './base-types';
|
|
4
|
+
export type HyperScriptValue = unknown;
|
|
5
|
+
export type { EvaluationResult, EvaluationType, HyperScriptValueType } from './base-types';
|
|
6
|
+
export declare const HyperScriptValueSchema: RuntimeValidator<unknown>;
|
|
7
|
+
export interface ExecutionMeta {
|
|
8
|
+
readonly startTime: number;
|
|
9
|
+
readonly commandStack: string[];
|
|
10
|
+
readonly sourceLocation?: SourceLocation;
|
|
11
|
+
readonly debugMode: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SourceLocation {
|
|
14
|
+
readonly line: number;
|
|
15
|
+
readonly column: number;
|
|
16
|
+
readonly source: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TypedCommandImplementation<TInput extends readonly HyperScriptValue[] = readonly HyperScriptValue[], TOutput extends HyperScriptValue = HyperScriptValue, TContext extends TypedExecutionContext = TypedExecutionContext> {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly syntax: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly inputSchema: RuntimeValidator<TInput>;
|
|
23
|
+
readonly outputType: HyperScriptValueType;
|
|
24
|
+
execute(context: TContext, ...args: TInput): Promise<EvaluationResult<TOutput>>;
|
|
25
|
+
validate(args: unknown[]): ValidationResult;
|
|
26
|
+
readonly metadata: CommandMetadata;
|
|
27
|
+
}
|
|
28
|
+
export interface CommandMetadata {
|
|
29
|
+
readonly category: CommandCategory;
|
|
30
|
+
readonly complexity: 'simple' | 'medium' | 'complex';
|
|
31
|
+
readonly sideEffects: SideEffect[];
|
|
32
|
+
readonly examples: CommandExample[];
|
|
33
|
+
readonly relatedCommands: string[];
|
|
34
|
+
}
|
|
35
|
+
export type CommandCategory = 'DOM' | 'Event' | 'Control' | 'Data' | 'Communication' | 'Style';
|
|
36
|
+
export type SideEffect = string;
|
|
37
|
+
export interface CommandExample {
|
|
38
|
+
readonly code: string;
|
|
39
|
+
readonly description: string;
|
|
40
|
+
readonly expectedOutput: HyperScriptValue;
|
|
41
|
+
}
|
|
42
|
+
export interface TypedExpressionImplementation<TOutput extends HyperScriptValue = HyperScriptValue, TContext extends TypedExecutionContext = TypedExecutionContext> {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly category: ExpressionCategory;
|
|
45
|
+
readonly precedence: number;
|
|
46
|
+
readonly associativity: 'left' | 'right' | 'none';
|
|
47
|
+
readonly outputType: string;
|
|
48
|
+
evaluate(context: TContext, ...args: HyperScriptValue[]): Promise<EvaluationResult<TOutput>>;
|
|
49
|
+
readonly analysisInfo: ExpressionAnalysisInfo;
|
|
50
|
+
}
|
|
51
|
+
export interface ExpressionAnalysisInfo {
|
|
52
|
+
readonly isPure: boolean;
|
|
53
|
+
readonly canThrow: boolean;
|
|
54
|
+
readonly complexity: 'O(1)' | 'O(n)' | 'O(n²)' | 'O(log n)';
|
|
55
|
+
readonly dependencies: string[];
|
|
56
|
+
}
|
|
57
|
+
export type ExpressionCategory = 'reference' | 'logical' | 'comparison' | 'arithmetic' | 'string' | 'array' | 'object' | 'conversion' | 'special';
|
|
58
|
+
export interface EnhancedValidationError extends ValidationError {
|
|
59
|
+
readonly position?: SourceLocation;
|
|
60
|
+
readonly suggestion?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface HyperScriptError {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly message: string;
|
|
65
|
+
readonly code: string;
|
|
66
|
+
readonly source?: SourceLocation;
|
|
67
|
+
readonly cause?: Error;
|
|
68
|
+
readonly suggestions: string[];
|
|
69
|
+
}
|
|
70
|
+
export declare class TypeChecker {
|
|
71
|
+
static getType(value: unknown): string;
|
|
72
|
+
static validateType(value: unknown, expectedType: string): ValidationResult;
|
|
73
|
+
private static getTypeSuggestion;
|
|
74
|
+
}
|
|
75
|
+
export interface ParameterDoc {
|
|
76
|
+
readonly name: string;
|
|
77
|
+
readonly type: string;
|
|
78
|
+
readonly description: string;
|
|
79
|
+
readonly optional: boolean;
|
|
80
|
+
readonly defaultValue?: HyperScriptValue;
|
|
81
|
+
readonly examples: string[];
|
|
82
|
+
}
|
|
83
|
+
export interface ReturnDoc {
|
|
84
|
+
readonly type: string;
|
|
85
|
+
readonly description: string;
|
|
86
|
+
readonly examples: HyperScriptValue[];
|
|
87
|
+
}
|
|
88
|
+
export interface DocumentationExample {
|
|
89
|
+
readonly title: string;
|
|
90
|
+
readonly code: string;
|
|
91
|
+
readonly explanation: string;
|
|
92
|
+
readonly output: HyperScriptValue;
|
|
93
|
+
}
|
|
94
|
+
export interface HyperScriptProgram {
|
|
95
|
+
readonly source: string;
|
|
96
|
+
readonly features: HyperScriptFeature[];
|
|
97
|
+
readonly metadata: ProgramMetadata;
|
|
98
|
+
readonly sourceInfo?: ProgramSourceInfo;
|
|
99
|
+
readonly state: ProgramState;
|
|
100
|
+
}
|
|
101
|
+
export interface HyperScriptFeature {
|
|
102
|
+
readonly type: HyperScriptFeatureType;
|
|
103
|
+
readonly id: string;
|
|
104
|
+
readonly trigger?: EventTrigger;
|
|
105
|
+
readonly commands: ParsedCommand[];
|
|
106
|
+
readonly config: FeatureConfig;
|
|
107
|
+
readonly sourceRange: SourceRange;
|
|
108
|
+
readonly metadata: FeatureMetadata;
|
|
109
|
+
}
|
|
110
|
+
export interface ParsedCommand {
|
|
111
|
+
readonly type: ParsedCommandType;
|
|
112
|
+
readonly name: string;
|
|
113
|
+
readonly implementation?: unknown | TypedExpressionImplementation<unknown, TypedExecutionContext>;
|
|
114
|
+
readonly args: ParsedArgument[];
|
|
115
|
+
readonly options: CommandOptions;
|
|
116
|
+
readonly sourceRange: SourceRange;
|
|
117
|
+
readonly analysis?: CommandAnalysis;
|
|
118
|
+
}
|
|
119
|
+
export interface ParsedArgument {
|
|
120
|
+
readonly value: HyperScriptValue;
|
|
121
|
+
readonly type: string;
|
|
122
|
+
readonly kind: 'literal' | 'expression' | 'reference';
|
|
123
|
+
readonly sourceRange?: SourceRange;
|
|
124
|
+
readonly analysis?: ArgumentAnalysis;
|
|
125
|
+
}
|
|
126
|
+
export type HyperScriptFeatureType = 'event' | 'behavior' | 'definition' | 'init' | 'worker' | 'socket' | 'eventsource' | 'set' | 'js' | 'custom';
|
|
127
|
+
export type ParsedCommandType = 'dom-manipulation' | 'content' | 'navigation' | 'event' | 'async' | 'control-flow' | 'data' | 'expression' | 'custom';
|
|
128
|
+
export interface EventTrigger {
|
|
129
|
+
readonly event: string;
|
|
130
|
+
readonly target?: string | HTMLElement;
|
|
131
|
+
readonly options: EventListenerOptions & {
|
|
132
|
+
readonly once?: boolean;
|
|
133
|
+
readonly debounce?: number;
|
|
134
|
+
readonly throttle?: number;
|
|
135
|
+
};
|
|
136
|
+
readonly filter?: EventFilter;
|
|
137
|
+
}
|
|
138
|
+
export interface EventFilter {
|
|
139
|
+
readonly selector?: string;
|
|
140
|
+
readonly keys?: string[];
|
|
141
|
+
readonly condition?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface FeatureConfig {
|
|
144
|
+
readonly enabled: boolean;
|
|
145
|
+
readonly priority: number;
|
|
146
|
+
readonly options: Record<string, HyperScriptValue>;
|
|
147
|
+
readonly dependencies: string[];
|
|
148
|
+
readonly capabilities: FeatureCapabilities;
|
|
149
|
+
}
|
|
150
|
+
export interface FeatureCapabilities {
|
|
151
|
+
readonly requiresDOM: boolean;
|
|
152
|
+
readonly isAsync: boolean;
|
|
153
|
+
readonly modifiesGlobalState: boolean;
|
|
154
|
+
readonly requiredAPIs: string[];
|
|
155
|
+
readonly performance: PerformanceCharacteristics;
|
|
156
|
+
}
|
|
157
|
+
export interface PerformanceCharacteristics {
|
|
158
|
+
readonly complexity: 'low' | 'medium' | 'high';
|
|
159
|
+
readonly memoryUsage: 'minimal' | 'moderate' | 'heavy';
|
|
160
|
+
readonly cpuIntensive: boolean;
|
|
161
|
+
readonly executionTime: {
|
|
162
|
+
readonly min: number;
|
|
163
|
+
readonly max: number;
|
|
164
|
+
readonly typical: number;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export interface ProgramMetadata {
|
|
168
|
+
readonly compilation: {
|
|
169
|
+
readonly compiled: boolean;
|
|
170
|
+
readonly compiledAt?: Date;
|
|
171
|
+
readonly compiler: string;
|
|
172
|
+
readonly version: string;
|
|
173
|
+
};
|
|
174
|
+
readonly analysis: {
|
|
175
|
+
readonly complexity: number;
|
|
176
|
+
readonly estimatedExecutionTime: number;
|
|
177
|
+
readonly memoryRequirements: number;
|
|
178
|
+
readonly warnings: AnalysisWarning[];
|
|
179
|
+
readonly optimizations: string[];
|
|
180
|
+
};
|
|
181
|
+
readonly performance?: {
|
|
182
|
+
readonly lastExecutionTime: number;
|
|
183
|
+
readonly averageExecutionTime: number;
|
|
184
|
+
readonly executionCount: number;
|
|
185
|
+
readonly errorCount: number;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export interface FeatureMetadata {
|
|
189
|
+
readonly compiledAt: Date;
|
|
190
|
+
readonly stats: {
|
|
191
|
+
readonly executionCount: number;
|
|
192
|
+
readonly totalExecutionTime: number;
|
|
193
|
+
readonly averageExecutionTime: number;
|
|
194
|
+
readonly errorCount: number;
|
|
195
|
+
readonly lastExecuted?: Date;
|
|
196
|
+
};
|
|
197
|
+
readonly resolvedDependencies: string[];
|
|
198
|
+
readonly warnings: AnalysisWarning[];
|
|
199
|
+
}
|
|
200
|
+
export interface CommandOptions {
|
|
201
|
+
readonly validateInputs: boolean;
|
|
202
|
+
readonly trackPerformance: boolean;
|
|
203
|
+
readonly errorHandling: 'throw' | 'return' | 'ignore';
|
|
204
|
+
readonly timeout?: number;
|
|
205
|
+
readonly retry?: {
|
|
206
|
+
readonly attempts: number;
|
|
207
|
+
readonly delay: number;
|
|
208
|
+
readonly backoff: 'linear' | 'exponential';
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
export interface CommandAnalysis {
|
|
212
|
+
readonly complexity: number;
|
|
213
|
+
readonly requirements: string[];
|
|
214
|
+
readonly sideEffects: string[];
|
|
215
|
+
readonly typeInference: {
|
|
216
|
+
readonly inputTypes: string[];
|
|
217
|
+
readonly outputType: string;
|
|
218
|
+
readonly confidence: number;
|
|
219
|
+
};
|
|
220
|
+
readonly optimizations: string[];
|
|
221
|
+
}
|
|
222
|
+
export interface ArgumentAnalysis {
|
|
223
|
+
readonly isUsed: boolean;
|
|
224
|
+
readonly typeCompatibility: number;
|
|
225
|
+
readonly suggestions: string[];
|
|
226
|
+
}
|
|
227
|
+
export interface ProgramSourceInfo {
|
|
228
|
+
readonly element?: HTMLElement;
|
|
229
|
+
readonly attribute?: string;
|
|
230
|
+
readonly file?: string;
|
|
231
|
+
readonly position?: {
|
|
232
|
+
readonly line: number;
|
|
233
|
+
readonly column: number;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
export interface SourceRange {
|
|
237
|
+
readonly start: number;
|
|
238
|
+
readonly end: number;
|
|
239
|
+
readonly lines?: {
|
|
240
|
+
readonly start: {
|
|
241
|
+
line: number;
|
|
242
|
+
column: number;
|
|
243
|
+
};
|
|
244
|
+
readonly end: {
|
|
245
|
+
line: number;
|
|
246
|
+
column: number;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export interface ProgramState {
|
|
251
|
+
readonly status: 'ready' | 'running' | 'completed' | 'error' | 'suspended';
|
|
252
|
+
readonly currentFeature?: string;
|
|
253
|
+
readonly context: {
|
|
254
|
+
readonly element: HTMLElement | null;
|
|
255
|
+
readonly variables: Map<string, HyperScriptValue>;
|
|
256
|
+
readonly callStack: string[];
|
|
257
|
+
};
|
|
258
|
+
readonly error?: HyperScriptError;
|
|
259
|
+
readonly startedAt?: Date;
|
|
260
|
+
readonly completedAt?: Date;
|
|
261
|
+
}
|
|
262
|
+
export interface AnalysisWarning {
|
|
263
|
+
readonly level: 'info' | 'warning' | 'error';
|
|
264
|
+
readonly message: string;
|
|
265
|
+
readonly location: SourceRange;
|
|
266
|
+
readonly suggestion?: string;
|
|
267
|
+
readonly category: 'performance' | 'compatibility' | 'security' | 'style' | 'type-safety';
|
|
268
|
+
}
|
|
269
|
+
export declare const HyperScriptProgramSchema: RuntimeValidator<{
|
|
270
|
+
[x: string]: unknown;
|
|
271
|
+
}>;
|
|
272
|
+
//# sourceMappingURL=command-types.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { RuntimeValidator } from '../validation/lightweight-validators';
|
|
2
|
+
import type { TypedExpressionContext, EvaluationType, ExpressionMetadata, ValidationResult } from './expression-types';
|
|
3
|
+
import type { LLMDocumentation } from './command-types';
|
|
4
|
+
import type { EvaluationResult } from './base-types';
|
|
5
|
+
export type { EvaluationResult } from './base-types';
|
|
6
|
+
export type ContextCategory = 'Frontend' | 'Backend' | 'Universal' | 'SSR' | 'Testing';
|
|
7
|
+
export interface ContextMetadata extends Omit<ExpressionMetadata, 'category'> {
|
|
8
|
+
category: ContextCategory;
|
|
9
|
+
relatedContexts?: string[];
|
|
10
|
+
frameworkDependencies?: string[];
|
|
11
|
+
environmentRequirements?: {
|
|
12
|
+
browser?: boolean;
|
|
13
|
+
server?: boolean;
|
|
14
|
+
nodejs?: boolean;
|
|
15
|
+
python?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface TypedContextImplementation<TInput, TOutput> {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly category: ContextCategory;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly inputSchema: RuntimeValidator<TInput>;
|
|
23
|
+
readonly outputType: EvaluationType;
|
|
24
|
+
readonly metadata: ContextMetadata;
|
|
25
|
+
readonly documentation?: LLMDocumentation;
|
|
26
|
+
initialize(input: TInput): Promise<EvaluationResult<TOutput>>;
|
|
27
|
+
validate(input: unknown): ValidationResult;
|
|
28
|
+
trackPerformance?(startTime: number, success: boolean, output?: any): void;
|
|
29
|
+
}
|
|
30
|
+
export declare abstract class ContextBase<TInput, TOutput> implements TypedContextImplementation<TInput, TOutput> {
|
|
31
|
+
abstract readonly name: string;
|
|
32
|
+
abstract readonly category: ContextCategory;
|
|
33
|
+
abstract readonly description: string;
|
|
34
|
+
abstract readonly inputSchema: RuntimeValidator<TInput>;
|
|
35
|
+
abstract readonly outputType: EvaluationType;
|
|
36
|
+
abstract readonly metadata: ContextMetadata;
|
|
37
|
+
abstract readonly documentation?: LLMDocumentation;
|
|
38
|
+
protected evaluationHistory: Array<{
|
|
39
|
+
contextName: string;
|
|
40
|
+
category: ContextCategory;
|
|
41
|
+
input: string;
|
|
42
|
+
output: any;
|
|
43
|
+
timestamp: number;
|
|
44
|
+
duration: number;
|
|
45
|
+
success: boolean;
|
|
46
|
+
}>;
|
|
47
|
+
abstract initialize(input: TInput): Promise<EvaluationResult<TOutput>>;
|
|
48
|
+
validate(input: unknown): ValidationResult;
|
|
49
|
+
protected validateContextSpecific(_data: TInput): ValidationResult;
|
|
50
|
+
protected generateValidationSuggestions(error: any): string[];
|
|
51
|
+
trackPerformance(startTime: number, success: boolean, output?: any): void;
|
|
52
|
+
getPerformanceMetrics(): {
|
|
53
|
+
totalInitializations: number;
|
|
54
|
+
successRate: number;
|
|
55
|
+
averageDuration: number;
|
|
56
|
+
recentPerformance: {
|
|
57
|
+
contextName: string;
|
|
58
|
+
category: ContextCategory;
|
|
59
|
+
input: string;
|
|
60
|
+
output: any;
|
|
61
|
+
timestamp: number;
|
|
62
|
+
duration: number;
|
|
63
|
+
success: boolean;
|
|
64
|
+
}[];
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export declare const BaseContextInputSchema: RuntimeValidator<{
|
|
68
|
+
[x: string]: unknown;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const BaseContextOutputSchema: RuntimeValidator<{
|
|
71
|
+
[x: string]: unknown;
|
|
72
|
+
}>;
|
|
73
|
+
export type BaseContextInput = any;
|
|
74
|
+
export type BaseContextOutput = any;
|
|
75
|
+
export interface ExtendedTypedExpressionContext extends TypedExpressionContext {
|
|
76
|
+
contextCategory?: ContextCategory;
|
|
77
|
+
framework?: {
|
|
78
|
+
name: 'django' | 'flask' | 'express' | 'fastapi' | 'vanilla';
|
|
79
|
+
version?: string;
|
|
80
|
+
capabilities?: string[];
|
|
81
|
+
};
|
|
82
|
+
performanceTracking?: {
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
includeMemoryUsage: boolean;
|
|
85
|
+
includeNetworkMetrics: boolean;
|
|
86
|
+
};
|
|
87
|
+
services?: {
|
|
88
|
+
logger?: any;
|
|
89
|
+
cache?: any;
|
|
90
|
+
database?: any;
|
|
91
|
+
queue?: any;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface ContextRegistry {
|
|
95
|
+
register<T extends TypedContextImplementation<any, any>>(context: T): void;
|
|
96
|
+
get<_T>(name: string): TypedContextImplementation<any, any> | null;
|
|
97
|
+
listByCategory(category: ContextCategory): TypedContextImplementation<any, any>[];
|
|
98
|
+
validate<T extends TypedContextImplementation<any, any>>(context: T): ValidationResult;
|
|
99
|
+
}
|
|
100
|
+
export interface ContextFilter {
|
|
101
|
+
category?: ContextCategory;
|
|
102
|
+
environment?: 'frontend' | 'backend' | 'universal';
|
|
103
|
+
framework?: string;
|
|
104
|
+
capabilities?: string[];
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=context-types.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface CoreExecutionContext {
|
|
2
|
+
me: Element | null;
|
|
3
|
+
you: Element | null;
|
|
4
|
+
it: unknown;
|
|
5
|
+
readonly event?: Event | null;
|
|
6
|
+
readonly locals: Map<string, unknown>;
|
|
7
|
+
readonly globals: Map<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface CoreContextOptions {
|
|
10
|
+
me?: Element | null;
|
|
11
|
+
you?: Element | null;
|
|
12
|
+
it?: unknown;
|
|
13
|
+
event?: Event | null;
|
|
14
|
+
locals?: Map<string, unknown>;
|
|
15
|
+
globals?: Map<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare function createCoreContext(options?: CoreContextOptions): CoreExecutionContext;
|
|
18
|
+
export declare function isCoreExecutionContext(value: unknown): value is CoreExecutionContext;
|
|
19
|
+
export declare function assertHTMLElement(element: Element | null, name?: string): HTMLElement;
|
|
20
|
+
export declare function asHTMLElement(element: Element | null): HTMLElement | null;
|
|
21
|
+
//# sourceMappingURL=core-context.d.ts.map
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export type { ExecutionContext, TypedExecutionContext, EvaluationType, HyperScriptValueType, ValidationResult, ValidationError, TypedResult, EnhancedError, PerformanceCharacteristics, ASTNode, ParseError, ExpressionNode, CommandNode as BaseCommandNode, EventHandlerNode, BehaviorNode, DefNode, } from './base-types';
|
|
2
|
+
import type { ExecutionContext, ASTNode, ExpressionNode, EvaluationType, ParseError } from './base-types';
|
|
3
|
+
export type ElementType = 'command' | 'expression' | 'feature' | 'keyword' | 'special_symbol';
|
|
4
|
+
export type ElementStatus = 'Draft' | 'Review' | 'Approved' | 'Deprecated';
|
|
5
|
+
export type ExpressionCategory = 'Arithmetic' | 'Logical' | 'Comparison' | 'Reference' | 'Conversion' | 'Special';
|
|
6
|
+
export type Associativity = 'Left' | 'Right' | 'None';
|
|
7
|
+
export interface ExtendedExecutionContext extends ExecutionContext {
|
|
8
|
+
variables?: Map<string, unknown>;
|
|
9
|
+
events?: Map<string, {
|
|
10
|
+
target: HTMLElement;
|
|
11
|
+
event: string;
|
|
12
|
+
handler: Function;
|
|
13
|
+
}>;
|
|
14
|
+
parent?: ExtendedExecutionContext;
|
|
15
|
+
meta?: Record<string, unknown>;
|
|
16
|
+
flags?: {
|
|
17
|
+
halted: boolean;
|
|
18
|
+
breaking: boolean;
|
|
19
|
+
continuing: boolean;
|
|
20
|
+
returning: boolean;
|
|
21
|
+
async: boolean;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface CommandNode extends ASTNode {
|
|
25
|
+
type: 'command';
|
|
26
|
+
name: string;
|
|
27
|
+
args: ExpressionNode[];
|
|
28
|
+
body?: StatementNode[];
|
|
29
|
+
implicitTarget?: ExpressionNode;
|
|
30
|
+
isBlocking: boolean;
|
|
31
|
+
modifiers?: Record<string, ExpressionNode>;
|
|
32
|
+
originalCommand?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface FeatureNode extends ASTNode {
|
|
35
|
+
type: 'feature';
|
|
36
|
+
name: string;
|
|
37
|
+
trigger?: string;
|
|
38
|
+
body: StatementNode[];
|
|
39
|
+
scope: 'global' | 'local' | 'behavior';
|
|
40
|
+
}
|
|
41
|
+
export interface StatementNode extends ASTNode {
|
|
42
|
+
type: 'statement';
|
|
43
|
+
command: CommandNode;
|
|
44
|
+
conditions?: ExpressionNode[];
|
|
45
|
+
}
|
|
46
|
+
export interface Runtime {
|
|
47
|
+
executeCommand(command: CommandNode, context: ExecutionContext): Promise<unknown>;
|
|
48
|
+
evaluateExpression(expression: ExpressionNode, context: ExecutionContext): Promise<unknown>;
|
|
49
|
+
createContext(parent?: ExecutionContext): ExecutionContext;
|
|
50
|
+
registerCommand(name: string, implementation: BaseCommandImplementation): void;
|
|
51
|
+
registerExpression(name: string, implementation: ExpressionImplementation): void;
|
|
52
|
+
registerFeature(name: string, implementation: FeatureImplementation): void;
|
|
53
|
+
}
|
|
54
|
+
export interface BaseCommandImplementation {
|
|
55
|
+
name: string;
|
|
56
|
+
syntax: string;
|
|
57
|
+
execute: (context: ExecutionContext, ...args: unknown[]) => Promise<unknown>;
|
|
58
|
+
isBlocking: boolean;
|
|
59
|
+
hasBody: boolean;
|
|
60
|
+
implicitTarget?: string;
|
|
61
|
+
implicitResult?: 'it' | 'result' | 'none';
|
|
62
|
+
validate?: (args: unknown[]) => string | null;
|
|
63
|
+
}
|
|
64
|
+
export interface LegacyValidationResult<T = unknown> {
|
|
65
|
+
success: boolean;
|
|
66
|
+
data?: T;
|
|
67
|
+
error?: import('./base-types').ValidationError;
|
|
68
|
+
}
|
|
69
|
+
export interface CommandImplementation<TInput = unknown, TOutput = unknown, TContext = import('./base-types').ExecutionContext> {
|
|
70
|
+
metadata: {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
examples: string[];
|
|
74
|
+
syntax: string;
|
|
75
|
+
category: string;
|
|
76
|
+
version: string;
|
|
77
|
+
};
|
|
78
|
+
validation: {
|
|
79
|
+
validate(input: unknown): import('./base-types').ValidationResult<TInput>;
|
|
80
|
+
};
|
|
81
|
+
execute(input: TInput, context: TContext): Promise<TOutput>;
|
|
82
|
+
}
|
|
83
|
+
export interface ExpressionImplementation {
|
|
84
|
+
name: string;
|
|
85
|
+
category: ExpressionCategory;
|
|
86
|
+
evaluatesTo: EvaluationType;
|
|
87
|
+
evaluate: (context: ExecutionContext, ...args: unknown[]) => Promise<unknown>;
|
|
88
|
+
precedence?: number;
|
|
89
|
+
associativity?: Associativity;
|
|
90
|
+
operators?: string[];
|
|
91
|
+
validate?: (args: unknown[]) => string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface FeatureImplementation {
|
|
94
|
+
name: string;
|
|
95
|
+
trigger?: string;
|
|
96
|
+
install: (runtime: Runtime) => void;
|
|
97
|
+
uninstall?: (runtime: Runtime) => void;
|
|
98
|
+
scope: 'global' | 'local' | 'behavior';
|
|
99
|
+
}
|
|
100
|
+
export interface Token {
|
|
101
|
+
kind: string;
|
|
102
|
+
value: string;
|
|
103
|
+
start: number;
|
|
104
|
+
end: number;
|
|
105
|
+
line: number;
|
|
106
|
+
column: number;
|
|
107
|
+
}
|
|
108
|
+
export interface ParseWarning {
|
|
109
|
+
type: string;
|
|
110
|
+
message: string;
|
|
111
|
+
suggestions: string[];
|
|
112
|
+
severity: 'info' | 'warning' | 'error';
|
|
113
|
+
code?: string;
|
|
114
|
+
line?: number;
|
|
115
|
+
column?: number;
|
|
116
|
+
}
|
|
117
|
+
export interface ParseResult<T = ASTNode> {
|
|
118
|
+
success: boolean;
|
|
119
|
+
node?: T;
|
|
120
|
+
ast?: T;
|
|
121
|
+
error?: ParseError;
|
|
122
|
+
warnings?: ParseWarning[];
|
|
123
|
+
tokens: Token[];
|
|
124
|
+
}
|
|
125
|
+
export interface Parser {
|
|
126
|
+
parse(input: string): ParseResult<FeatureNode[]>;
|
|
127
|
+
parseExpression(input: string): ParseResult<ExpressionNode>;
|
|
128
|
+
parseCommand(input: string): ParseResult<CommandNode>;
|
|
129
|
+
tokenize(input: string): Token[];
|
|
130
|
+
}
|
|
131
|
+
export interface LSPElement {
|
|
132
|
+
id: number;
|
|
133
|
+
name: string;
|
|
134
|
+
description: string;
|
|
135
|
+
syntax_canonical: string;
|
|
136
|
+
status: ElementStatus;
|
|
137
|
+
tags: string[];
|
|
138
|
+
examples: LSPExample[];
|
|
139
|
+
}
|
|
140
|
+
export interface LSPCommand extends LSPElement {
|
|
141
|
+
purpose: string;
|
|
142
|
+
has_body: boolean;
|
|
143
|
+
is_blocking: boolean;
|
|
144
|
+
implicit_target?: string;
|
|
145
|
+
implicit_result_target?: string;
|
|
146
|
+
arguments?: LSPArgument[];
|
|
147
|
+
}
|
|
148
|
+
export interface LSPExpression extends LSPElement {
|
|
149
|
+
category: ExpressionCategory;
|
|
150
|
+
evaluates_to_type: EvaluationType;
|
|
151
|
+
precedence?: number;
|
|
152
|
+
associativity?: Associativity;
|
|
153
|
+
operators?: string[];
|
|
154
|
+
}
|
|
155
|
+
export interface LSPFeature extends LSPElement {
|
|
156
|
+
trigger?: string;
|
|
157
|
+
structure_description?: string;
|
|
158
|
+
scope_impact?: string;
|
|
159
|
+
}
|
|
160
|
+
export interface LSPExample {
|
|
161
|
+
id: number;
|
|
162
|
+
element_id: number;
|
|
163
|
+
element_type: ElementType;
|
|
164
|
+
example: string;
|
|
165
|
+
description?: string;
|
|
166
|
+
difficulty?: 'Beginner' | 'Intermediate' | 'Advanced';
|
|
167
|
+
html_context?: string;
|
|
168
|
+
}
|
|
169
|
+
export interface LSPArgument {
|
|
170
|
+
name: string;
|
|
171
|
+
type: string;
|
|
172
|
+
description: string;
|
|
173
|
+
optional: boolean;
|
|
174
|
+
default_value?: unknown;
|
|
175
|
+
}
|
|
176
|
+
export interface HyperscriptEvent extends CustomEvent {
|
|
177
|
+
detail: {
|
|
178
|
+
element: HTMLElement;
|
|
179
|
+
context: ExecutionContext;
|
|
180
|
+
command?: string;
|
|
181
|
+
result?: unknown;
|
|
182
|
+
error?: Error;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export interface HyperscriptConfig {
|
|
186
|
+
strict?: boolean;
|
|
187
|
+
debug?: boolean;
|
|
188
|
+
commands?: Record<string, BaseCommandImplementation>;
|
|
189
|
+
expressions?: Record<string, ExpressionImplementation>;
|
|
190
|
+
features?: Record<string, FeatureImplementation>;
|
|
191
|
+
globals?: Record<string, unknown>;
|
|
192
|
+
events?: {
|
|
193
|
+
bubbling?: boolean;
|
|
194
|
+
delegation?: boolean;
|
|
195
|
+
passive?: boolean;
|
|
196
|
+
};
|
|
197
|
+
performance?: {
|
|
198
|
+
cacheParsing?: boolean;
|
|
199
|
+
lazyLoading?: boolean;
|
|
200
|
+
bundleOptimization?: boolean;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=core.d.ts.map
|