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.
- package/README.md +12 -30
- package/dist/index.cjs.js +566 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.es.js +557 -0
- package/dist/rolldown-runtime-BW-eSwOZ.cjs +42 -0
- package/dist/stillflow/abstracts/meta.d.ts +1 -1
- package/dist/stillflow/abstracts/view.d.ts +2 -2
- package/dist/stillflow/compiler/compile.d.ts +5 -5
- package/dist/stillflow/compiler/instantiate.d.ts +2 -2
- package/dist/stillflow/index.d.ts +2 -2
- package/dist/stillflow/kernel/buffer.d.ts +1 -1
- package/dist/stillflow/kernel/kernel.d.ts +2 -2
- package/dist/stillflow/operators.d.ts +1 -1
- package/dist/stillflow/state.d.ts +1 -1
- package/dist/stillflow/stillflow.d.ts +6 -6
- package/dist/stillflow/variable.d.ts +2 -2
- package/dist/stillflow-collection/fenwick.d.ts +1 -1
- package/dist/stillflow-collection/flushable.d.ts +2 -2
- package/dist/stillflow-collection/index.d.ts +3 -3
- package/dist/stillflow-collection/utilities/range-fenwick-tree.d.ts +1 -1
- package/dist/stillflow-vite/babel-vm/abstract/binding.d.ts +4 -0
- package/dist/stillflow-vite/babel-vm/abstract/configurator.d.ts +7 -0
- package/dist/stillflow-vite/babel-vm/abstract/generator.d.ts +2 -0
- package/dist/stillflow-vite/babel-vm/classes/payload.d.ts +23 -0
- package/dist/stillflow-vite/babel-vm/index.d.ts +7 -0
- package/dist/stillflow-vite/babel-vm/utilities/build.d.ts +6 -0
- package/dist/stillflow-vite/babel-vm/utilities/create.d.ts +11 -0
- package/dist/stillflow-vite/dom/build-vm/build.d.ts +4 -0
- package/dist/stillflow-vite/dom/build-vm/build.dom.d.ts +6 -0
- package/dist/stillflow-vite/dom/build-vm/compile.d.ts +8 -0
- package/dist/stillflow-vite/dom/build-vm/markup.d.ts +7 -0
- package/dist/stillflow-vite/dom/build-vm/run.d.ts +12 -0
- package/dist/stillflow-vite/dom/build-vm/template.d.ts +14 -0
- package/dist/stillflow-vite/dom/build-vm/transform.d.ts +10 -0
- package/dist/{stillflow-adapters/dom/vm/dom.codes.d.ts → stillflow-vite/dom/directives/codes.d.ts} +1 -2
- package/dist/stillflow-vite/dom/directives/generators.d.ts +3 -0
- package/dist/stillflow-vite/dom/environment.d.ts +21 -0
- package/dist/stillflow-vite/dom/helpers/collectors.d.ts +9 -0
- package/dist/stillflow-vite/dom/helpers/extractors.d.ts +11 -0
- package/dist/stillflow-vite/dom/helpers/getters.d.ts +7 -0
- package/dist/stillflow-vite/dom/helpers/replacers.d.ts +2 -0
- package/dist/stillflow-vite/dom/properties/directives.d.ts +16 -0
- package/dist/{stillflow-adapters → stillflow-vite}/dom/properties/properties.d.ts +4 -3
- package/dist/{stillflow-adapters/dom/vm/dom.types.d.ts → stillflow-vite/dom/properties/types.d.ts} +2 -2
- package/dist/{stillflow-adapters/dom/vm/utilities/dom.delegator.d.ts → stillflow-vite/dom/utilities/delegator.d.ts} +1 -0
- package/dist/stillflow-vite/dom.plugin.d.ts +2 -0
- package/dist/{stillflow-adapters/dom → stillflow-vite/runtime}/jsx.dom.d.ts +20 -14
- package/dist/vite.cjs.js +18348 -0
- package/dist/vite.es.js +18345 -0
- package/dist/vite.plugin.d.ts +2 -0
- package/package.json +41 -29
- package/dist/index.js +0 -6
- package/dist/jsx-runtime.d.ts +0 -3
- package/dist/jsx-runtime.js +0 -7
- package/dist/stillflow/abstracts/IR.js +0 -1
- package/dist/stillflow/abstracts/meta.js +0 -1
- package/dist/stillflow/abstracts/operators.js +0 -1
- package/dist/stillflow/abstracts/state.js +0 -1
- package/dist/stillflow/abstracts/view.js +0 -1
- package/dist/stillflow/compiler/compile.js +0 -84
- package/dist/stillflow/compiler/instantiate.js +0 -40
- package/dist/stillflow/factories/factories.js +0 -20
- package/dist/stillflow/index.js +0 -3
- package/dist/stillflow/kernel/buffer.js +0 -16
- package/dist/stillflow/kernel/kernel.js +0 -44
- package/dist/stillflow/kernel/signal.js +0 -12
- package/dist/stillflow/operators.js +0 -31
- package/dist/stillflow/state.js +0 -12
- package/dist/stillflow/stillflow.js +0 -59
- package/dist/stillflow/tools/batcher.js +0 -21
- package/dist/stillflow/variable.js +0 -24
- package/dist/stillflow-adapters/dom/base.dom.d.ts +0 -17
- package/dist/stillflow-adapters/dom/base.dom.js +0 -31
- package/dist/stillflow-adapters/dom/description/describe.d.ts +0 -3
- package/dist/stillflow-adapters/dom/description/describe.js +0 -6
- package/dist/stillflow-adapters/dom/jsx.dom.js +0 -98
- package/dist/stillflow-adapters/dom/properties/properties.js +0 -1
- package/dist/stillflow-adapters/dom/tags.d.ts +0 -7
- package/dist/stillflow-adapters/dom/tags.js +0 -5
- package/dist/stillflow-adapters/dom/vm/compile/dom.apply.d.ts +0 -3
- package/dist/stillflow-adapters/dom/vm/compile/dom.apply.js +0 -10
- package/dist/stillflow-adapters/dom/vm/compile/dom.apply.keyed.d.ts +0 -3
- package/dist/stillflow-adapters/dom/vm/compile/dom.apply.keyed.js +0 -10
- package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.d.ts +0 -2
- package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.js +0 -204
- package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.keyed.d.ts +0 -2
- package/dist/stillflow-adapters/dom/vm/compile/dom.compile-vm.keyed.js +0 -167
- package/dist/stillflow-adapters/dom/vm/compile/dom.compile.d.ts +0 -3
- package/dist/stillflow-adapters/dom/vm/compile/dom.compile.js +0 -77
- package/dist/stillflow-adapters/dom/vm/compile/dom.context.d.ts +0 -13
- package/dist/stillflow-adapters/dom/vm/compile/dom.context.js +0 -1
- package/dist/stillflow-adapters/dom/vm/compile/dom.markup.d.ts +0 -3
- package/dist/stillflow-adapters/dom/vm/compile/dom.markup.js +0 -32
- package/dist/stillflow-adapters/dom/vm/dom.codes.js +0 -1
- package/dist/stillflow-adapters/dom/vm/dom.directives.d.ts +0 -18
- package/dist/stillflow-adapters/dom/vm/dom.directives.js +0 -1
- package/dist/stillflow-adapters/dom/vm/dom.symbols.js +0 -18
- package/dist/stillflow-adapters/dom/vm/dom.template.d.ts +0 -10
- package/dist/stillflow-adapters/dom/vm/dom.template.js +0 -1
- package/dist/stillflow-adapters/dom/vm/dom.types.js +0 -1
- package/dist/stillflow-adapters/dom/vm/transform/dom.transform.d.ts +0 -3
- package/dist/stillflow-adapters/dom/vm/transform/dom.transform.js +0 -54
- package/dist/stillflow-adapters/dom/vm/utilities/dom.delegator.js +0 -39
- package/dist/stillflow-adapters/dom/vm/utilities/dom.pool.js +0 -46
- package/dist/stillflow-adapters/index.d.ts +0 -2
- package/dist/stillflow-adapters/index.js +0 -2
- package/dist/stillflow-collection/abstract/collection.js +0 -1
- package/dist/stillflow-collection/delta.js +0 -18
- package/dist/stillflow-collection/fenwick.js +0 -102
- package/dist/stillflow-collection/flushable.js +0 -70
- package/dist/stillflow-collection/index.js +0 -2
- package/dist/stillflow-collection/utilities/disjointed-set.js +0 -45
- package/dist/stillflow-collection/utilities/fenwick-tree.js +0 -27
- package/dist/stillflow-collection/utilities/interval-merger.js +0 -70
- package/dist/stillflow-collection/utilities/range-fenwick-tree.js +0 -28
- package/dist/stillflow-examples/app.js +0 -123
- package/dist/stillflow-examples/data.js +0 -73
- package/dist/stillflow-examples/test.js +0 -32
- package/dist/stillflow-scripts/gen-tags.d.ts +0 -1
- package/dist/stillflow-scripts/gen-tags.js +0 -50
- package/dist/stillflow-vm/abstract/config.d.ts +0 -6
- package/dist/stillflow-vm/abstract/config.js +0 -1
- package/dist/stillflow-vm/abstract/generator.d.ts +0 -1
- package/dist/stillflow-vm/abstract/generator.js +0 -1
- package/dist/stillflow-vm/abstract/target.d.ts +0 -7
- package/dist/stillflow-vm/abstract/target.js +0 -1
- package/dist/stillflow-vm/binding.d.ts +0 -4
- package/dist/stillflow-vm/binding.js +0 -1
- package/dist/stillflow-vm/create.d.ts +0 -5
- package/dist/stillflow-vm/create.js +0 -17
- package/dist/stillflow-vm/emitter.js +0 -9
- package/dist/stillflow-vm/index.d.ts +0 -6
- package/dist/stillflow-vm/index.js +0 -3
- package/dist/stillflow-vm/payload.d.ts +0 -9
- package/dist/stillflow-vm/payload.js +0 -24
- /package/dist/{stillflow-vm → stillflow-vite/babel-vm/classes}/emitter.d.ts +0 -0
- /package/dist/{stillflow-adapters/dom/vm/utilities/dom.pool.d.ts → stillflow-vite/dom/utilities/pool.d.ts} +0 -0
- /package/dist/{stillflow-adapters/dom/vm/dom.symbols.d.ts → stillflow-vite/dom/utilities/symbols.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractCollection } from
|
|
2
|
-
import { Delta } from
|
|
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
|
|
2
|
-
export { FenwickCollection as Fenwick } from
|
|
3
|
-
export { AbstractCollection as Abstract } from './abstract/collection
|
|
1
|
+
export { FlushableCollection as Flushable } from './flushable';
|
|
2
|
+
export { FenwickCollection as Fenwick } from './fenwick';
|
|
3
|
+
export type { AbstractCollection as Abstract } from './abstract/collection';
|
|
@@ -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,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,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,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,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;
|
|
@@ -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,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 {
|
|
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:
|
|
5
|
+
text: types.Expression;
|
|
5
6
|
events: Partial<{
|
|
6
|
-
[L in keyof HTMLElementEventMap]:
|
|
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];
|
package/dist/{stillflow-adapters/dom/vm/dom.types.d.ts → stillflow-vite/dom/properties/types.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Binding } from
|
|
2
|
-
import { Properties } from
|
|
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>>;
|
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const
|
|
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],
|
|
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': () =>
|
|
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
|
|
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
|
|
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> =
|
|
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
|
|
33
|
+
[K in keyof HTMLElementTagNameMap]: <V>(properties: Partial<JSXElementProperties<V, K>>) => any;
|
|
33
34
|
};
|
|
34
|
-
export
|
|
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 {};
|