@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,37 @@
|
|
|
1
|
+
export interface TemporalState {
|
|
2
|
+
id: string;
|
|
3
|
+
command: string;
|
|
4
|
+
element: HTMLElement;
|
|
5
|
+
originalState: any;
|
|
6
|
+
untilEvent: string;
|
|
7
|
+
untilTarget?: HTMLElement | Document | Window | undefined;
|
|
8
|
+
cleanup: () => void;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TemporalModifierOptions {
|
|
12
|
+
command: string;
|
|
13
|
+
element: HTMLElement;
|
|
14
|
+
untilEvent: string;
|
|
15
|
+
untilTarget?: HTMLElement | Document | Window | undefined;
|
|
16
|
+
stateCapture: () => any;
|
|
17
|
+
stateRestore: (state: any) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare class TemporalModifierManager {
|
|
20
|
+
private static instance;
|
|
21
|
+
private activeStates;
|
|
22
|
+
private nextId;
|
|
23
|
+
private constructor();
|
|
24
|
+
static getInstance(): TemporalModifierManager;
|
|
25
|
+
register(options: TemporalModifierOptions): string;
|
|
26
|
+
unregister(id: string): boolean;
|
|
27
|
+
getActiveStates(): TemporalState[];
|
|
28
|
+
getStatesForElement(element: HTMLElement): TemporalState[];
|
|
29
|
+
clearAll(): void;
|
|
30
|
+
get activeCount(): number;
|
|
31
|
+
}
|
|
32
|
+
export declare function createToggleUntil(element: HTMLElement, targetType: 'class' | 'attribute', targetName: string, untilEvent: string, untilTarget?: HTMLElement | Document | Window): string;
|
|
33
|
+
export declare function createAddUntil(element: HTMLElement, targetType: 'class' | 'attribute', targetName: string, targetValue: string | undefined, untilEvent: string, untilTarget?: HTMLElement | Document | Window): string;
|
|
34
|
+
export declare function createRemoveUntil(element: HTMLElement, targetType: 'class' | 'attribute', targetName: string, untilEvent: string, untilTarget?: HTMLElement | Document | Window): string;
|
|
35
|
+
export declare const temporalModifierManager: TemporalModifierManager;
|
|
36
|
+
export default TemporalModifierManager;
|
|
37
|
+
//# sourceMappingURL=temporal-modifiers.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface LSPCommand {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
syntax_canonical: string;
|
|
6
|
+
example_usage: string[];
|
|
7
|
+
elementType: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
status?: string;
|
|
10
|
+
purpose?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LSPFeature {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
syntax_canonical: string;
|
|
17
|
+
example_usage: string[];
|
|
18
|
+
elementType: string;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface ParsedCommand {
|
|
22
|
+
name: string;
|
|
23
|
+
syntax: string;
|
|
24
|
+
description: string;
|
|
25
|
+
examples: string[];
|
|
26
|
+
category: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ParsedFeature {
|
|
29
|
+
name: string;
|
|
30
|
+
syntax: string;
|
|
31
|
+
description: string;
|
|
32
|
+
examples: string[];
|
|
33
|
+
}
|
|
34
|
+
export interface GeneratedCommand {
|
|
35
|
+
code: string;
|
|
36
|
+
filePath: string;
|
|
37
|
+
}
|
|
38
|
+
export interface GeneratedTest {
|
|
39
|
+
code: string;
|
|
40
|
+
filePath: string;
|
|
41
|
+
testCases: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface FilePaths {
|
|
44
|
+
implementation: string;
|
|
45
|
+
test: string;
|
|
46
|
+
}
|
|
47
|
+
export declare class CodeGenerator {
|
|
48
|
+
private commandCategories;
|
|
49
|
+
parseCommand(data: LSPCommand): ParsedCommand;
|
|
50
|
+
parseFeature(data: LSPFeature): ParsedFeature;
|
|
51
|
+
categorizeCommand(commandName: string): string;
|
|
52
|
+
generateFilePaths(name: string, type: 'command' | 'feature'): FilePaths;
|
|
53
|
+
generateCommandInterface(data: LSPCommand): GeneratedCommand;
|
|
54
|
+
generateCommandTest(data: LSPCommand): GeneratedTest;
|
|
55
|
+
private generateTestCase;
|
|
56
|
+
loadLSPData(): {
|
|
57
|
+
commands: LSPCommand[];
|
|
58
|
+
features: LSPFeature[];
|
|
59
|
+
};
|
|
60
|
+
generateMissingCommands(): void;
|
|
61
|
+
private capitalizeFirst;
|
|
62
|
+
private escapeString;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=code-generator.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Vi {
|
|
3
|
+
interface AsymmetricMatchersContaining {
|
|
4
|
+
toBeValidHyperscriptAST(): any;
|
|
5
|
+
toExecuteSuccessfully(): any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const createTestElement: (html: string) => HTMLElement;
|
|
10
|
+
export declare const waitForEvent: (target: EventTarget, eventName: string, timeout?: number) => Promise<Event>;
|
|
11
|
+
export declare const createMockHyperscriptContext: (element?: HTMLElement) => {
|
|
12
|
+
me: HTMLElement | null;
|
|
13
|
+
it: any;
|
|
14
|
+
you: HTMLElement | null;
|
|
15
|
+
result: any;
|
|
16
|
+
locals: Map<string, any>;
|
|
17
|
+
globals: Map<string, any>;
|
|
18
|
+
flags: {
|
|
19
|
+
halted: boolean;
|
|
20
|
+
breaking: boolean;
|
|
21
|
+
continuing: boolean;
|
|
22
|
+
returning: boolean;
|
|
23
|
+
async: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const createTypedExecutionContext: (element?: HTMLElement) => {
|
|
27
|
+
me: HTMLElement | null;
|
|
28
|
+
it: any;
|
|
29
|
+
you: HTMLElement | null;
|
|
30
|
+
result: any;
|
|
31
|
+
locals: Map<string, any>;
|
|
32
|
+
globals: Map<string, any>;
|
|
33
|
+
flags: {
|
|
34
|
+
halted: boolean;
|
|
35
|
+
breaking: boolean;
|
|
36
|
+
continuing: boolean;
|
|
37
|
+
returning: boolean;
|
|
38
|
+
async: boolean;
|
|
39
|
+
};
|
|
40
|
+
expressionStack: string[];
|
|
41
|
+
evaluationDepth: number;
|
|
42
|
+
validationMode: "strict";
|
|
43
|
+
evaluationHistory: any[];
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=test-setup.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CoreExecutionContext, ExecutionContext, TypedExecutionContext } from './types/base-types';
|
|
2
|
+
export type { CoreExecutionContext, ExecutionContext, TypedExecutionContext };
|
|
3
|
+
export type MutableContext<T> = {
|
|
4
|
+
-readonly [P in keyof T]: T[P];
|
|
5
|
+
};
|
|
6
|
+
export type TestExpressionContext = MutableContext<TypedExecutionContext> & {
|
|
7
|
+
performanceMetrics?: {
|
|
8
|
+
totalEvaluations: number;
|
|
9
|
+
averageExecutionTime: number;
|
|
10
|
+
lastEvaluationTime: number;
|
|
11
|
+
};
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type TypedExpressionContext = TestExpressionContext;
|
|
15
|
+
export declare function createMockElement(tag?: string, properties?: Record<string, any>, attributes?: Record<string, string>): HTMLElement;
|
|
16
|
+
export interface TestContextOptions {
|
|
17
|
+
me?: Element | null;
|
|
18
|
+
you?: Element | null;
|
|
19
|
+
it?: unknown;
|
|
20
|
+
event?: Event | null;
|
|
21
|
+
locals?: Map<string, unknown>;
|
|
22
|
+
globals?: Map<string, unknown>;
|
|
23
|
+
variables?: Map<string, unknown>;
|
|
24
|
+
result?: unknown;
|
|
25
|
+
expressionStack?: string[];
|
|
26
|
+
evaluationDepth?: number;
|
|
27
|
+
validationMode?: 'strict' | 'permissive';
|
|
28
|
+
evaluationHistory?: Array<{
|
|
29
|
+
expressionName: string;
|
|
30
|
+
category: string;
|
|
31
|
+
input: unknown;
|
|
32
|
+
output: unknown;
|
|
33
|
+
timestamp: number;
|
|
34
|
+
duration: number;
|
|
35
|
+
success: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
meta?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export declare function createCoreTestContext(options?: Partial<CoreExecutionContext>): CoreExecutionContext;
|
|
40
|
+
export declare function createTestContext(options?: TestContextOptions): ExecutionContext;
|
|
41
|
+
export declare function createTypedExecutionContext(options?: TestContextOptions): TypedExecutionContext;
|
|
42
|
+
export declare function createTypedExpressionContext(data?: Record<string, unknown>): TestExpressionContext;
|
|
43
|
+
export declare function setupMockDOM(): void;
|
|
44
|
+
export declare function waitForTick(): Promise<void>;
|
|
45
|
+
export declare function createPerformanceContext(): {
|
|
46
|
+
mark: (name: string) => number;
|
|
47
|
+
measure: <T>(name: string, operation: () => Promise<T> | T) => Promise<{
|
|
48
|
+
result: T;
|
|
49
|
+
duration: number;
|
|
50
|
+
}>;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=test-utilities.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface Token {
|
|
2
|
+
type: string;
|
|
3
|
+
value: string;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
column: number;
|
|
7
|
+
line: number;
|
|
8
|
+
op?: boolean;
|
|
9
|
+
template?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class Lexer {
|
|
12
|
+
static isAlpha(c: string): boolean;
|
|
13
|
+
static isNumeric(c: string): boolean;
|
|
14
|
+
static isWhitespace(c: string): boolean;
|
|
15
|
+
static isNewline(c: string): boolean;
|
|
16
|
+
static isIdentifierChar(c: string): boolean;
|
|
17
|
+
static isReservedChar(c: string): boolean;
|
|
18
|
+
static isValidCSSClassChar(c: string): boolean;
|
|
19
|
+
static isValidCSSIDChar(c: string): boolean;
|
|
20
|
+
static isValidSingleQuoteStringStart(tokens: Token[]): boolean;
|
|
21
|
+
static tokenize(source: string, template?: boolean): Tokens;
|
|
22
|
+
}
|
|
23
|
+
export declare class Tokens {
|
|
24
|
+
private tokens;
|
|
25
|
+
private consumed;
|
|
26
|
+
private source;
|
|
27
|
+
private lastConsumed?;
|
|
28
|
+
constructor(tokens: Token[], consumed: number, source: string);
|
|
29
|
+
hasMore(): boolean;
|
|
30
|
+
token(n?: number, dontIgnoreWhitespace?: boolean): Token;
|
|
31
|
+
currentToken(): Token;
|
|
32
|
+
consumeToken(): Token;
|
|
33
|
+
consumeWhitespace(): void;
|
|
34
|
+
lastMatch(): Token | undefined;
|
|
35
|
+
matchToken(value: string, type?: string): Token | null;
|
|
36
|
+
matchTokenType(...types: string[]): Token | null;
|
|
37
|
+
matchOpToken(value: string): Token | null;
|
|
38
|
+
requireToken(value: string, type?: string): Token;
|
|
39
|
+
requireTokenType(type: string): Token;
|
|
40
|
+
requireOpToken(value: string): Token;
|
|
41
|
+
consumeUntil(value?: string, type?: string): Token[];
|
|
42
|
+
consumeUntilWhitespace(): Token[];
|
|
43
|
+
lastWhitespace(): string;
|
|
44
|
+
raiseError(message: string): never;
|
|
45
|
+
static sourceFor(tokens: Token[]): string;
|
|
46
|
+
static lineFor(token: Token): string;
|
|
47
|
+
static positionString(token: Token): string;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=tokenizer.d.ts.map
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import type { RuntimeValidator } from '../validation/lightweight-validators';
|
|
2
|
+
import type { CoreExecutionContext } from './core-context';
|
|
3
|
+
export type { CoreExecutionContext } from './core-context';
|
|
4
|
+
export { createCoreContext, isCoreExecutionContext, assertHTMLElement, asHTMLElement, } from './core-context';
|
|
5
|
+
export interface ValidationError {
|
|
6
|
+
readonly type: 'type-mismatch' | 'missing-argument' | 'runtime-error' | 'validation-error' | 'syntax-error' | 'invalid-argument' | 'invalid-input' | 'empty-config' | 'schema-validation' | 'context-error' | 'invalid-syntax' | 'security-warning';
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly suggestions: readonly string[] | string[];
|
|
9
|
+
readonly path?: string;
|
|
10
|
+
readonly code?: string;
|
|
11
|
+
readonly name?: string;
|
|
12
|
+
readonly severity?: 'error' | 'warning' | 'info';
|
|
13
|
+
}
|
|
14
|
+
export interface PerformanceCharacteristics {
|
|
15
|
+
readonly evaluationCount: number;
|
|
16
|
+
readonly totalTime: number;
|
|
17
|
+
readonly averageTime: number;
|
|
18
|
+
readonly successRate: number;
|
|
19
|
+
readonly lastEvaluationTime: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ValidationResult<T = unknown> {
|
|
22
|
+
readonly isValid: boolean;
|
|
23
|
+
readonly errors: ValidationError[];
|
|
24
|
+
readonly suggestions: readonly string[] | string[];
|
|
25
|
+
readonly warnings?: ValidationError[];
|
|
26
|
+
readonly performance?: PerformanceCharacteristics;
|
|
27
|
+
readonly success?: boolean;
|
|
28
|
+
readonly data?: T;
|
|
29
|
+
readonly error?: ValidationError;
|
|
30
|
+
}
|
|
31
|
+
export interface EvaluationResult<T = unknown> {
|
|
32
|
+
readonly value?: T;
|
|
33
|
+
readonly type?: HyperScriptValueType;
|
|
34
|
+
readonly success: boolean;
|
|
35
|
+
readonly error?: ValidationError;
|
|
36
|
+
readonly performance?: PerformanceCharacteristics;
|
|
37
|
+
}
|
|
38
|
+
export type EvaluationType = 'String' | 'Number' | 'Boolean' | 'Element' | 'ElementList' | 'Array' | 'Object' | 'Promise' | 'Context' | 'Null' | 'Undefined' | 'Any';
|
|
39
|
+
export type HyperScriptValueType = 'string' | 'number' | 'boolean' | 'element' | 'element-list' | 'array' | 'object' | 'promise' | 'fragment' | 'null' | 'undefined' | 'function' | 'event' | 'error' | 'unknown';
|
|
40
|
+
export declare const evaluationToHyperScriptType: Record<EvaluationType, HyperScriptValueType>;
|
|
41
|
+
export type ExpressionCategory = 'Reference' | 'Logical' | 'Conversion' | 'Positional' | 'Property' | 'Special' | 'Template' | 'Mathematical';
|
|
42
|
+
export interface ExecutionContext extends CoreExecutionContext {
|
|
43
|
+
result: unknown;
|
|
44
|
+
readonly halted?: boolean;
|
|
45
|
+
readonly returned?: boolean;
|
|
46
|
+
readonly broke?: boolean;
|
|
47
|
+
readonly continued?: boolean;
|
|
48
|
+
readonly async?: boolean;
|
|
49
|
+
readonly variables?: Map<string, unknown>;
|
|
50
|
+
readonly events?: Map<string, {
|
|
51
|
+
target: HTMLElement;
|
|
52
|
+
event: string;
|
|
53
|
+
handler: Function;
|
|
54
|
+
}>;
|
|
55
|
+
readonly parent?: ExecutionContext;
|
|
56
|
+
readonly meta?: Record<string, unknown>;
|
|
57
|
+
readonly flags?: {
|
|
58
|
+
halted: boolean;
|
|
59
|
+
breaking: boolean;
|
|
60
|
+
continuing: boolean;
|
|
61
|
+
returning: boolean;
|
|
62
|
+
async: boolean;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface TypedExecutionContext extends ExecutionContext {
|
|
66
|
+
readonly expressionStack?: string[];
|
|
67
|
+
readonly evaluationDepth?: number;
|
|
68
|
+
readonly validationMode?: 'strict' | 'permissive';
|
|
69
|
+
readonly evaluationHistory?: Array<{
|
|
70
|
+
expressionName: string;
|
|
71
|
+
category: string;
|
|
72
|
+
input: unknown;
|
|
73
|
+
output: unknown;
|
|
74
|
+
timestamp: number;
|
|
75
|
+
duration: number;
|
|
76
|
+
success: boolean;
|
|
77
|
+
}>;
|
|
78
|
+
readonly typeRegistry?: Map<string, unknown>;
|
|
79
|
+
readonly validationCache?: Map<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
export interface ParseError {
|
|
82
|
+
readonly name?: string;
|
|
83
|
+
readonly message: string;
|
|
84
|
+
readonly line: number;
|
|
85
|
+
readonly column: number;
|
|
86
|
+
readonly position?: number;
|
|
87
|
+
readonly source?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ASTNode {
|
|
90
|
+
readonly type: string;
|
|
91
|
+
readonly line?: number;
|
|
92
|
+
readonly column?: number;
|
|
93
|
+
readonly start?: number;
|
|
94
|
+
readonly end?: number;
|
|
95
|
+
readonly raw?: string;
|
|
96
|
+
[key: string]: unknown;
|
|
97
|
+
}
|
|
98
|
+
export interface EnhancedError {
|
|
99
|
+
readonly name: string;
|
|
100
|
+
readonly message: string;
|
|
101
|
+
readonly code: string;
|
|
102
|
+
readonly suggestions: string[];
|
|
103
|
+
readonly type?: string;
|
|
104
|
+
}
|
|
105
|
+
export type TypedResult<T = unknown> = {
|
|
106
|
+
readonly success: true;
|
|
107
|
+
readonly value: T;
|
|
108
|
+
readonly type: HyperScriptValueType;
|
|
109
|
+
} | {
|
|
110
|
+
readonly success: false;
|
|
111
|
+
readonly error: EnhancedError;
|
|
112
|
+
readonly errors?: ValidationError[];
|
|
113
|
+
readonly suggestions?: string[];
|
|
114
|
+
readonly type?: string;
|
|
115
|
+
};
|
|
116
|
+
export interface ExpressionMetadata {
|
|
117
|
+
readonly category: string;
|
|
118
|
+
readonly complexity: 'simple' | 'medium' | 'complex';
|
|
119
|
+
readonly sideEffects?: string[];
|
|
120
|
+
readonly dependencies?: string[];
|
|
121
|
+
readonly returnTypes?: EvaluationType[];
|
|
122
|
+
readonly examples?: Array<{
|
|
123
|
+
input: string;
|
|
124
|
+
description: string;
|
|
125
|
+
expectedOutput: unknown;
|
|
126
|
+
context?: Record<string, unknown>;
|
|
127
|
+
}>;
|
|
128
|
+
readonly relatedExpressions?: string[];
|
|
129
|
+
readonly performance?: {
|
|
130
|
+
averageTime: number;
|
|
131
|
+
complexity: string;
|
|
132
|
+
};
|
|
133
|
+
readonly environmentRequirements?: {
|
|
134
|
+
browser?: boolean;
|
|
135
|
+
server?: boolean;
|
|
136
|
+
dom?: boolean;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export interface LLMDocumentation {
|
|
140
|
+
readonly summary: string;
|
|
141
|
+
readonly parameters: Array<{
|
|
142
|
+
name: string;
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
optional: boolean;
|
|
146
|
+
examples: string[];
|
|
147
|
+
defaultValue?: unknown;
|
|
148
|
+
}>;
|
|
149
|
+
readonly returns: {
|
|
150
|
+
type: string;
|
|
151
|
+
description: string;
|
|
152
|
+
examples: unknown[];
|
|
153
|
+
};
|
|
154
|
+
readonly examples: Array<{
|
|
155
|
+
title: string;
|
|
156
|
+
code: string;
|
|
157
|
+
explanation: string;
|
|
158
|
+
output: unknown;
|
|
159
|
+
}>;
|
|
160
|
+
readonly seeAlso: string[];
|
|
161
|
+
readonly tags: string[];
|
|
162
|
+
readonly returnValue?: unknown;
|
|
163
|
+
}
|
|
164
|
+
export interface BaseTypedExpression<T = unknown> {
|
|
165
|
+
readonly name: string;
|
|
166
|
+
readonly category: string;
|
|
167
|
+
readonly syntax: string;
|
|
168
|
+
readonly outputType: EvaluationType;
|
|
169
|
+
readonly inputSchema: RuntimeValidator;
|
|
170
|
+
readonly metadata: ExpressionMetadata;
|
|
171
|
+
readonly documentation?: LLMDocumentation;
|
|
172
|
+
readonly description?: string;
|
|
173
|
+
evaluate(context: TypedExecutionContext, input: unknown): Promise<EvaluationResult<T>>;
|
|
174
|
+
validate(input: unknown): ValidationResult;
|
|
175
|
+
}
|
|
176
|
+
export interface ExpressionEvaluationOptions {
|
|
177
|
+
readonly validationMode?: 'strict' | 'permissive';
|
|
178
|
+
readonly timeout?: number;
|
|
179
|
+
readonly trackPerformance?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface TypedExpressionContext extends TypedExecutionContext {
|
|
182
|
+
}
|
|
183
|
+
export type FeatureCategory = 'Frontend' | 'Backend' | 'Data' | 'Communication' | 'Advanced';
|
|
184
|
+
export interface BaseTypedFeature<TInput = unknown, TOutput = unknown> {
|
|
185
|
+
readonly name: string;
|
|
186
|
+
readonly category: FeatureCategory;
|
|
187
|
+
readonly description: string;
|
|
188
|
+
readonly inputSchema: RuntimeValidator<TInput>;
|
|
189
|
+
readonly outputType: EvaluationType;
|
|
190
|
+
readonly metadata: FeatureMetadata;
|
|
191
|
+
readonly documentation?: LLMDocumentation;
|
|
192
|
+
initialize(context: TypedExecutionContext): Promise<TypedResult<void>>;
|
|
193
|
+
execute(context: TypedExecutionContext, input: TInput): Promise<TypedResult<TOutput>>;
|
|
194
|
+
validate(input: unknown): ValidationResult;
|
|
195
|
+
cleanup?(context: TypedExecutionContext): Promise<void>;
|
|
196
|
+
}
|
|
197
|
+
export interface FeatureMetadata {
|
|
198
|
+
readonly version: string;
|
|
199
|
+
readonly stability: 'stable' | 'experimental' | 'deprecated';
|
|
200
|
+
readonly performance: {
|
|
201
|
+
complexity: string;
|
|
202
|
+
memoryUsage: 'low' | 'medium' | 'high';
|
|
203
|
+
async: boolean;
|
|
204
|
+
};
|
|
205
|
+
readonly compatibility: {
|
|
206
|
+
browsers: string[];
|
|
207
|
+
nodeVersion?: string;
|
|
208
|
+
};
|
|
209
|
+
readonly examples: Array<{
|
|
210
|
+
title: string;
|
|
211
|
+
description: string;
|
|
212
|
+
code: string;
|
|
213
|
+
expectedOutput: unknown;
|
|
214
|
+
}>;
|
|
215
|
+
readonly relatedFeatures: string[];
|
|
216
|
+
}
|
|
217
|
+
export interface CommandResult {
|
|
218
|
+
readonly success: boolean;
|
|
219
|
+
readonly value?: unknown;
|
|
220
|
+
readonly error?: string;
|
|
221
|
+
readonly context?: ExecutionContext;
|
|
222
|
+
}
|
|
223
|
+
export interface BaseCommand {
|
|
224
|
+
readonly name: string;
|
|
225
|
+
readonly syntax: string;
|
|
226
|
+
readonly description?: string;
|
|
227
|
+
readonly metadata?: {
|
|
228
|
+
category?: string;
|
|
229
|
+
complexity?: 'simple' | 'medium' | 'complex';
|
|
230
|
+
sideEffects?: string[];
|
|
231
|
+
dependencies?: string[];
|
|
232
|
+
examples?: Array<{
|
|
233
|
+
code: string;
|
|
234
|
+
description: string;
|
|
235
|
+
}>;
|
|
236
|
+
};
|
|
237
|
+
execute(context: ExecutionContext, ...args: unknown[]): Promise<CommandResult>;
|
|
238
|
+
validate?(args: unknown[]): ValidationResult;
|
|
239
|
+
}
|
|
240
|
+
export interface BinaryExpressionNode extends ASTNode {
|
|
241
|
+
readonly type: 'binaryExpression';
|
|
242
|
+
readonly operator: string;
|
|
243
|
+
readonly left: ASTNode;
|
|
244
|
+
readonly right: ASTNode;
|
|
245
|
+
}
|
|
246
|
+
export interface UnaryExpressionNode extends ASTNode {
|
|
247
|
+
readonly type: 'unaryExpression';
|
|
248
|
+
readonly operator: string;
|
|
249
|
+
readonly operand: ASTNode;
|
|
250
|
+
}
|
|
251
|
+
export interface PropertyAccessNode extends ASTNode {
|
|
252
|
+
readonly type: 'propertyAccess';
|
|
253
|
+
readonly object: ASTNode;
|
|
254
|
+
readonly property: string;
|
|
255
|
+
}
|
|
256
|
+
export interface MemberExpressionNode extends ASTNode {
|
|
257
|
+
readonly type: 'memberExpression';
|
|
258
|
+
readonly expression: ASTNode;
|
|
259
|
+
readonly member: string;
|
|
260
|
+
}
|
|
261
|
+
export interface ContextReferenceNode extends ASTNode {
|
|
262
|
+
readonly type: 'contextReference';
|
|
263
|
+
readonly contextType: 'me' | 'you' | 'it' | 'target' | 'event';
|
|
264
|
+
}
|
|
265
|
+
export interface CommandNode extends ASTNode {
|
|
266
|
+
readonly type: 'command';
|
|
267
|
+
readonly name: string;
|
|
268
|
+
readonly args?: ASTNode[];
|
|
269
|
+
readonly source?: string;
|
|
270
|
+
}
|
|
271
|
+
export interface ExpressionNode extends ASTNode {
|
|
272
|
+
readonly type: 'expression';
|
|
273
|
+
readonly value?: unknown;
|
|
274
|
+
readonly operator?: string;
|
|
275
|
+
readonly operands?: ExpressionNode[];
|
|
276
|
+
}
|
|
277
|
+
export interface LiteralNode extends ASTNode {
|
|
278
|
+
readonly type: 'literal';
|
|
279
|
+
readonly value: string | number | boolean;
|
|
280
|
+
}
|
|
281
|
+
export interface EventHandlerNode extends ASTNode {
|
|
282
|
+
readonly type: 'eventHandler';
|
|
283
|
+
readonly event: string;
|
|
284
|
+
readonly events?: string[];
|
|
285
|
+
readonly target?: string;
|
|
286
|
+
readonly selector?: string;
|
|
287
|
+
readonly condition?: ASTNode;
|
|
288
|
+
readonly attributeName?: string;
|
|
289
|
+
readonly watchTarget?: ASTNode;
|
|
290
|
+
readonly args?: string[];
|
|
291
|
+
readonly commands: ASTNode[];
|
|
292
|
+
readonly customEventSource?: string;
|
|
293
|
+
readonly modifiers?: {
|
|
294
|
+
once?: boolean;
|
|
295
|
+
prevent?: boolean;
|
|
296
|
+
stop?: boolean;
|
|
297
|
+
debounce?: number;
|
|
298
|
+
throttle?: number;
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
export interface BehaviorNode extends ASTNode {
|
|
302
|
+
readonly type: 'behavior';
|
|
303
|
+
readonly name: string;
|
|
304
|
+
readonly parameters: string[];
|
|
305
|
+
readonly eventHandlers: EventHandlerNode[];
|
|
306
|
+
readonly initBlock?: ASTNode;
|
|
307
|
+
readonly namespace?: string;
|
|
308
|
+
}
|
|
309
|
+
export interface DefNode extends ASTNode {
|
|
310
|
+
readonly type: 'def';
|
|
311
|
+
readonly name: string;
|
|
312
|
+
readonly params: string[];
|
|
313
|
+
readonly body: CommandNode[];
|
|
314
|
+
readonly errorSymbol?: string;
|
|
315
|
+
readonly errorHandler?: CommandNode[];
|
|
316
|
+
readonly finallyHandler?: CommandNode[];
|
|
317
|
+
}
|
|
318
|
+
export interface TypedASTNode extends ASTNode {
|
|
319
|
+
readonly evaluationType: EvaluationType;
|
|
320
|
+
readonly validationResult: ValidationResult;
|
|
321
|
+
readonly metadata?: Record<string, unknown>;
|
|
322
|
+
}
|
|
323
|
+
export declare class TypeSystemBridge {
|
|
324
|
+
static toEnhanced(context: ExecutionContext): TypedExecutionContext;
|
|
325
|
+
static toLegacy(context: TypedExecutionContext): ExecutionContext;
|
|
326
|
+
static normalizeValidationResult(result: unknown): ValidationResult;
|
|
327
|
+
static toHyperScriptType(evaluationType: EvaluationType): HyperScriptValueType;
|
|
328
|
+
static createTypedResult<T>(success: boolean, value?: T, error?: string | EnhancedError, type?: HyperScriptValueType): TypedResult<T>;
|
|
329
|
+
}
|
|
330
|
+
export declare function createExecutionContext(me?: Element | null, overrides?: Partial<ExecutionContext>): ExecutionContext;
|
|
331
|
+
export declare function createTypedExecutionContext(base?: Partial<ExecutionContext>, overrides?: Partial<TypedExecutionContext>): TypedExecutionContext;
|
|
332
|
+
export declare function isTypedExecutionContext(context: ExecutionContext | TypedExecutionContext): context is TypedExecutionContext;
|
|
333
|
+
export declare function createSuccessValidation(): ValidationResult;
|
|
334
|
+
export declare function createFailureValidation(errors: ValidationError[], suggestions?: string[]): ValidationResult;
|
|
335
|
+
export declare function createValidationError(type: ValidationError['type'], message: string, suggestions?: string[]): ValidationError;
|
|
336
|
+
//# sourceMappingURL=base-types.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type CodeActionKind = 'quickfix' | 'refactor' | 'source';
|
|
2
|
+
export interface TextRange {
|
|
3
|
+
readonly start: number;
|
|
4
|
+
readonly end: number;
|
|
5
|
+
}
|
|
6
|
+
export interface TextEdit {
|
|
7
|
+
readonly type: 'insert' | 'replace' | 'delete';
|
|
8
|
+
readonly range?: TextRange;
|
|
9
|
+
readonly text?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FixCommand {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly arguments: readonly unknown[];
|
|
14
|
+
}
|
|
15
|
+
export interface CodeFix {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly kind: CodeActionKind;
|
|
19
|
+
readonly description?: string;
|
|
20
|
+
readonly edit?: TextEdit;
|
|
21
|
+
readonly command?: FixCommand;
|
|
22
|
+
readonly priority?: number;
|
|
23
|
+
readonly isPreferred?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface FixableError {
|
|
26
|
+
readonly code: string;
|
|
27
|
+
readonly message: string;
|
|
28
|
+
readonly severity: 'error' | 'warning' | 'info';
|
|
29
|
+
readonly fixes?: readonly CodeFix[];
|
|
30
|
+
}
|
|
31
|
+
export interface DiagnosticWithFixes {
|
|
32
|
+
readonly diagnosticIndex: number;
|
|
33
|
+
readonly fixes: readonly CodeFix[];
|
|
34
|
+
}
|
|
35
|
+
export interface DiagnosticResponseWithFixes {
|
|
36
|
+
readonly diagnostics: readonly unknown[];
|
|
37
|
+
readonly codeActions?: readonly DiagnosticWithFixes[];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=code-fix.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type CommandCategory = 'animation' | 'async' | 'control-flow' | 'data' | 'dom' | 'content' | 'navigation' | 'utility' | 'advanced' | 'event' | 'storage' | 'execution' | 'templates' | 'behaviors';
|
|
2
|
+
export declare const COMMAND_CATEGORIES: CommandCategory[];
|
|
3
|
+
export type CommandSideEffect = 'dom-mutation' | 'dom-query' | 'dom-creation' | 'dom-observation' | 'element-modification' | 'context-modification' | 'context-switching' | 'context-mutation' | 'state-mutation' | 'conditional-execution' | 'iteration' | 'control-flow' | 'execution-termination' | 'time' | 'timing' | 'style-change' | 'event-listening' | 'event-dispatch' | 'event-dispatching' | 'event-prevention' | 'event-listeners' | 'custom-events' | 'command-execution' | 'code-execution' | 'function-execution' | 'method-execution' | 'async-execution' | 'data-mutation' | 'data-binding' | 'property-transfer' | 'network' | 'storage' | 'navigation' | 'clipboard' | 'clipboard-write' | 'console' | 'console-output' | 'animation' | 'focus' | 'scroll' | 'scrolling' | 'template-execution' | 'behavior-installation' | 'random-selection' | 'debugging' | 'error-throwing';
|
|
4
|
+
export declare const COMMAND_SIDE_EFFECTS: CommandSideEffect[];
|
|
5
|
+
export interface CommandMetadata {
|
|
6
|
+
readonly description: string;
|
|
7
|
+
readonly syntax: string | readonly string[];
|
|
8
|
+
readonly examples: readonly string[];
|
|
9
|
+
readonly category: CommandCategory;
|
|
10
|
+
readonly sideEffects?: readonly CommandSideEffect[];
|
|
11
|
+
readonly deprecated?: boolean;
|
|
12
|
+
readonly deprecationMessage?: string;
|
|
13
|
+
readonly aliases?: readonly string[];
|
|
14
|
+
readonly relatedCommands?: readonly string[];
|
|
15
|
+
readonly version?: string;
|
|
16
|
+
readonly isBlocking?: boolean;
|
|
17
|
+
readonly hasBody?: boolean;
|
|
18
|
+
readonly performance?: {
|
|
19
|
+
readonly complexity?: 'O(1)' | 'O(n)' | 'O(n log n)' | 'O(n²)';
|
|
20
|
+
readonly isAsync?: boolean;
|
|
21
|
+
readonly mayBlock?: boolean;
|
|
22
|
+
};
|
|
23
|
+
readonly compatibility?: 'standard' | 'lokascript-extension' | 'experimental';
|
|
24
|
+
}
|
|
25
|
+
export interface MetadataValidationResult {
|
|
26
|
+
readonly isValid: boolean;
|
|
27
|
+
readonly errors: string[];
|
|
28
|
+
readonly warnings: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare function validateCommandMetadata(metadata: unknown, commandName: string): MetadataValidationResult;
|
|
31
|
+
export declare function normalizeCategory(category: string): CommandCategory;
|
|
32
|
+
export declare function createCommandMetadata(partial: Partial<CommandMetadata> & {
|
|
33
|
+
description: string;
|
|
34
|
+
syntax: string | readonly string[];
|
|
35
|
+
examples: readonly string[];
|
|
36
|
+
category: CommandCategory;
|
|
37
|
+
}): CommandMetadata;
|
|
38
|
+
export declare function mergeCommandMetadata(base: CommandMetadata, overrides: Partial<CommandMetadata>): CommandMetadata;
|
|
39
|
+
export declare function getSyntaxArray(metadata: CommandMetadata): readonly string[];
|
|
40
|
+
export declare function formatMetadataForDocs(commandName: string, metadata: CommandMetadata): string;
|
|
41
|
+
export interface CommandRegistryEntry {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly metadata: CommandMetadata;
|
|
44
|
+
readonly implementation: unknown;
|
|
45
|
+
}
|
|
46
|
+
export declare class CommandMetadataRegistry {
|
|
47
|
+
private commands;
|
|
48
|
+
register(name: string, metadata: CommandMetadata, implementation: unknown): void;
|
|
49
|
+
get(name: string): CommandRegistryEntry | undefined;
|
|
50
|
+
getCommandNames(): string[];
|
|
51
|
+
getByCategory(category: CommandCategory): CommandRegistryEntry[];
|
|
52
|
+
getDeprecated(): CommandRegistryEntry[];
|
|
53
|
+
validateAll(): Map<string, MetadataValidationResult>;
|
|
54
|
+
generateDocs(): string;
|
|
55
|
+
}
|
|
56
|
+
export declare const commandMetadataRegistry: CommandMetadataRegistry;
|
|
57
|
+
//# sourceMappingURL=command-metadata.d.ts.map
|