stillflow.engine 0.4.8 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +12 -30
  2. package/dist/index.cjs.js +566 -0
  3. package/dist/index.d.ts +4 -5
  4. package/dist/index.es.js +557 -0
  5. package/dist/rolldown-runtime-BW-eSwOZ.cjs +42 -0
  6. package/dist/stillflow/abstracts/meta.d.ts +1 -1
  7. package/dist/stillflow/abstracts/view.d.ts +2 -2
  8. package/dist/stillflow/compiler/compile.d.ts +5 -5
  9. package/dist/stillflow/compiler/instantiate.d.ts +2 -2
  10. package/dist/stillflow/index.d.ts +2 -2
  11. package/dist/stillflow/kernel/buffer.d.ts +1 -1
  12. package/dist/stillflow/kernel/kernel.d.ts +2 -2
  13. package/dist/stillflow/operators.d.ts +1 -1
  14. package/dist/stillflow/state.d.ts +1 -1
  15. package/dist/stillflow/stillflow.d.ts +6 -6
  16. package/dist/stillflow/variable.d.ts +2 -2
  17. package/dist/stillflow-collection/fenwick.d.ts +1 -1
  18. package/dist/stillflow-collection/flushable.d.ts +2 -2
  19. package/dist/stillflow-collection/index.d.ts +3 -3
  20. package/dist/stillflow-collection/utilities/range-fenwick-tree.d.ts +1 -1
  21. package/dist/stillflow-vite/babel-vm/abstract/binding.d.ts +4 -0
  22. package/dist/stillflow-vite/babel-vm/abstract/configurator.d.ts +7 -0
  23. package/dist/stillflow-vite/babel-vm/abstract/generator.d.ts +2 -0
  24. package/dist/stillflow-vite/babel-vm/classes/payload.d.ts +23 -0
  25. package/dist/stillflow-vite/babel-vm/index.d.ts +7 -0
  26. package/dist/stillflow-vite/babel-vm/utilities/build.d.ts +6 -0
  27. package/dist/stillflow-vite/babel-vm/utilities/create.d.ts +11 -0
  28. package/dist/stillflow-vite/dom/build-vm/build.d.ts +4 -0
  29. package/dist/stillflow-vite/dom/build-vm/build.dom.d.ts +6 -0
  30. package/dist/stillflow-vite/dom/build-vm/compile.d.ts +8 -0
  31. package/dist/stillflow-vite/dom/build-vm/markup.d.ts +7 -0
  32. package/dist/stillflow-vite/dom/build-vm/run.d.ts +12 -0
  33. package/dist/stillflow-vite/dom/build-vm/template.d.ts +14 -0
  34. package/dist/stillflow-vite/dom/build-vm/transform.d.ts +10 -0
  35. package/dist/{stillflow-adapters/dom/vm/dom.codes.d.ts → stillflow-vite/dom/directives/codes.d.ts} +1 -2
  36. package/dist/stillflow-vite/dom/directives/generators.d.ts +3 -0
  37. package/dist/stillflow-vite/dom/environment.d.ts +21 -0
  38. package/dist/stillflow-vite/dom/helpers/collectors.d.ts +9 -0
  39. package/dist/stillflow-vite/dom/helpers/extractors.d.ts +11 -0
  40. package/dist/stillflow-vite/dom/helpers/getters.d.ts +7 -0
  41. package/dist/stillflow-vite/dom/helpers/replacers.d.ts +2 -0
  42. package/dist/stillflow-vite/dom/properties/directives.d.ts +16 -0
  43. package/dist/{stillflow-adapters → stillflow-vite}/dom/properties/properties.d.ts +4 -3
  44. package/dist/{stillflow-adapters/dom/vm/dom.types.d.ts → stillflow-vite/dom/properties/types.d.ts} +2 -2
  45. package/dist/{stillflow-adapters/dom/vm/utilities/dom.delegator.d.ts → stillflow-vite/dom/utilities/delegator.d.ts} +1 -0
  46. package/dist/stillflow-vite/dom.plugin.d.ts +2 -0
  47. package/dist/{stillflow-adapters/dom → stillflow-vite/runtime}/jsx.dom.d.ts +20 -14
  48. package/dist/vite.cjs.js +18348 -0
  49. package/dist/vite.es.js +18345 -0
  50. package/dist/vite.plugin.d.ts +2 -0
  51. package/package.json +41 -29
  52. package/dist/index.js +0 -6
  53. package/dist/jsx-runtime.d.ts +0 -3
  54. package/dist/jsx-runtime.js +0 -7
  55. package/dist/stillflow/abstracts/IR.js +0 -1
  56. package/dist/stillflow/abstracts/meta.js +0 -1
  57. package/dist/stillflow/abstracts/operators.js +0 -1
  58. package/dist/stillflow/abstracts/state.js +0 -1
  59. package/dist/stillflow/abstracts/view.js +0 -1
  60. package/dist/stillflow/compiler/compile.js +0 -84
  61. package/dist/stillflow/compiler/instantiate.js +0 -40
  62. package/dist/stillflow/factories/factories.js +0 -20
  63. package/dist/stillflow/index.js +0 -3
  64. package/dist/stillflow/kernel/buffer.js +0 -16
  65. package/dist/stillflow/kernel/kernel.js +0 -44
  66. package/dist/stillflow/kernel/signal.js +0 -12
  67. package/dist/stillflow/operators.js +0 -31
  68. package/dist/stillflow/state.js +0 -12
  69. package/dist/stillflow/stillflow.js +0 -59
  70. package/dist/stillflow/tools/batcher.js +0 -21
  71. package/dist/stillflow/variable.js +0 -24
  72. package/dist/stillflow-adapters/dom/base.dom.d.ts +0 -17
  73. package/dist/stillflow-adapters/dom/base.dom.js +0 -31
  74. package/dist/stillflow-adapters/dom/description/describe.d.ts +0 -3
  75. package/dist/stillflow-adapters/dom/description/describe.js +0 -6
  76. package/dist/stillflow-adapters/dom/jsx.dom.js +0 -98
  77. package/dist/stillflow-adapters/dom/properties/properties.js +0 -1
  78. package/dist/stillflow-adapters/dom/tags.d.ts +0 -7
  79. package/dist/stillflow-adapters/dom/tags.js +0 -5
  80. package/dist/stillflow-adapters/dom/vm/compile/dom.apply.d.ts +0 -3
  81. package/dist/stillflow-adapters/dom/vm/compile/dom.apply.js +0 -10
  82. package/dist/stillflow-adapters/dom/vm/compile/dom.apply.keyed.d.ts +0 -3
  83. package/dist/stillflow-adapters/dom/vm/compile/dom.apply.keyed.js +0 -10
  84. package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.d.ts +0 -2
  85. package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.js +0 -204
  86. package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.keyed.d.ts +0 -2
  87. package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.keyed.js +0 -167
  88. package/dist/stillflow-adapters/dom/vm/compile/dom.compile.d.ts +0 -3
  89. package/dist/stillflow-adapters/dom/vm/compile/dom.compile.js +0 -77
  90. package/dist/stillflow-adapters/dom/vm/compile/dom.context.d.ts +0 -13
  91. package/dist/stillflow-adapters/dom/vm/compile/dom.context.js +0 -1
  92. package/dist/stillflow-adapters/dom/vm/compile/dom.markup.d.ts +0 -3
  93. package/dist/stillflow-adapters/dom/vm/compile/dom.markup.js +0 -32
  94. package/dist/stillflow-adapters/dom/vm/dom.codes.js +0 -1
  95. package/dist/stillflow-adapters/dom/vm/dom.directives.d.ts +0 -18
  96. package/dist/stillflow-adapters/dom/vm/dom.directives.js +0 -1
  97. package/dist/stillflow-adapters/dom/vm/dom.symbols.js +0 -18
  98. package/dist/stillflow-adapters/dom/vm/dom.template.d.ts +0 -10
  99. package/dist/stillflow-adapters/dom/vm/dom.template.js +0 -1
  100. package/dist/stillflow-adapters/dom/vm/dom.types.js +0 -1
  101. package/dist/stillflow-adapters/dom/vm/transform/dom.transform.d.ts +0 -3
  102. package/dist/stillflow-adapters/dom/vm/transform/dom.transform.js +0 -54
  103. package/dist/stillflow-adapters/dom/vm/utilities/dom.delegator.js +0 -39
  104. package/dist/stillflow-adapters/dom/vm/utilities/dom.pool.js +0 -46
  105. package/dist/stillflow-adapters/index.d.ts +0 -2
  106. package/dist/stillflow-adapters/index.js +0 -2
  107. package/dist/stillflow-collection/abstract/collection.js +0 -1
  108. package/dist/stillflow-collection/delta.js +0 -18
  109. package/dist/stillflow-collection/fenwick.js +0 -102
  110. package/dist/stillflow-collection/flushable.js +0 -70
  111. package/dist/stillflow-collection/index.js +0 -2
  112. package/dist/stillflow-collection/utilities/disjointed-set.js +0 -45
  113. package/dist/stillflow-collection/utilities/fenwick-tree.js +0 -27
  114. package/dist/stillflow-collection/utilities/interval-merger.js +0 -70
  115. package/dist/stillflow-collection/utilities/range-fenwick-tree.js +0 -28
  116. package/dist/stillflow-examples/app.js +0 -123
  117. package/dist/stillflow-examples/data.js +0 -73
  118. package/dist/stillflow-examples/test.js +0 -32
  119. package/dist/stillflow-scripts/gen-tags.d.ts +0 -1
  120. package/dist/stillflow-scripts/gen-tags.js +0 -50
  121. package/dist/stillflow-vm/abstract/config.d.ts +0 -6
  122. package/dist/stillflow-vm/abstract/config.js +0 -1
  123. package/dist/stillflow-vm/abstract/generator.d.ts +0 -1
  124. package/dist/stillflow-vm/abstract/generator.js +0 -1
  125. package/dist/stillflow-vm/abstract/target.d.ts +0 -7
  126. package/dist/stillflow-vm/abstract/target.js +0 -1
  127. package/dist/stillflow-vm/binding.d.ts +0 -4
  128. package/dist/stillflow-vm/binding.js +0 -1
  129. package/dist/stillflow-vm/create.d.ts +0 -5
  130. package/dist/stillflow-vm/create.js +0 -17
  131. package/dist/stillflow-vm/emitter.js +0 -9
  132. package/dist/stillflow-vm/index.d.ts +0 -6
  133. package/dist/stillflow-vm/index.js +0 -3
  134. package/dist/stillflow-vm/payload.d.ts +0 -9
  135. package/dist/stillflow-vm/payload.js +0 -24
  136. /package/dist/{stillflow-vm → stillflow-vite/babel-vm/classes}/emitter.d.ts +0 -0
  137. /package/dist/{stillflow-adapters/dom/vm/utilities/dom.pool.d.ts → stillflow-vite/dom/utilities/pool.d.ts} +0 -0
  138. /package/dist/{stillflow-adapters/dom/vm/dom.symbols.d.ts → stillflow-vite/dom/utilities/symbols.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { AbstractCollection } from "./abstract/collection.js";
1
+ import { AbstractCollection } from './abstract/collection.js';
2
2
  export declare class FenwickCollection<T> implements AbstractCollection<T> {
3
3
  private _size;
4
4
  private static GROW;
@@ -1,5 +1,5 @@
1
- import { AbstractCollection } from "./abstract/collection.js";
2
- import { Delta } from "./delta.js";
1
+ import { AbstractCollection } from './abstract/collection.js';
2
+ import { Delta } from './delta.js';
3
3
  export declare class FlushableCollection<T> implements AbstractCollection<T> {
4
4
  private _base;
5
5
  private _delta;
@@ -1,3 +1,3 @@
1
- export { FlushableCollection as Flushable } from "./flushable.js";
2
- export { FenwickCollection as Fenwick } from "./fenwick.js";
3
- export { AbstractCollection as Abstract } from './abstract/collection.js';
1
+ export { FlushableCollection as Flushable } from './flushable';
2
+ export { FenwickCollection as Fenwick } from './fenwick';
3
+ export type { AbstractCollection as Abstract } from './abstract/collection';
@@ -1,4 +1,4 @@
1
- import { Fenwick } from "./fenwick-tree.js";
1
+ import { Fenwick } from './fenwick-tree.js';
2
2
  export declare class RangeFenwick {
3
3
  private _start;
4
4
  private _end;
@@ -0,0 +1,4 @@
1
+ export type VMBinding<P> = {
2
+ children: VMBinding<P>[];
3
+ properties: P;
4
+ };
@@ -0,0 +1,7 @@
1
+ import { types } from '@babel/core';
2
+ import { VMGenerator } from './generator.js';
3
+ export type VMConfigurator<Context> = {
4
+ generators: Record<number, VMGenerator<Context>>;
5
+ preamble: (context: Context) => types.Statement[];
6
+ epilogue: (context: Context) => types.Statement[];
7
+ };
@@ -0,0 +1,2 @@
1
+ import { types } from '@babel/core';
2
+ export type VMGenerator<Context> = (bytecode: ArrayLike<number>, offset: number, context: Context) => types.Statement[];
@@ -0,0 +1,23 @@
1
+ import { types } from '@babel/core';
2
+ export type PayloadResolver<V> = (value: V) => types.Node;
3
+ export type PayloadTag<V> = {
4
+ index: number;
5
+ payload: string;
6
+ resolver: PayloadResolver<V>;
7
+ };
8
+ export declare class Payload {
9
+ static RESOLVE_STRING: PayloadResolver<string>;
10
+ static RESOLVE_NUMERIC: PayloadResolver<number>;
11
+ static RESOLVE_BOOLEAN: PayloadResolver<boolean>;
12
+ static RESOLVE_NODE: PayloadResolver<types.Node>;
13
+ private _map;
14
+ private _indices;
15
+ private _index;
16
+ private payload;
17
+ add<V>(value: V, resolver: PayloadResolver<V>): PayloadTag<V>;
18
+ tag<V>(value: V): PayloadTag<V>;
19
+ get<V>(index: number): V;
20
+ resolve<V>(value: V): types.Node;
21
+ get parameters(): string[];
22
+ get values(): any[];
23
+ }
@@ -0,0 +1,7 @@
1
+ export type { VMConfigurator as Configurator } from './abstract/configurator';
2
+ export type { VMGenerator as Generator } from './abstract/generator';
3
+ export type { VMBinding as Binding } from './abstract/binding';
4
+ export { Emitter } from './classes/emitter';
5
+ export { Payload } from './classes/payload';
6
+ export { create } from './utilities/create';
7
+ export { build } from './utilities/build';
@@ -0,0 +1,6 @@
1
+ import { Payload } from '..';
2
+ import { types } from '@babel/core';
3
+ export declare function build(vm: {
4
+ payload: Payload;
5
+ body: types.Statement[];
6
+ }): types.FunctionExpression;
@@ -0,0 +1,11 @@
1
+ import { Payload } from '..';
2
+ import { VMConfigurator } from '../abstract/configurator';
3
+ import { types } from '@babel/core';
4
+ export declare function create<Input extends {
5
+ bytecode: ArrayLike<number>;
6
+ }, Context extends {
7
+ payload: Payload;
8
+ }>(configurator: VMConfigurator<Context>): (input: Input, create_context: (payload: Payload, input: Input) => Context) => {
9
+ payload: Payload;
10
+ body: types.Statement[];
11
+ };
@@ -0,0 +1,4 @@
1
+ import { Template } from './template';
2
+ import { Environment } from '../environment';
3
+ import { types } from '@babel/core';
4
+ export declare function build_module_from(root: Template, environment: Environment): types.Program;
@@ -0,0 +1,6 @@
1
+ import { Binding } from '../../babel-vm';
2
+ import { Environment } from '../environment';
3
+ import { Properties } from '../properties/properties';
4
+ import { types } from '@babel/core';
5
+ export type BuildTimeDOMElement = Binding<Properties<any, any>>;
6
+ export declare function build_dom_from(node: types.JSXElement, state: Environment): BuildTimeDOMElement;
@@ -0,0 +1,8 @@
1
+ import { types } from '@babel/core';
2
+ import { BuildTimeDOMElement } from './build.dom';
3
+ import { Template } from './template';
4
+ import { Environment } from '../environment';
5
+ export declare function create_compiler(map: (each: types.Node) => BuildTimeDOMElement): {
6
+ bind: (supposed_environment: Environment) => void;
7
+ compile: (node: BuildTimeDOMElement) => Template;
8
+ };
@@ -0,0 +1,7 @@
1
+ import { BuildTimeDOMElement } from './build.dom';
2
+ import { types } from '@babel/core';
3
+ export interface MarkupResult {
4
+ parameters: types.Identifier[];
5
+ body: types.Statement[];
6
+ }
7
+ export declare function markup(node: BuildTimeDOMElement): MarkupResult;
@@ -0,0 +1,12 @@
1
+ import { types } from '@babel/core';
2
+ import { Template } from './template';
3
+ import { DELEGATOR } from '../utilities/delegator';
4
+ import * as vm from '../../babel-vm/index';
5
+ export type Context = Template & {
6
+ payload: vm.Payload;
7
+ delegator: typeof DELEGATOR;
8
+ };
9
+ export declare const run: (template: Template) => {
10
+ payload: vm.Payload;
11
+ body: types.Statement[];
12
+ };
@@ -0,0 +1,14 @@
1
+ import { TransformResult } from './transform';
2
+ import { BuildTimeDOMElement } from './build.dom';
3
+ import { Environment } from '../environment';
4
+ import * as vm from '../../babel-vm/index';
5
+ export interface Template {
6
+ root: TransformResult;
7
+ node: BuildTimeDOMElement;
8
+ nodes: vm.Payload;
9
+ bytecode: ArrayLike<number>;
10
+ strings: vm.Payload;
11
+ functions: vm.Payload;
12
+ templates: vm.Payload;
13
+ environment: Environment;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { types } from '@babel/core';
2
+ import { BuildTimeDOMElement } from './build.dom';
3
+ import * as vm from '../../babel-vm/index';
4
+ export interface TransformResult {
5
+ body: types.Statement[];
6
+ parameters: types.Identifier[];
7
+ payloads: vm.Payload;
8
+ return_expression: types.Expression;
9
+ }
10
+ export declare function transform(description: BuildTimeDOMElement): TransformResult;
@@ -1,7 +1,6 @@
1
1
  export declare const enum Codes {
2
2
  IF = 0,
3
- VM = 6,
4
- END = 1,
3
+ VM = 1,
5
4
  FOR = 2,
6
5
  TEXT = 3,
7
6
  EVENT = 4,
@@ -0,0 +1,3 @@
1
+ import { Statement } from '@babel/types';
2
+ import { Context } from '../build-vm/run';
3
+ export declare const generators: Record<number, (bytecode: ArrayLike<number>, offset: number, context: Context) => Statement[]>;
@@ -0,0 +1,21 @@
1
+ import { Template } from './build-vm/template';
2
+ import { TransformResult } from './build-vm/transform';
3
+ import { NodePath, PluginPass, Scope, types } from '@babel/core';
4
+ export interface ComponentInformation {
5
+ node: types.Node;
6
+ parameters: types.Identifier[];
7
+ body: types.JSXElement;
8
+ filename: string;
9
+ scope: Scope | null;
10
+ }
11
+ export interface ImportInformation {
12
+ source: string;
13
+ imported_name: string;
14
+ is_default: boolean;
15
+ }
16
+ export interface Environment extends PluginPass {
17
+ elements: NodePath<types.JSXElement>[];
18
+ components: Map<string, ComponentInformation>;
19
+ template_map: Map<Template, number>;
20
+ transform_map: Map<TransformResult, number>;
21
+ }
@@ -0,0 +1,9 @@
1
+ import { Template } from '../build-vm/template';
2
+ import { TransformResult } from '../build-vm/transform';
3
+ import { ComponentInformation, Environment, ImportInformation } from '../environment';
4
+ import { NodePath, PluginPass, types } from '@babel/core';
5
+ export declare function collect_template_map(root: Template): Map<Template, number>;
6
+ export declare function collect_transform_map(templates: Map<Template, number>): Map<TransformResult, number>;
7
+ export declare function collect_components_in(program_path: NodePath<types.Program>, state: PluginPass): Environment['components'];
8
+ export declare function collect_imports_in(program_path: NodePath<types.Program>): Map<string, ImportInformation>;
9
+ export declare function collect_component_in(ast: types.File, name: string, filename: string): ComponentInformation | null;
@@ -0,0 +1,11 @@
1
+ import { types } from '@babel/core';
2
+ export declare function extract_children(node: types.JSXElement): {
3
+ children: types.JSXElement[];
4
+ content: {
5
+ statics: types.Expression[];
6
+ dynamics: types.Expression[];
7
+ };
8
+ };
9
+ export declare function extract_attributes(opening: types.JSXElement['openingElement']): {
10
+ properties: Record<string, types.Node>;
11
+ };
@@ -0,0 +1,7 @@
1
+ import { types } from '@babel/core';
2
+ export declare function get_string_name(name: types.JSXIdentifier | types.JSXMemberExpression | types.JSXNamespacedName): string;
3
+ export declare function get_tag_name(node: types.JSXElement): string;
4
+ export declare function get_tag_name_without_jsxdom(node: types.JSXElement): string;
5
+ export declare function get_attribute_name(node: types.JSXAttribute): string;
6
+ export declare function get_return_argument(node: types.ArrowFunctionExpression | types.FunctionDeclaration | types.FunctionExpression): types.Node | null;
7
+ export declare function get_function_body(node: types.ArrowFunctionExpression | types.FunctionDeclaration | types.FunctionExpression): types.Statement[];
@@ -0,0 +1,2 @@
1
+ import { types } from '@babel/core';
2
+ export declare function replace_properties(body: types.JSXElement, properties: Record<string, types.Node>, name: string): types.JSXElement;
@@ -0,0 +1,16 @@
1
+ import { types } from '@babel/core';
2
+ export type Directives<V, K extends keyof HTMLElementTagNameMap = any> = Partial<{
3
+ vm: types.Node;
4
+ text: types.Node;
5
+ events: Partial<{
6
+ [L in keyof HTMLElementEventMap]: types.Node;
7
+ }>;
8
+ conditional: types.Node;
9
+ properties: Partial<{
10
+ [L in keyof HTMLElementTagNameMap[K]]: types.Node;
11
+ }>;
12
+ iterate: {
13
+ select: types.Node;
14
+ each: types.Node;
15
+ };
16
+ }>;
@@ -1,9 +1,10 @@
1
- import { Directives } from "../vm/dom.directives.js";
1
+ import { types } from '@babel/core';
2
+ import { Directives } from './directives';
2
3
  export type Properties<Context, Tag extends keyof HTMLElementTagNameMap> = Partial<{
3
4
  name: Tag;
4
- text: string;
5
+ text: types.Expression;
5
6
  events: Partial<{
6
- [L in keyof HTMLElementEventMap]: (event: HTMLElementEventMap[L], context: Context) => void;
7
+ [L in keyof HTMLElementEventMap]: types.Node;
7
8
  }>;
8
9
  properties: Partial<{
9
10
  [L in keyof Omit<HTMLElementTagNameMap[Tag], 'style'>]: HTMLElementTagNameMap[Tag][L];
@@ -1,4 +1,4 @@
1
- import { Binding } from "../../../stillflow-vm/binding.js";
2
- import { Properties } from "../properties/properties.js";
1
+ import { Binding } from '../../babel-vm/index';
2
+ import { Properties } from './properties';
3
3
  export type DOM<V, K extends keyof HTMLElementTagNameMap> = Binding<Properties<V, K>>;
4
4
  export type AnyDOM<V> = Binding<Properties<V, keyof HTMLElementTagNameMap>>;
@@ -4,3 +4,4 @@ export declare class EventDelegator {
4
4
  remove(root: HTMLElement): void;
5
5
  add(root: HTMLElement, type: string, listener: (event: Event, context: any) => void): void;
6
6
  }
7
+ export declare const DELEGATOR: EventDelegator;
@@ -0,0 +1,2 @@
1
+ import { PluginObject } from '@babel/core';
2
+ export default function StillflowDOM(): PluginObject<any>;
@@ -1,35 +1,41 @@
1
- import * as vm from '../../stillflow-vm/index.js';
2
- import { AnyDOM } from "./vm/dom.types.js";
3
- import * as collection from "../../stillflow-collection/index.js";
4
- declare const DYNAMIC_PROPERTY_PREFIX = "sf:";
5
- declare const DELEGATE_EVENT_PROPERTY_PREFIX = "sf:on-";
6
- declare const COMMON_EVENT_PROPERTY_PREFIX = "on:";
1
+ import * as collection from '../../stillflow-collection/index.js';
2
+ declare const DYNAMIC_PROPERTY_PREFIX: "sf:";
3
+ declare const DELEGATE_EVENT_PROPERTY_PREFIX: "sf:on-";
4
+ declare const COMMON_EVENT_PROPERTY_PREFIX: "on:";
7
5
  type ElementStyles<K extends keyof HTMLElementTagNameMap> = {
8
6
  styles: Partial<HTMLElementTagNameMap[K]['style']>;
9
7
  children: any;
10
8
  };
11
- type ElementPropertiesWithoutStyles<K extends keyof HTMLElementTagNameMap> = Omit<HTMLElementTagNameMap[K], 'style' | 'children'>;
9
+ type ElementPropertiesWithoutStyles<K extends keyof HTMLElementTagNameMap> = Omit<Omit<HTMLElementTagNameMap[K], keyof {
10
+ [K in keyof HTMLElementEventMap as `on${K}`]: any;
11
+ }>, 'style' | 'children'>;
12
12
  type ElementServicePropertiesWithoutPrefix<V> = {
13
- 'vm': (context: V) => (node: AnyDOM<V>) => vm.Target<HTMLElement, V>;
14
13
  'if': (context: V) => boolean;
15
14
  'for': (context: V) => collection.Flushable<unknown>;
16
- 'each': () => AnyDOM<V>;
15
+ 'each': () => any;
17
16
  };
18
17
  type ElementServicePropertiesWithPrefix<V> = {
19
18
  [K in keyof ElementServicePropertiesWithoutPrefix<V> as `${typeof DYNAMIC_PROPERTY_PREFIX}${K}`]: ElementServicePropertiesWithoutPrefix<V>[K];
20
19
  };
21
20
  type ElementDynamicPropertiesWithPrefix<V, K extends keyof HTMLElementTagNameMap> = {
22
- [L in (keyof HTMLElementTagNameMap[K]) & string as `${typeof DYNAMIC_PROPERTY_PREFIX}${L}`]: (context: V) => HTMLElementTagNameMap[K][L];
21
+ [L in keyof (Omit<HTMLElementTagNameMap[K], keyof {
22
+ [K in keyof HTMLElementEventMap as `on${K}`]: any;
23
+ }>) & string as `${typeof DYNAMIC_PROPERTY_PREFIX}${L}`]: (context: V) => HTMLElementTagNameMap[K][L];
23
24
  };
24
25
  type ElementDelegateEventsWithPrefix<V> = {
25
26
  [L in keyof HTMLElementEventMap as `${typeof DELEGATE_EVENT_PROPERTY_PREFIX}${L}`]: (event: HTMLElementEventMap[L], context: V) => void;
26
27
  };
27
- type ElementEventMap<V> = {
28
+ type ElementEventMapper<V> = {
28
29
  [K in keyof HTMLElementEventMap as `${typeof COMMON_EVENT_PROPERTY_PREFIX}${K}`]: (event: HTMLElementEventMap[K], context: V) => void;
29
30
  };
30
- type JSXElementProperties<V, K extends keyof HTMLElementTagNameMap> = ElementEventMap<V> & ElementStyles<K> & ElementPropertiesWithoutStyles<K> & ElementDynamicPropertiesWithPrefix<V, K> & ElementServicePropertiesWithPrefix<V> & ElementDelegateEventsWithPrefix<V>;
31
+ type JSXElementProperties<V, K extends keyof HTMLElementTagNameMap> = ElementEventMapper<V> & ElementStyles<K> & ElementPropertiesWithoutStyles<K> & ElementDynamicPropertiesWithPrefix<V, K> & ElementServicePropertiesWithPrefix<V> & ElementDelegateEventsWithPrefix<V>;
31
32
  export type JSXDOMRegistry = {
32
- [K in keyof HTMLElementTagNameMap]: <V>(properties: Partial<JSXElementProperties<V, K>>, all: any[]) => AnyDOM<V>;
33
+ [K in keyof HTMLElementTagNameMap]: <V>(properties: Partial<JSXElementProperties<V, K>>) => any;
33
34
  };
34
- export declare const JSXDOM_REGISTRY: JSXDOMRegistry;
35
+ export type EntryPoint<V> = (dom: any) => () => {
36
+ app: (root: HTMLElement, context: V) => void;
37
+ root: HTMLElement;
38
+ };
39
+ export declare const jsxdom: JSXDOMRegistry;
40
+ export declare const $: EntryPoint<any>;
35
41
  export {};