vsn 0.1.148 → 1.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/README.md +7 -6
- package/dist/index.cjs +5011 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +630 -0
- package/dist/index.d.ts +630 -0
- package/dist/index.js +4942 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +9 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +30 -48
- package/.gitattributes +0 -2
- package/.travis.yml +0 -28
- package/demo/demo.html +0 -237
- package/demo/examples/cascading-function-sheets.html +0 -39
- package/demo/examples/component-slots.html +0 -29
- package/demo/examples/events.html +0 -21
- package/demo/examples/item-filtering.html +0 -45
- package/demo/examples/loop.html +0 -21
- package/demo/examples/persist.html +0 -17
- package/demo/examples/replace-html.html +0 -19
- package/demo/markup-default.html +0 -2
- package/demo/markup.html +0 -2
- package/demo/memory-leak-test.html +0 -82
- package/demo/named-stack.html +0 -34
- package/demo/resources/xhr-animations.html +0 -24
- package/demo/resources/xhr-cfs.html +0 -1
- package/demo/resources/xhr-html.html +0 -1
- package/demo/resources/xhr-lazy.html +0 -60
- package/demo/resources/xhr-memory-leak-test.html +0 -14
- package/demo/resources/xhr-persist.html +0 -40
- package/demo/resources/xhr-test-component.html +0 -4
- package/demo/service.html +0 -22
- package/demo/silly-animations.html +0 -27
- package/demo/vsn.js +0 -3
- package/demo/xhr-response.html +0 -1
- package/demo/xhr-test.html +0 -32
- package/dist/AST/ArithmeticNode.d.ts +0 -15
- package/dist/AST/ArithmeticNode.js +0 -114
- package/dist/AST/ArithmeticNode.js.map +0 -1
- package/dist/AST/ArrayNode.d.ts +0 -14
- package/dist/AST/ArrayNode.js +0 -166
- package/dist/AST/ArrayNode.js.map +0 -1
- package/dist/AST/AsNode.d.ts +0 -13
- package/dist/AST/AsNode.js +0 -92
- package/dist/AST/AsNode.js.map +0 -1
- package/dist/AST/AssignmentNode.d.ts +0 -24
- package/dist/AST/AssignmentNode.js +0 -392
- package/dist/AST/AssignmentNode.js.map +0 -1
- package/dist/AST/BlockNode.d.ts +0 -11
- package/dist/AST/BlockNode.js +0 -114
- package/dist/AST/BlockNode.js.map +0 -1
- package/dist/AST/BooleanLiteralNode.d.ts +0 -5
- package/dist/AST/BooleanLiteralNode.js +0 -31
- package/dist/AST/BooleanLiteralNode.js.map +0 -1
- package/dist/AST/ClassNode.d.ts +0 -47
- package/dist/AST/ClassNode.js +0 -593
- package/dist/AST/ClassNode.js.map +0 -1
- package/dist/AST/ComparisonNode.d.ts +0 -15
- package/dist/AST/ComparisonNode.js +0 -120
- package/dist/AST/ComparisonNode.js.map +0 -1
- package/dist/AST/ConditionalNode.d.ts +0 -13
- package/dist/AST/ConditionalNode.js +0 -95
- package/dist/AST/ConditionalNode.js.map +0 -1
- package/dist/AST/DispatchEventNode.d.ts +0 -17
- package/dist/AST/DispatchEventNode.js +0 -152
- package/dist/AST/DispatchEventNode.js.map +0 -1
- package/dist/AST/ElementAttributeNode.d.ts +0 -20
- package/dist/AST/ElementAttributeNode.js +0 -242
- package/dist/AST/ElementAttributeNode.js.map +0 -1
- package/dist/AST/ElementQueryNode.d.ts +0 -17
- package/dist/AST/ElementQueryNode.js +0 -148
- package/dist/AST/ElementQueryNode.js.map +0 -1
- package/dist/AST/ElementStyleNode.d.ts +0 -20
- package/dist/AST/ElementStyleNode.js +0 -205
- package/dist/AST/ElementStyleNode.js.map +0 -1
- package/dist/AST/ForStatementNode.d.ts +0 -17
- package/dist/AST/ForStatementNode.js +0 -121
- package/dist/AST/ForStatementNode.js.map +0 -1
- package/dist/AST/FunctionArgumentNode.d.ts +0 -11
- package/dist/AST/FunctionArgumentNode.js +0 -142
- package/dist/AST/FunctionArgumentNode.js.map +0 -1
- package/dist/AST/FunctionCallNode.d.ts +0 -14
- package/dist/AST/FunctionCallNode.js +0 -241
- package/dist/AST/FunctionCallNode.js.map +0 -1
- package/dist/AST/FunctionNode.d.ts +0 -20
- package/dist/AST/FunctionNode.js +0 -220
- package/dist/AST/FunctionNode.js.map +0 -1
- package/dist/AST/IfStatementNode.d.ts +0 -14
- package/dist/AST/IfStatementNode.js +0 -168
- package/dist/AST/IfStatementNode.js.map +0 -1
- package/dist/AST/InNode.d.ts +0 -15
- package/dist/AST/InNode.js +0 -107
- package/dist/AST/InNode.js.map +0 -1
- package/dist/AST/IndexNode.d.ts +0 -16
- package/dist/AST/IndexNode.js +0 -152
- package/dist/AST/IndexNode.js.map +0 -1
- package/dist/AST/LiteralNode.d.ts +0 -10
- package/dist/AST/LiteralNode.js +0 -74
- package/dist/AST/LiteralNode.js.map +0 -1
- package/dist/AST/LoopNode.d.ts +0 -12
- package/dist/AST/LoopNode.js +0 -121
- package/dist/AST/LoopNode.js.map +0 -1
- package/dist/AST/ModifierNode.d.ts +0 -14
- package/dist/AST/ModifierNode.js +0 -90
- package/dist/AST/ModifierNode.js.map +0 -1
- package/dist/AST/NamedStackNode.d.ts +0 -28
- package/dist/AST/NamedStackNode.js +0 -142
- package/dist/AST/NamedStackNode.js.map +0 -1
- package/dist/AST/Node.d.ts +0 -28
- package/dist/AST/Node.js +0 -263
- package/dist/AST/Node.js.map +0 -1
- package/dist/AST/NotNode.d.ts +0 -12
- package/dist/AST/NotNode.js +0 -103
- package/dist/AST/NotNode.js.map +0 -1
- package/dist/AST/NumberLiteralNode.d.ts +0 -5
- package/dist/AST/NumberLiteralNode.js +0 -36
- package/dist/AST/NumberLiteralNode.js.map +0 -1
- package/dist/AST/ObjectNode.d.ts +0 -14
- package/dist/AST/ObjectNode.js +0 -147
- package/dist/AST/ObjectNode.js.map +0 -1
- package/dist/AST/OnNode.d.ts +0 -9
- package/dist/AST/OnNode.js +0 -129
- package/dist/AST/OnNode.js.map +0 -1
- package/dist/AST/RootScopeMemberNode.d.ts +0 -12
- package/dist/AST/RootScopeMemberNode.js +0 -90
- package/dist/AST/RootScopeMemberNode.js.map +0 -1
- package/dist/AST/ScopeMemberNode.d.ts +0 -13
- package/dist/AST/ScopeMemberNode.js +0 -165
- package/dist/AST/ScopeMemberNode.js.map +0 -1
- package/dist/AST/ScopeNodeAbstract.d.ts +0 -8
- package/dist/AST/ScopeNodeAbstract.js +0 -105
- package/dist/AST/ScopeNodeAbstract.js.map +0 -1
- package/dist/AST/StringFormatNode.d.ts +0 -18
- package/dist/AST/StringFormatNode.js +0 -151
- package/dist/AST/StringFormatNode.js.map +0 -1
- package/dist/AST/UnitLiteralNode.d.ts +0 -15
- package/dist/AST/UnitLiteralNode.js +0 -72
- package/dist/AST/UnitLiteralNode.js.map +0 -1
- package/dist/AST/WASM/Context.d.ts +0 -4
- package/dist/AST/WASM/Context.js +0 -18
- package/dist/AST/WASM/Context.js.map +0 -1
- package/dist/AST/WASM/Function.d.ts +0 -22
- package/dist/AST/WASM/Function.js +0 -126
- package/dist/AST/WASM/Function.js.map +0 -1
- package/dist/AST/WASM/Memory.d.ts +0 -12
- package/dist/AST/WASM/Memory.js +0 -22
- package/dist/AST/WASM/Memory.js.map +0 -1
- package/dist/AST/WASM/Section.d.ts +0 -5
- package/dist/AST/WASM/Section.js +0 -11
- package/dist/AST/WASM/Section.js.map +0 -1
- package/dist/AST/WASM.d.ts +0 -58
- package/dist/AST/WASM.js +0 -293
- package/dist/AST/WASM.js.map +0 -1
- package/dist/AST/WithNode.d.ts +0 -15
- package/dist/AST/WithNode.js +0 -197
- package/dist/AST/WithNode.js.map +0 -1
- package/dist/AST/XHRNode.d.ts +0 -15
- package/dist/AST/XHRNode.js +0 -151
- package/dist/AST/XHRNode.js.map +0 -1
- package/dist/AST.d.ts +0 -160
- package/dist/AST.js +0 -1156
- package/dist/AST.js.map +0 -1
- package/dist/Attribute.d.ts +0 -46
- package/dist/Attribute.js +0 -262
- package/dist/Attribute.js.map +0 -1
- package/dist/Bencmark.d.ts +0 -14
- package/dist/Bencmark.js +0 -236
- package/dist/Bencmark.js.map +0 -1
- package/dist/Component.d.ts +0 -7
- package/dist/Component.js +0 -179
- package/dist/Component.js.map +0 -1
- package/dist/Configuration.d.ts +0 -12
- package/dist/Configuration.js +0 -64
- package/dist/Configuration.js.map +0 -1
- package/dist/Controller.d.ts +0 -13
- package/dist/Controller.js +0 -60
- package/dist/Controller.js.map +0 -1
- package/dist/DOM/AbstractDOM.d.ts +0 -56
- package/dist/DOM/AbstractDOM.js +0 -1038
- package/dist/DOM/AbstractDOM.js.map +0 -1
- package/dist/DOM/DOMObject.d.ts +0 -33
- package/dist/DOM/DOMObject.js +0 -152
- package/dist/DOM/DOMObject.js.map +0 -1
- package/dist/DOM/ShadowDOM.d.ts +0 -5
- package/dist/DOM/ShadowDOM.js +0 -32
- package/dist/DOM/ShadowDOM.js.map +0 -1
- package/dist/DOM/WrappedDocument.d.ts +0 -5
- package/dist/DOM/WrappedDocument.js +0 -34
- package/dist/DOM/WrappedDocument.js.map +0 -1
- package/dist/DOM/WrappedWindow.d.ts +0 -6
- package/dist/DOM/WrappedWindow.js +0 -45
- package/dist/DOM/WrappedWindow.js.map +0 -1
- package/dist/DOM.d.ts +0 -5
- package/dist/DOM.js +0 -37
- package/dist/DOM.js.map +0 -1
- package/dist/EventDispatcher.d.ts +0 -36
- package/dist/EventDispatcher.js +0 -393
- package/dist/EventDispatcher.js.map +0 -1
- package/dist/Formats.d.ts +0 -5
- package/dist/Formats.js +0 -47
- package/dist/Formats.js.map +0 -1
- package/dist/MessageList.d.ts +0 -15
- package/dist/MessageList.js +0 -127
- package/dist/MessageList.js.map +0 -1
- package/dist/Model.d.ts +0 -12
- package/dist/Model.js +0 -92
- package/dist/Model.js.map +0 -1
- package/dist/Modifiers.d.ts +0 -17
- package/dist/Modifiers.js +0 -100
- package/dist/Modifiers.js.map +0 -1
- package/dist/Query.d.ts +0 -4
- package/dist/Query.js +0 -66
- package/dist/Query.js.map +0 -1
- package/dist/Registry.d.ts +0 -41
- package/dist/Registry.js +0 -165
- package/dist/Registry.js.map +0 -1
- package/dist/Scope/DynamicScopeData.d.ts +0 -6
- package/dist/Scope/DynamicScopeData.js +0 -83
- package/dist/Scope/DynamicScopeData.js.map +0 -1
- package/dist/Scope/ObjectAccessor.d.ts +0 -7
- package/dist/Scope/ObjectAccessor.js +0 -40
- package/dist/Scope/ObjectAccessor.js.map +0 -1
- package/dist/Scope/QueryReference.d.ts +0 -10
- package/dist/Scope/QueryReference.js +0 -103
- package/dist/Scope/QueryReference.js.map +0 -1
- package/dist/Scope/ScopeAbstract.d.ts +0 -9
- package/dist/Scope/ScopeAbstract.js +0 -28
- package/dist/Scope/ScopeAbstract.js.map +0 -1
- package/dist/Scope/ScopeData.d.ts +0 -4
- package/dist/Scope/ScopeData.js +0 -60
- package/dist/Scope/ScopeData.js.map +0 -1
- package/dist/Scope/ScopeDataAbstract.d.ts +0 -30
- package/dist/Scope/ScopeDataAbstract.js +0 -303
- package/dist/Scope/ScopeDataAbstract.js.map +0 -1
- package/dist/Scope/ScopeObject.d.ts +0 -3
- package/dist/Scope/ScopeObject.js +0 -28
- package/dist/Scope/ScopeObject.js.map +0 -1
- package/dist/Scope/ScopeReference.d.ts +0 -10
- package/dist/Scope/ScopeReference.js +0 -73
- package/dist/Scope/ScopeReference.js.map +0 -1
- package/dist/Scope/ScopedVariableType.d.ts +0 -6
- package/dist/Scope/ScopedVariableType.js +0 -14
- package/dist/Scope/ScopedVariableType.js.map +0 -1
- package/dist/Scope/WrappedArray.d.ts +0 -21
- package/dist/Scope/WrappedArray.js +0 -252
- package/dist/Scope/WrappedArray.js.map +0 -1
- package/dist/Scope/properties/ArrayProperty.d.ts +0 -12
- package/dist/Scope/properties/ArrayProperty.js +0 -88
- package/dist/Scope/properties/ArrayProperty.js.map +0 -1
- package/dist/Scope/properties/FloatProperty.d.ts +0 -4
- package/dist/Scope/properties/FloatProperty.js +0 -30
- package/dist/Scope/properties/FloatProperty.js.map +0 -1
- package/dist/Scope/properties/IntegerProperty.d.ts +0 -4
- package/dist/Scope/properties/IntegerProperty.js +0 -30
- package/dist/Scope/properties/IntegerProperty.js.map +0 -1
- package/dist/Scope/properties/Property.d.ts +0 -30
- package/dist/Scope/properties/Property.js +0 -205
- package/dist/Scope/properties/Property.js.map +0 -1
- package/dist/Scope/properties/_imports.d.ts +0 -4
- package/dist/Scope/properties/_imports.js +0 -13
- package/dist/Scope/properties/_imports.js.map +0 -1
- package/dist/Scope.d.ts +0 -39
- package/dist/Scope.js +0 -434
- package/dist/Scope.js.map +0 -1
- package/dist/Service.d.ts +0 -9
- package/dist/Service.js +0 -49
- package/dist/Service.js.map +0 -1
- package/dist/Tag/ShadowRootTag.d.ts +0 -3
- package/dist/Tag/ShadowRootTag.js +0 -28
- package/dist/Tag/ShadowRootTag.js.map +0 -1
- package/dist/Tag/SlotTag.d.ts +0 -3
- package/dist/Tag/SlotTag.js +0 -28
- package/dist/Tag/SlotTag.js.map +0 -1
- package/dist/Tag/SlottedTag.d.ts +0 -7
- package/dist/Tag/SlottedTag.js +0 -78
- package/dist/Tag/SlottedTag.js.map +0 -1
- package/dist/Tag/TagList.d.ts +0 -13
- package/dist/Tag/TagList.js +0 -104
- package/dist/Tag/TagList.js.map +0 -1
- package/dist/Tag.d.ts +0 -117
- package/dist/Tag.js +0 -1471
- package/dist/Tag.js.map +0 -1
- package/dist/Types.d.ts +0 -8
- package/dist/Types.js +0 -54
- package/dist/Types.js.map +0 -1
- package/dist/Validators.d.ts +0 -7
- package/dist/Validators.js +0 -54
- package/dist/Validators.js.map +0 -1
- package/dist/attributes/AddClassIf.d.ts +0 -4
- package/dist/attributes/AddClassIf.js +0 -93
- package/dist/attributes/AddClassIf.js.map +0 -1
- package/dist/attributes/Bind.d.ts +0 -24
- package/dist/attributes/Bind.js +0 -273
- package/dist/attributes/Bind.js.map +0 -1
- package/dist/attributes/ComponentAttribute.d.ts +0 -5
- package/dist/attributes/ComponentAttribute.js +0 -110
- package/dist/attributes/ComponentAttribute.js.map +0 -1
- package/dist/attributes/ControllerAttribute.d.ts +0 -11
- package/dist/attributes/ControllerAttribute.js +0 -127
- package/dist/attributes/ControllerAttribute.js.map +0 -1
- package/dist/attributes/DisableIf.d.ts +0 -5
- package/dist/attributes/DisableIf.js +0 -94
- package/dist/attributes/DisableIf.js.map +0 -1
- package/dist/attributes/Exec.d.ts +0 -10
- package/dist/attributes/Exec.js +0 -133
- package/dist/attributes/Exec.js.map +0 -1
- package/dist/attributes/Format.d.ts +0 -5
- package/dist/attributes/Format.js +0 -99
- package/dist/attributes/Format.js.map +0 -1
- package/dist/attributes/If.d.ts +0 -11
- package/dist/attributes/If.js +0 -159
- package/dist/attributes/If.js.map +0 -1
- package/dist/attributes/JSONAttribute.d.ts +0 -5
- package/dist/attributes/JSONAttribute.js +0 -119
- package/dist/attributes/JSONAttribute.js.map +0 -1
- package/dist/attributes/KeyAbstract.d.ts +0 -7
- package/dist/attributes/KeyAbstract.js +0 -117
- package/dist/attributes/KeyAbstract.js.map +0 -1
- package/dist/attributes/KeyDown.d.ts +0 -4
- package/dist/attributes/KeyDown.js +0 -88
- package/dist/attributes/KeyDown.js.map +0 -1
- package/dist/attributes/KeyUp.d.ts +0 -4
- package/dist/attributes/KeyUp.js +0 -88
- package/dist/attributes/KeyUp.js.map +0 -1
- package/dist/attributes/LazyAttribute.d.ts +0 -8
- package/dist/attributes/LazyAttribute.js +0 -122
- package/dist/attributes/LazyAttribute.js.map +0 -1
- package/dist/attributes/List.d.ts +0 -18
- package/dist/attributes/List.js +0 -396
- package/dist/attributes/List.js.map +0 -1
- package/dist/attributes/ListItem.d.ts +0 -12
- package/dist/attributes/ListItem.js +0 -119
- package/dist/attributes/ListItem.js.map +0 -1
- package/dist/attributes/ListItemModel.d.ts +0 -4
- package/dist/attributes/ListItemModel.js +0 -39
- package/dist/attributes/ListItemModel.js.map +0 -1
- package/dist/attributes/ModelAttribute.d.ts +0 -5
- package/dist/attributes/ModelAttribute.js +0 -41
- package/dist/attributes/ModelAttribute.js.map +0 -1
- package/dist/attributes/Name.d.ts +0 -6
- package/dist/attributes/Name.js +0 -88
- package/dist/attributes/Name.js.map +0 -1
- package/dist/attributes/On.d.ts +0 -9
- package/dist/attributes/On.js +0 -135
- package/dist/attributes/On.js.map +0 -1
- package/dist/attributes/PersistAttribute.d.ts +0 -15
- package/dist/attributes/PersistAttribute.js +0 -215
- package/dist/attributes/PersistAttribute.js.map +0 -1
- package/dist/attributes/Referenced.d.ts +0 -3
- package/dist/attributes/Referenced.js +0 -38
- package/dist/attributes/Referenced.js.map +0 -1
- package/dist/attributes/RootAttribute.d.ts +0 -7
- package/dist/attributes/RootAttribute.js +0 -141
- package/dist/attributes/RootAttribute.js.map +0 -1
- package/dist/attributes/ScopeAttribute.d.ts +0 -9
- package/dist/attributes/ScopeAttribute.js +0 -152
- package/dist/attributes/ScopeAttribute.js.map +0 -1
- package/dist/attributes/ScopeChange.d.ts +0 -10
- package/dist/attributes/ScopeChange.js +0 -153
- package/dist/attributes/ScopeChange.js.map +0 -1
- package/dist/attributes/ScriptAttribute.d.ts +0 -4
- package/dist/attributes/ScriptAttribute.js +0 -45
- package/dist/attributes/ScriptAttribute.js.map +0 -1
- package/dist/attributes/ServiceAttribute.d.ts +0 -7
- package/dist/attributes/ServiceAttribute.js +0 -45
- package/dist/attributes/ServiceAttribute.js.map +0 -1
- package/dist/attributes/SetAttribute.d.ts +0 -11
- package/dist/attributes/SetAttribute.js +0 -146
- package/dist/attributes/SetAttribute.js.map +0 -1
- package/dist/attributes/StandardAttribute.d.ts +0 -15
- package/dist/attributes/StandardAttribute.js +0 -170
- package/dist/attributes/StandardAttribute.js.map +0 -1
- package/dist/attributes/StyleAttribute.d.ts +0 -14
- package/dist/attributes/StyleAttribute.js +0 -218
- package/dist/attributes/StyleAttribute.js.map +0 -1
- package/dist/attributes/StyleVarAttribute.d.ts +0 -11
- package/dist/attributes/StyleVarAttribute.js +0 -124
- package/dist/attributes/StyleVarAttribute.js.map +0 -1
- package/dist/attributes/TemplateAttribute.d.ts +0 -5
- package/dist/attributes/TemplateAttribute.js +0 -89
- package/dist/attributes/TemplateAttribute.js.map +0 -1
- package/dist/attributes/TypeAttribute.d.ts +0 -5
- package/dist/attributes/TypeAttribute.js +0 -104
- package/dist/attributes/TypeAttribute.js.map +0 -1
- package/dist/attributes/XHRAttribute.d.ts +0 -14
- package/dist/attributes/XHRAttribute.js +0 -242
- package/dist/attributes/XHRAttribute.js.map +0 -1
- package/dist/attributes/_imports.d.ts +0 -32
- package/dist/attributes/_imports.js +0 -68
- package/dist/attributes/_imports.js.map +0 -1
- package/dist/contrib/XHR.d.ts +0 -21
- package/dist/contrib/XHR.js +0 -78
- package/dist/contrib/XHR.js.map +0 -1
- package/dist/contrib/_imports.d.ts +0 -1
- package/dist/contrib/_imports.js +0 -6
- package/dist/contrib/_imports.js.map +0 -1
- package/dist/custom-elements.d.ts +0 -9
- package/dist/custom-elements.js +0 -44
- package/dist/custom-elements.js.map +0 -1
- package/dist/demo/ServiceDemo.d.ts +0 -5
- package/dist/demo/ServiceDemo.js +0 -87
- package/dist/demo/ServiceDemo.js.map +0 -1
- package/dist/demo.d.ts +0 -2
- package/dist/demo.js +0 -17
- package/dist/demo.js.map +0 -1
- package/dist/helpers/DOMHelper.d.ts +0 -3
- package/dist/helpers/DOMHelper.js +0 -81
- package/dist/helpers/DOMHelper.js.map +0 -1
- package/dist/helpers/ElementHelper.d.ts +0 -4
- package/dist/helpers/ElementHelper.js +0 -53
- package/dist/helpers/ElementHelper.js.map +0 -1
- package/dist/helpers/VisionHelper.d.ts +0 -13
- package/dist/helpers/VisionHelper.js +0 -148
- package/dist/helpers/VisionHelper.js.map +0 -1
- package/dist/helpers/decorators.d.ts +0 -5
- package/dist/helpers/decorators.js +0 -59
- package/dist/helpers/decorators.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -5
- package/dist/version.js.map +0 -1
- package/dist/vsn.d.ts +0 -36
- package/dist/vsn.js +0 -201
- package/dist/vsn.js.map +0 -1
- package/karma.conf.js +0 -34
- package/src/AST/ArithmeticNode.ts +0 -52
- package/src/AST/ArrayNode.ts +0 -39
- package/src/AST/AsNode.ts +0 -32
- package/src/AST/AssignmentNode.ts +0 -256
- package/src/AST/BlockNode.ts +0 -25
- package/src/AST/BooleanLiteralNode.ts +0 -10
- package/src/AST/ClassNode.ts +0 -267
- package/src/AST/ComparisonNode.ts +0 -57
- package/src/AST/ConditionalNode.ts +0 -36
- package/src/AST/DispatchEventNode.ts +0 -58
- package/src/AST/ElementAttributeNode.ts +0 -97
- package/src/AST/ElementQueryNode.ts +0 -48
- package/src/AST/ElementStyleNode.ts +0 -74
- package/src/AST/ForStatementNode.ts +0 -59
- package/src/AST/FunctionArgumentNode.ts +0 -27
- package/src/AST/FunctionCallNode.ts +0 -93
- package/src/AST/FunctionNode.ts +0 -82
- package/src/AST/IfStatementNode.ts +0 -67
- package/src/AST/InNode.ts +0 -46
- package/src/AST/IndexNode.ts +0 -64
- package/src/AST/LiteralNode.ts +0 -17
- package/src/AST/LoopNode.ts +0 -35
- package/src/AST/ModifierNode.ts +0 -32
- package/src/AST/NamedStackNode.ts +0 -83
- package/src/AST/Node.ts +0 -104
- package/src/AST/NotNode.ts +0 -41
- package/src/AST/NumberLiteralNode.ts +0 -14
- package/src/AST/ObjectNode.ts +0 -55
- package/src/AST/OnNode.ts +0 -23
- package/src/AST/RootScopeMemberNode.ts +0 -27
- package/src/AST/ScopeMemberNode.ts +0 -63
- package/src/AST/ScopeNodeAbstract.ts +0 -21
- package/src/AST/StringFormatNode.ts +0 -43
- package/src/AST/UnitLiteralNode.ts +0 -51
- package/src/AST/WASM/Context.ts +0 -12
- package/src/AST/WASM/Function.ts +0 -67
- package/src/AST/WASM/Memory.ts +0 -21
- package/src/AST/WASM/Section.ts +0 -6
- package/src/AST/WASM.ts +0 -244
- package/src/AST/WithNode.ts +0 -68
- package/src/AST/XHRNode.ts +0 -85
- package/src/AST.ts +0 -969
- package/src/Attribute.ts +0 -130
- package/src/Bencmark.ts +0 -184
- package/src/Component.ts +0 -63
- package/src/Configuration.ts +0 -47
- package/src/Controller.ts +0 -36
- package/src/DOM/AbstractDOM.ts +0 -462
- package/src/DOM/DOMObject.ts +0 -77
- package/src/DOM/ShadowDOM.ts +0 -15
- package/src/DOM/WrappedDocument.ts +0 -9
- package/src/DOM/WrappedWindow.ts +0 -21
- package/src/DOM.ts +0 -13
- package/src/EventDispatcher.ts +0 -234
- package/src/Formats.ts +0 -33
- package/src/MessageList.ts +0 -85
- package/src/Model.ts +0 -44
- package/src/Modifiers.ts +0 -54
- package/src/Query.ts +0 -17
- package/src/Registry.ts +0 -141
- package/src/Scope/DynamicScopeData.ts +0 -27
- package/src/Scope/ObjectAccessor.ts +0 -21
- package/src/Scope/QueryReference.ts +0 -29
- package/src/Scope/ScopeAbstract.ts +0 -11
- package/src/Scope/ScopeData.ts +0 -20
- package/src/Scope/ScopeDataAbstract.ts +0 -200
- package/src/Scope/ScopeObject.ts +0 -3
- package/src/Scope/ScopeReference.ts +0 -30
- package/src/Scope/ScopedVariableType.ts +0 -7
- package/src/Scope/WrappedArray.ts +0 -134
- package/src/Scope/properties/ArrayProperty.ts +0 -46
- package/src/Scope/properties/FloatProperty.ts +0 -5
- package/src/Scope/properties/IntegerProperty.ts +0 -5
- package/src/Scope/properties/Property.ts +0 -173
- package/src/Scope/properties/_imports.ts +0 -4
- package/src/Scope.ts +0 -333
- package/src/Service.ts +0 -24
- package/src/Tag/ShadowRootTag.ts +0 -5
- package/src/Tag/SlotTag.ts +0 -5
- package/src/Tag/SlottedTag.ts +0 -17
- package/src/Tag/TagList.ts +0 -52
- package/src/Tag.ts +0 -838
- package/src/Types.ts +0 -34
- package/src/Validators.ts +0 -45
- package/src/attributes/AddClassIf.ts +0 -14
- package/src/attributes/Bind.ts +0 -144
- package/src/attributes/ComponentAttribute.ts +0 -23
- package/src/attributes/ControllerAttribute.ts +0 -50
- package/src/attributes/DisableIf.ts +0 -16
- package/src/attributes/Exec.ts +0 -32
- package/src/attributes/Format.ts +0 -18
- package/src/attributes/If.ts +0 -40
- package/src/attributes/JSONAttribute.ts +0 -40
- package/src/attributes/KeyAbstract.ts +0 -28
- package/src/attributes/KeyDown.ts +0 -10
- package/src/attributes/KeyUp.ts +0 -10
- package/src/attributes/LazyAttribute.ts +0 -30
- package/src/attributes/List.ts +0 -210
- package/src/attributes/ListItem.ts +0 -30
- package/src/attributes/ListItemModel.ts +0 -7
- package/src/attributes/ModelAttribute.ts +0 -8
- package/src/attributes/Name.ts +0 -16
- package/src/attributes/On.ts +0 -39
- package/src/attributes/PersistAttribute.ts +0 -83
- package/src/attributes/Referenced.ts +0 -5
- package/src/attributes/RootAttribute.ts +0 -24
- package/src/attributes/ScopeAttribute.ts +0 -40
- package/src/attributes/ScopeChange.ts +0 -35
- package/src/attributes/ScriptAttribute.ts +0 -9
- package/src/attributes/ServiceAttribute.ts +0 -13
- package/src/attributes/SetAttribute.ts +0 -44
- package/src/attributes/StandardAttribute.ts +0 -72
- package/src/attributes/StyleAttribute.ts +0 -90
- package/src/attributes/StyleVarAttribute.ts +0 -40
- package/src/attributes/TemplateAttribute.ts +0 -12
- package/src/attributes/TypeAttribute.ts +0 -23
- package/src/attributes/XHRAttribute.ts +0 -109
- package/src/attributes/_imports.ts +0 -32
- package/src/contrib/XHR.ts +0 -46
- package/src/contrib/_imports.ts +0 -1
- package/src/custom-elements.ts +0 -46
- package/src/demo/ServiceDemo.ts +0 -12
- package/src/demo.ts +0 -2
- package/src/helpers/DOMHelper.ts +0 -17
- package/src/helpers/ElementHelper.ts +0 -26
- package/src/helpers/VisionHelper.ts +0 -88
- package/src/helpers/decorators.ts +0 -11
- package/src/version.ts +0 -2
- package/src/vsn.ts +0 -106
- package/test/AST/ArithmeticAssignmentNode.spec.ts +0 -45
- package/test/AST/ClassNode.spec.ts +0 -175
- package/test/AST/FunctionNode.spec.ts +0 -51
- package/test/AST/StringFormatNode.spec.ts +0 -12
- package/test/AST/WASM.spec.ts +0 -63
- package/test/AST/XHRNode.spec.ts +0 -10
- package/test/AST.spec.ts +0 -353
- package/test/Controller.spec.ts +0 -42
- package/test/DOM.spec.ts +0 -63
- package/test/EventDispatcher.spec.ts +0 -191
- package/test/MessageList.spec.ts +0 -101
- package/test/Model/DataModel.spec.ts +0 -0
- package/test/Scope/DynamicScopeData.spec.ts +0 -141
- package/test/Scope/ScopeData.spec.ts +0 -58
- package/test/Scope/WrappedArray.spec.ts +0 -11
- package/test/Scope/properties/ArrayProperty.spec.ts +0 -23
- package/test/Scope.spec.ts +0 -69
- package/test/Tag/TagList.spec.ts +0 -21
- package/test/Tag.spec.ts +0 -4
- package/test/attributes/Bind.spec.ts +0 -174
- package/test/attributes/JSONAttribute.spec.ts +0 -91
- package/test/attributes/ListItem.spec.ts +0 -118
- package/test/attributes/ScopeAttribute.spec.ts +0 -35
- package/test/attributes/ServiceAttribute.spec.ts +0 -41
- package/test/attributes/SetAttribute.spec.ts +0 -55
- package/test/attributes/Styles.spec.ts +0 -43
- package/test/globals.js +0 -2
- package/tsconfig.base.json +0 -17
- package/tsconfig.json +0 -6
- package/tsconfig.test.json +0 -7
- package/types/vsn-component.d.ts +0 -5
- package/webpack.config.js +0 -48
- package/webpack.development.js +0 -6
- package/webpack.production.js +0 -5
package/dist/AST/WASM.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { FunctionSection } from "./WASM/Function";
|
|
2
|
-
export declare const ieee754: (...args: any[]) => any;
|
|
3
|
-
export declare const encodeString: (...args: any[]) => any;
|
|
4
|
-
export declare const signedLEB128: (...args: any[]) => any;
|
|
5
|
-
export declare const unsignedLEB128: (...args: any[]) => any;
|
|
6
|
-
export declare const flatten: (arr: any[]) => any;
|
|
7
|
-
export declare enum EValueType {
|
|
8
|
-
i32 = 127,
|
|
9
|
-
f32 = 125
|
|
10
|
-
}
|
|
11
|
-
export declare enum EBlockType {
|
|
12
|
-
void = 64
|
|
13
|
-
}
|
|
14
|
-
export declare enum EOpCode {
|
|
15
|
-
block = 2,
|
|
16
|
-
loop = 3,
|
|
17
|
-
br = 12,
|
|
18
|
-
br_if = 13,
|
|
19
|
-
end = 11,
|
|
20
|
-
call = 16,
|
|
21
|
-
get_local = 32,
|
|
22
|
-
set_local = 33,
|
|
23
|
-
i32_store_8 = 58,
|
|
24
|
-
i32_const = 65,
|
|
25
|
-
f32_const = 67,
|
|
26
|
-
i32_add = 106,
|
|
27
|
-
i32_sub = 107,
|
|
28
|
-
i32_mul = 108,
|
|
29
|
-
i32_div = 109,
|
|
30
|
-
i32_eqz = 69,
|
|
31
|
-
i32_eq = 70,
|
|
32
|
-
f32_eq = 91,
|
|
33
|
-
f32_lt = 93,
|
|
34
|
-
f32_gt = 94,
|
|
35
|
-
i32_and = 113,
|
|
36
|
-
f32_add = 146,
|
|
37
|
-
f32_sub = 147,
|
|
38
|
-
f32_mul = 148,
|
|
39
|
-
f32_div = 149,
|
|
40
|
-
i32_trunc_f32_s = 168,
|
|
41
|
-
memory_size = 63,
|
|
42
|
-
memory_grow = 64,
|
|
43
|
-
scope_get = 1024,
|
|
44
|
-
scope_set = 1025
|
|
45
|
-
}
|
|
46
|
-
export declare enum EExportType {
|
|
47
|
-
func = 0,
|
|
48
|
-
table = 1,
|
|
49
|
-
mem = 2,
|
|
50
|
-
global = 3
|
|
51
|
-
}
|
|
52
|
-
export declare const functionType = 96;
|
|
53
|
-
export declare const emptyArray = 0;
|
|
54
|
-
export declare const encodeVector: (data: any[]) => any[];
|
|
55
|
-
export declare const encodeLocal: (count: number, type: EValueType) => any[];
|
|
56
|
-
export declare const emitter: (functions: FunctionSection[]) => Uint8Array;
|
|
57
|
-
export declare function compile(functions: FunctionSection[], memory?: WebAssembly.Memory): Promise<WebAssembly.WebAssemblyInstantiatedSource>;
|
|
58
|
-
export declare function run(functions: FunctionSection | FunctionSection[], ...args: any[]): Promise<any>;
|
package/dist/AST/WASM.js
DELETED
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
-
if (!m) return o;
|
|
41
|
-
var i = m.call(o), r, ar = [], e;
|
|
42
|
-
try {
|
|
43
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
-
}
|
|
45
|
-
catch (error) { e = { error: error }; }
|
|
46
|
-
finally {
|
|
47
|
-
try {
|
|
48
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
-
}
|
|
50
|
-
finally { if (e) throw e.error; }
|
|
51
|
-
}
|
|
52
|
-
return ar;
|
|
53
|
-
};
|
|
54
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
55
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
56
|
-
to[j] = from[i];
|
|
57
|
-
return to;
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
exports.run = exports.compile = exports.emitter = exports.encodeLocal = exports.encodeVector = exports.emptyArray = exports.functionType = exports.EExportType = exports.EOpCode = exports.EBlockType = exports.EValueType = exports.flatten = exports.unsignedLEB128 = exports.signedLEB128 = exports.encodeString = exports.ieee754 = void 0;
|
|
61
|
-
var VisionHelper_1 = require("../helpers/VisionHelper");
|
|
62
|
-
var Function_1 = require("./WASM/Function");
|
|
63
|
-
var dummyFunc = function () {
|
|
64
|
-
var args = [];
|
|
65
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
66
|
-
args[_i] = arguments[_i];
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
};
|
|
70
|
-
var dummyVal = null;
|
|
71
|
-
var _ieee754 = dummyFunc;
|
|
72
|
-
var _encodeString = dummyFunc;
|
|
73
|
-
var _signedLEB128 = dummyFunc;
|
|
74
|
-
var _unsignedLEB128 = dummyFunc;
|
|
75
|
-
_ieee754 = function (n) {
|
|
76
|
-
var buf = Buffer.allocUnsafe(4);
|
|
77
|
-
buf.writeFloatLE(n, 0);
|
|
78
|
-
return Uint8Array.from(buf);
|
|
79
|
-
};
|
|
80
|
-
_encodeString = function (str) { return __spreadArray([
|
|
81
|
-
str.length
|
|
82
|
-
], __read(str.split("").map(function (s) { return s.charCodeAt(0); }))); };
|
|
83
|
-
_signedLEB128 = function (n) {
|
|
84
|
-
var buffer = [];
|
|
85
|
-
var more = true;
|
|
86
|
-
var isNegative = n < 0;
|
|
87
|
-
var bitCount = Math.ceil(Math.log2(Math.abs(n))) + 1;
|
|
88
|
-
while (more) {
|
|
89
|
-
var byte = n & 0x7f;
|
|
90
|
-
n >>= 7;
|
|
91
|
-
if (isNegative) {
|
|
92
|
-
n = n | -(1 << (bitCount - 8));
|
|
93
|
-
}
|
|
94
|
-
if ((n === 0 && (byte & 0x40) === 0) || (n === -1 && (byte & 0x40) !== 0x40)) {
|
|
95
|
-
more = false;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
byte |= 0x80;
|
|
99
|
-
}
|
|
100
|
-
buffer.push(byte);
|
|
101
|
-
}
|
|
102
|
-
return buffer;
|
|
103
|
-
};
|
|
104
|
-
_unsignedLEB128 = function (n) {
|
|
105
|
-
var buffer = [];
|
|
106
|
-
do {
|
|
107
|
-
var byte = n & 0x7f;
|
|
108
|
-
n >>>= 7;
|
|
109
|
-
if (n !== 0) {
|
|
110
|
-
byte |= 0x80;
|
|
111
|
-
}
|
|
112
|
-
buffer.push(byte);
|
|
113
|
-
} while (n !== 0);
|
|
114
|
-
return buffer;
|
|
115
|
-
};
|
|
116
|
-
exports.ieee754 = _ieee754;
|
|
117
|
-
exports.encodeString = _encodeString;
|
|
118
|
-
exports.signedLEB128 = _signedLEB128;
|
|
119
|
-
exports.unsignedLEB128 = _unsignedLEB128;
|
|
120
|
-
var flatten = function (arr) {
|
|
121
|
-
return [].concat.apply([], arr);
|
|
122
|
-
};
|
|
123
|
-
exports.flatten = flatten;
|
|
124
|
-
var ESectionType;
|
|
125
|
-
(function (ESectionType) {
|
|
126
|
-
ESectionType[ESectionType["custom"] = 0] = "custom";
|
|
127
|
-
ESectionType[ESectionType["type"] = 1] = "type";
|
|
128
|
-
ESectionType[ESectionType["import"] = 2] = "import";
|
|
129
|
-
ESectionType[ESectionType["func"] = 3] = "func";
|
|
130
|
-
ESectionType[ESectionType["table"] = 4] = "table";
|
|
131
|
-
ESectionType[ESectionType["memory"] = 5] = "memory";
|
|
132
|
-
ESectionType[ESectionType["global"] = 6] = "global";
|
|
133
|
-
ESectionType[ESectionType["export"] = 7] = "export";
|
|
134
|
-
ESectionType[ESectionType["start"] = 8] = "start";
|
|
135
|
-
ESectionType[ESectionType["element"] = 9] = "element";
|
|
136
|
-
ESectionType[ESectionType["code"] = 10] = "code";
|
|
137
|
-
ESectionType[ESectionType["data"] = 11] = "data";
|
|
138
|
-
})(ESectionType || (ESectionType = {}));
|
|
139
|
-
// https://webassembly.github.io/spec/core/binary/types.html
|
|
140
|
-
var EValueType;
|
|
141
|
-
(function (EValueType) {
|
|
142
|
-
EValueType[EValueType["i32"] = 127] = "i32";
|
|
143
|
-
EValueType[EValueType["f32"] = 125] = "f32";
|
|
144
|
-
})(EValueType = exports.EValueType || (exports.EValueType = {}));
|
|
145
|
-
// https://webassembly.github.io/spec/core/binary/types.html#binary-blocktype
|
|
146
|
-
var EBlockType;
|
|
147
|
-
(function (EBlockType) {
|
|
148
|
-
EBlockType[EBlockType["void"] = 64] = "void";
|
|
149
|
-
})(EBlockType = exports.EBlockType || (exports.EBlockType = {}));
|
|
150
|
-
// https://webassembly.github.io/spec/core/binary/instructions.html
|
|
151
|
-
var EOpCode;
|
|
152
|
-
(function (EOpCode) {
|
|
153
|
-
EOpCode[EOpCode["block"] = 2] = "block";
|
|
154
|
-
EOpCode[EOpCode["loop"] = 3] = "loop";
|
|
155
|
-
EOpCode[EOpCode["br"] = 12] = "br";
|
|
156
|
-
EOpCode[EOpCode["br_if"] = 13] = "br_if";
|
|
157
|
-
EOpCode[EOpCode["end"] = 11] = "end";
|
|
158
|
-
EOpCode[EOpCode["call"] = 16] = "call";
|
|
159
|
-
EOpCode[EOpCode["get_local"] = 32] = "get_local";
|
|
160
|
-
EOpCode[EOpCode["set_local"] = 33] = "set_local";
|
|
161
|
-
EOpCode[EOpCode["i32_store_8"] = 58] = "i32_store_8";
|
|
162
|
-
EOpCode[EOpCode["i32_const"] = 65] = "i32_const";
|
|
163
|
-
EOpCode[EOpCode["f32_const"] = 67] = "f32_const";
|
|
164
|
-
EOpCode[EOpCode["i32_add"] = 106] = "i32_add";
|
|
165
|
-
EOpCode[EOpCode["i32_sub"] = 107] = "i32_sub";
|
|
166
|
-
EOpCode[EOpCode["i32_mul"] = 108] = "i32_mul";
|
|
167
|
-
EOpCode[EOpCode["i32_div"] = 109] = "i32_div";
|
|
168
|
-
EOpCode[EOpCode["i32_eqz"] = 69] = "i32_eqz";
|
|
169
|
-
EOpCode[EOpCode["i32_eq"] = 70] = "i32_eq";
|
|
170
|
-
EOpCode[EOpCode["f32_eq"] = 91] = "f32_eq";
|
|
171
|
-
EOpCode[EOpCode["f32_lt"] = 93] = "f32_lt";
|
|
172
|
-
EOpCode[EOpCode["f32_gt"] = 94] = "f32_gt";
|
|
173
|
-
EOpCode[EOpCode["i32_and"] = 113] = "i32_and";
|
|
174
|
-
EOpCode[EOpCode["f32_add"] = 146] = "f32_add";
|
|
175
|
-
EOpCode[EOpCode["f32_sub"] = 147] = "f32_sub";
|
|
176
|
-
EOpCode[EOpCode["f32_mul"] = 148] = "f32_mul";
|
|
177
|
-
EOpCode[EOpCode["f32_div"] = 149] = "f32_div";
|
|
178
|
-
EOpCode[EOpCode["i32_trunc_f32_s"] = 168] = "i32_trunc_f32_s";
|
|
179
|
-
EOpCode[EOpCode["memory_size"] = 63] = "memory_size";
|
|
180
|
-
EOpCode[EOpCode["memory_grow"] = 64] = "memory_grow";
|
|
181
|
-
// Vision op codes
|
|
182
|
-
EOpCode[EOpCode["scope_get"] = 1024] = "scope_get";
|
|
183
|
-
EOpCode[EOpCode["scope_set"] = 1025] = "scope_set";
|
|
184
|
-
})(EOpCode = exports.EOpCode || (exports.EOpCode = {}));
|
|
185
|
-
var binaryOpcode = {
|
|
186
|
-
"+": EOpCode.f32_add,
|
|
187
|
-
"-": EOpCode.f32_sub,
|
|
188
|
-
"*": EOpCode.f32_mul,
|
|
189
|
-
"/": EOpCode.f32_div,
|
|
190
|
-
"==": EOpCode.f32_eq,
|
|
191
|
-
">": EOpCode.f32_gt,
|
|
192
|
-
"<": EOpCode.f32_lt,
|
|
193
|
-
"&&": EOpCode.i32_and
|
|
194
|
-
};
|
|
195
|
-
// http://webassembly.github.io/spec/core/binary/modules.html#export-section
|
|
196
|
-
var EExportType;
|
|
197
|
-
(function (EExportType) {
|
|
198
|
-
EExportType[EExportType["func"] = 0] = "func";
|
|
199
|
-
EExportType[EExportType["table"] = 1] = "table";
|
|
200
|
-
EExportType[EExportType["mem"] = 2] = "mem";
|
|
201
|
-
EExportType[EExportType["global"] = 3] = "global";
|
|
202
|
-
})(EExportType = exports.EExportType || (exports.EExportType = {}));
|
|
203
|
-
// http://webassembly.github.io/spec/core/binary/types.html#function-types
|
|
204
|
-
exports.functionType = 0x60;
|
|
205
|
-
exports.emptyArray = 0x0;
|
|
206
|
-
// https://webassembly.github.io/spec/core/binary/modules.html#binary-module
|
|
207
|
-
var magicModuleHeader = [0x00, 0x61, 0x73, 0x6d];
|
|
208
|
-
var moduleVersion = [0x01, 0x00, 0x00, 0x00];
|
|
209
|
-
// https://webassembly.github.io/spec/core/binary/conventions.html#binary-vec
|
|
210
|
-
// Vectors are encoded with their length followed by their element sequence
|
|
211
|
-
var encodeVector = function (data) { return __spreadArray(__spreadArray([], __read(exports.unsignedLEB128(data.length))), __read(exports.flatten(data))); };
|
|
212
|
-
exports.encodeVector = encodeVector;
|
|
213
|
-
// https://webassembly.github.io/spec/core/binary/modules.html#code-section
|
|
214
|
-
var encodeLocal = function (count, type) { return __spreadArray(__spreadArray([], __read(exports.unsignedLEB128(count))), [
|
|
215
|
-
type
|
|
216
|
-
]); };
|
|
217
|
-
exports.encodeLocal = encodeLocal;
|
|
218
|
-
// https://webassembly.github.io/spec/core/binary/modules.html#sections
|
|
219
|
-
// sections are encoded by their type followed by their vector contents
|
|
220
|
-
var createSection = function (sectionType, data) { return __spreadArray([
|
|
221
|
-
sectionType
|
|
222
|
-
], __read(exports.encodeVector(data))); };
|
|
223
|
-
/*
|
|
224
|
-
Building a WASM program...
|
|
225
|
-
Based off of Chasm:
|
|
226
|
-
https://github.com/ColinEberhardt/chasm/blob/master/src/emitter.ts
|
|
227
|
-
https://webassembly.github.io/wabt/demo/wat2wasm/
|
|
228
|
-
*/
|
|
229
|
-
var emitter = function (functions) {
|
|
230
|
-
// Types section
|
|
231
|
-
var typesSection = createSection(ESectionType.type, __spreadArray([
|
|
232
|
-
functions.length
|
|
233
|
-
], __read(exports.flatten(functions.map(function (func) { return func.sectionTypes; })))));
|
|
234
|
-
// Functions section
|
|
235
|
-
var functionsSection = createSection(ESectionType.func, __spreadArray([
|
|
236
|
-
functions.length
|
|
237
|
-
], __read(functions.map(function (func, i) { return i; }))));
|
|
238
|
-
// Export section
|
|
239
|
-
var exportSection = createSection(ESectionType.export, exports.encodeVector(functions.map(function (func, i) { return __spreadArray(__spreadArray([], __read(func.sectionExport)), [i]); })));
|
|
240
|
-
var codeSection = createSection(ESectionType.code, __spreadArray([
|
|
241
|
-
functions.length
|
|
242
|
-
], __read(exports.flatten(functions.map(function (func) { return func.sectionCode; })))));
|
|
243
|
-
return Uint8Array.from(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(magicModuleHeader)), __read(moduleVersion)), __read(typesSection)), __read(functionsSection)), __read(exportSection)), __read(codeSection)));
|
|
244
|
-
};
|
|
245
|
-
exports.emitter = emitter;
|
|
246
|
-
var defaultMemory = new WebAssembly.Memory({ initial: 10, maximum: 100, shared: true });
|
|
247
|
-
function compile(functions, memory) {
|
|
248
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
249
|
-
var wasm;
|
|
250
|
-
return __generator(this, function (_a) {
|
|
251
|
-
switch (_a.label) {
|
|
252
|
-
case 0:
|
|
253
|
-
memory = memory || defaultMemory;
|
|
254
|
-
wasm = exports.emitter(functions);
|
|
255
|
-
return [4 /*yield*/, WebAssembly.instantiate(wasm, {
|
|
256
|
-
js: {
|
|
257
|
-
memory: memory
|
|
258
|
-
}
|
|
259
|
-
})];
|
|
260
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
exports.compile = compile;
|
|
266
|
-
function run(functions) {
|
|
267
|
-
var args = [];
|
|
268
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
269
|
-
args[_i - 1] = arguments[_i];
|
|
270
|
-
}
|
|
271
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
272
|
-
var memory, wasm;
|
|
273
|
-
var _a;
|
|
274
|
-
return __generator(this, function (_b) {
|
|
275
|
-
switch (_b.label) {
|
|
276
|
-
case 0:
|
|
277
|
-
memory = args[0] instanceof WebAssembly.Memory && args[0] || defaultMemory;
|
|
278
|
-
if (functions instanceof Function_1.FunctionSection)
|
|
279
|
-
functions = [functions];
|
|
280
|
-
return [4 /*yield*/, compile(functions, memory)];
|
|
281
|
-
case 1:
|
|
282
|
-
wasm = _b.sent();
|
|
283
|
-
return [2 /*return*/, 'main' in wasm.instance.exports ? (_a = wasm.instance.exports).main.apply(_a, __spreadArray([], __read(args))) : wasm];
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
exports.run = run;
|
|
289
|
-
if (VisionHelper_1.VisionHelper.window)
|
|
290
|
-
window['wasm'] = {
|
|
291
|
-
compile: compile
|
|
292
|
-
};
|
|
293
|
-
//# sourceMappingURL=WASM.js.map
|
package/dist/AST/WASM.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WASM.js","sourceRoot":"","sources":["../../src/AST/WASM.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAAqD;AACrD,4CAAgD;AAGhD,IAAM,SAAS,GAAG;IAAC,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,yBAAc;;IAAU,OAAA,IAAI;AAAJ,CAAI,CAAC;AAChD,IAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,IAAI,QAAQ,GAAG,SAAS,CAAC;AACzB,IAAI,aAAa,GAAG,SAAS,CAAC;AAC9B,IAAI,aAAa,GAAG,SAAS,CAAC;AAC9B,IAAI,eAAe,GAAG,SAAS,CAAC;AAGhC,QAAQ,GAAG,UAAC,CAAS;IACjB,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAClC,GAAG,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,aAAa,GAAG,UAAC,GAAW,IAAK;IAC7B,GAAG,CAAC,MAAM;UACP,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,UAAU,CAAC,CA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AE,CAAC,CAAC,IAAI,EAAC;;;;CAChG;AAPD,kBAOC;AAED,IAAI,2BAAY,CAAC,MAAM;IACnB,MAAM,CAAC,MAAM,CAAC,GAAG;QACb,OAAO,EAAE,OAAO;KACnB,CAAA"}
|
package/dist/AST/WithNode.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Scope } from "../Scope";
|
|
2
|
-
import { DOM } from "../DOM";
|
|
3
|
-
import { Tag } from "../Tag";
|
|
4
|
-
import { Token, TreeNode } from "../AST";
|
|
5
|
-
import { Node } from "./Node";
|
|
6
|
-
import { BlockNode } from "./BlockNode";
|
|
7
|
-
export declare class WithNode extends Node implements TreeNode {
|
|
8
|
-
readonly context: Node;
|
|
9
|
-
readonly statements: BlockNode;
|
|
10
|
-
protected requiresPrep: boolean;
|
|
11
|
-
constructor(context: Node, statements: BlockNode);
|
|
12
|
-
protected _getChildNodes(): Node[];
|
|
13
|
-
protected _evaluate(scope: Scope, dom: DOM, tag?: Tag): Promise<any>;
|
|
14
|
-
static parse(lastNode: any, token: any, tokens: Token[]): WithNode;
|
|
15
|
-
}
|
package/dist/AST/WithNode.js
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __values = (this && this.__values) || function(o) {
|
|
54
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
55
|
-
if (m) return m.call(o);
|
|
56
|
-
if (o && typeof o.length === "number") return {
|
|
57
|
-
next: function () {
|
|
58
|
-
if (o && i >= o.length) o = void 0;
|
|
59
|
-
return { value: o && o[i++], done: !o };
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
63
|
-
};
|
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.WithNode = void 0;
|
|
66
|
-
var Scope_1 = require("../Scope");
|
|
67
|
-
var Tag_1 = require("../Tag");
|
|
68
|
-
var AST_1 = require("../AST");
|
|
69
|
-
var Node_1 = require("./Node");
|
|
70
|
-
var TagList_1 = require("../Tag/TagList");
|
|
71
|
-
var WithNode = /** @class */ (function (_super) {
|
|
72
|
-
__extends(WithNode, _super);
|
|
73
|
-
function WithNode(context, statements) {
|
|
74
|
-
var _this = _super.call(this) || this;
|
|
75
|
-
_this.context = context;
|
|
76
|
-
_this.statements = statements;
|
|
77
|
-
_this.requiresPrep = true;
|
|
78
|
-
return _this;
|
|
79
|
-
}
|
|
80
|
-
WithNode.prototype._getChildNodes = function () {
|
|
81
|
-
return [
|
|
82
|
-
this.context,
|
|
83
|
-
this.statements
|
|
84
|
-
];
|
|
85
|
-
};
|
|
86
|
-
WithNode.prototype._evaluate = function (scope, dom, tag) {
|
|
87
|
-
if (tag === void 0) { tag = null; }
|
|
88
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
var context, tags, ret, tags_1, tags_1_1, _tag, _a, _b, e_1_1, promises, tags_2, tags_2_1, _tag, e_2_1, _scope, _c, _d;
|
|
90
|
-
var e_1, _e, e_2, _f;
|
|
91
|
-
return __generator(this, function (_g) {
|
|
92
|
-
switch (_g.label) {
|
|
93
|
-
case 0: return [4 /*yield*/, this.context.evaluate(scope, dom, tag)];
|
|
94
|
-
case 1:
|
|
95
|
-
context = _g.sent();
|
|
96
|
-
tags = [];
|
|
97
|
-
if (context instanceof TagList_1.TagList) {
|
|
98
|
-
tags = context;
|
|
99
|
-
}
|
|
100
|
-
else if (context instanceof Tag_1.Tag) {
|
|
101
|
-
tags = [context];
|
|
102
|
-
}
|
|
103
|
-
ret = [];
|
|
104
|
-
if (!tags.length) return [3 /*break*/, 22];
|
|
105
|
-
if (!this.hasModifier('sequential')) return [3 /*break*/, 11];
|
|
106
|
-
_g.label = 2;
|
|
107
|
-
case 2:
|
|
108
|
-
_g.trys.push([2, 8, 9, 10]);
|
|
109
|
-
tags_1 = __values(tags), tags_1_1 = tags_1.next();
|
|
110
|
-
_g.label = 3;
|
|
111
|
-
case 3:
|
|
112
|
-
if (!!tags_1_1.done) return [3 /*break*/, 7];
|
|
113
|
-
_tag = tags_1_1.value;
|
|
114
|
-
return [4 /*yield*/, this.statements.prepare(_tag.scope, dom, _tag)];
|
|
115
|
-
case 4:
|
|
116
|
-
_g.sent();
|
|
117
|
-
_b = (_a = ret).push;
|
|
118
|
-
return [4 /*yield*/, this.statements.evaluate(_tag.scope, dom, _tag)];
|
|
119
|
-
case 5:
|
|
120
|
-
_b.apply(_a, [_g.sent()]);
|
|
121
|
-
_g.label = 6;
|
|
122
|
-
case 6:
|
|
123
|
-
tags_1_1 = tags_1.next();
|
|
124
|
-
return [3 /*break*/, 3];
|
|
125
|
-
case 7: return [3 /*break*/, 10];
|
|
126
|
-
case 8:
|
|
127
|
-
e_1_1 = _g.sent();
|
|
128
|
-
e_1 = { error: e_1_1 };
|
|
129
|
-
return [3 /*break*/, 10];
|
|
130
|
-
case 9:
|
|
131
|
-
try {
|
|
132
|
-
if (tags_1_1 && !tags_1_1.done && (_e = tags_1.return)) _e.call(tags_1);
|
|
133
|
-
}
|
|
134
|
-
finally { if (e_1) throw e_1.error; }
|
|
135
|
-
return [7 /*endfinally*/];
|
|
136
|
-
case 10: return [3 /*break*/, 21];
|
|
137
|
-
case 11:
|
|
138
|
-
promises = [];
|
|
139
|
-
_g.label = 12;
|
|
140
|
-
case 12:
|
|
141
|
-
_g.trys.push([12, 17, 18, 19]);
|
|
142
|
-
tags_2 = __values(tags), tags_2_1 = tags_2.next();
|
|
143
|
-
_g.label = 13;
|
|
144
|
-
case 13:
|
|
145
|
-
if (!!tags_2_1.done) return [3 /*break*/, 16];
|
|
146
|
-
_tag = tags_2_1.value;
|
|
147
|
-
return [4 /*yield*/, this.statements.prepare(_tag.scope, dom, _tag)];
|
|
148
|
-
case 14:
|
|
149
|
-
_g.sent();
|
|
150
|
-
promises.push(this.statements.evaluate(_tag.scope, dom, _tag));
|
|
151
|
-
_g.label = 15;
|
|
152
|
-
case 15:
|
|
153
|
-
tags_2_1 = tags_2.next();
|
|
154
|
-
return [3 /*break*/, 13];
|
|
155
|
-
case 16: return [3 /*break*/, 19];
|
|
156
|
-
case 17:
|
|
157
|
-
e_2_1 = _g.sent();
|
|
158
|
-
e_2 = { error: e_2_1 };
|
|
159
|
-
return [3 /*break*/, 19];
|
|
160
|
-
case 18:
|
|
161
|
-
try {
|
|
162
|
-
if (tags_2_1 && !tags_2_1.done && (_f = tags_2.return)) _f.call(tags_2);
|
|
163
|
-
}
|
|
164
|
-
finally { if (e_2) throw e_2.error; }
|
|
165
|
-
return [7 /*endfinally*/];
|
|
166
|
-
case 19: return [4 /*yield*/, Promise.all(promises)];
|
|
167
|
-
case 20:
|
|
168
|
-
ret = _g.sent();
|
|
169
|
-
_g.label = 21;
|
|
170
|
-
case 21: return [3 /*break*/, 24];
|
|
171
|
-
case 22:
|
|
172
|
-
_scope = void 0;
|
|
173
|
-
if (context instanceof Scope_1.Scope) {
|
|
174
|
-
_scope = context;
|
|
175
|
-
}
|
|
176
|
-
if (!_scope) return [3 /*break*/, 24];
|
|
177
|
-
_d = (_c = ret).push;
|
|
178
|
-
return [4 /*yield*/, this.statements.evaluate(_scope, dom, tag)];
|
|
179
|
-
case 23:
|
|
180
|
-
_d.apply(_c, [_g.sent()]);
|
|
181
|
-
_g.label = 24;
|
|
182
|
-
case 24: return [2 /*return*/, ret.length === 1 ? ret[0] : ret];
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
WithNode.parse = function (lastNode, token, tokens) {
|
|
188
|
-
tokens.shift(); // Consume with
|
|
189
|
-
var contextTokens = AST_1.Tree.getTokensUntil(tokens, AST_1.TokenType.L_BRACE, false, false, true);
|
|
190
|
-
var statementTokens = AST_1.Tree.getNextStatementTokens(tokens);
|
|
191
|
-
this.moveModifiers(contextTokens, tokens);
|
|
192
|
-
return new WithNode(AST_1.Tree.processTokens(contextTokens), AST_1.Tree.processTokens(statementTokens));
|
|
193
|
-
};
|
|
194
|
-
return WithNode;
|
|
195
|
-
}(Node_1.Node));
|
|
196
|
-
exports.WithNode = WithNode;
|
|
197
|
-
//# sourceMappingURL=WithNode.js.map
|
package/dist/AST/WithNode.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WithNode.js","sourceRoot":"","sources":["../../src/AST/WithNode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAAG,UAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC1C,OAAO,IAAI,QAAQ,CAAC,UAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,UAAI,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;IAChG,CAAC;IACL,eAAC;AAAD,CAAC,AA3DD,CAA8B,WAAI,GA2DjC;AA3DY,4BAAQ"}
|
package/dist/AST/XHRNode.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Node } from "./Node";
|
|
2
|
-
import { Token, TokenType, TreeNode } from "../AST";
|
|
3
|
-
import { Scope } from "../Scope";
|
|
4
|
-
import { DOM } from "../DOM";
|
|
5
|
-
import { Tag } from "../Tag";
|
|
6
|
-
export declare class XHRNode extends Node implements TreeNode {
|
|
7
|
-
readonly left: Node | null;
|
|
8
|
-
readonly requestType: TokenType;
|
|
9
|
-
readonly url: Node;
|
|
10
|
-
constructor(left: Node | null, requestType: TokenType, url: Node);
|
|
11
|
-
getChildNodes(): Node[];
|
|
12
|
-
protected _evaluate(scope: Scope, dom: DOM, tag?: Tag): Promise<any>;
|
|
13
|
-
static parse(node: Node, token: Token, tokens: Token[]): XHRNode;
|
|
14
|
-
static match(tokens: Token[]): boolean;
|
|
15
|
-
}
|