initial commit

This commit is contained in:
Matthew Phillips 2021-03-15 13:22:05 -04:00
commit af6b029e95
174 changed files with 30278 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules/
lib/

30
magicthing.mjs Normal file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env node
import { join as pathJoin, resolve as pathResolve } from 'path';
import generate from './lib/generate.js';
import devServer from './lib/dev.js';
const root = pathResolve(process.argv[2]);
if(!root) {
console.error('Must provide a project root');
process.exit(1);
}
const fileProtocolRoot = `file://${root}/`;
async function run() {
const magicConfig = (await import(pathJoin(root, 'magicthing.config.mjs'))).default;
magicConfig.projectRoot = new URL(magicConfig.projectRoot + '/', fileProtocolRoot);
magicConfig.hmxRoot = new URL(magicConfig.hmxRoot + '/', fileProtocolRoot);
// Should use an args parser eventually
if(process.argv.includes('--generate')) {
return generate(magicConfig);
} else {
return devServer(magicConfig);
}
}
run().catch(err => setTimeout(() => {throw err}));

2684
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

45
package.json Normal file
View file

@ -0,0 +1,45 @@
{
"name": "hmx-v2",
"version": "1.0.0",
"main": "index.js",
"author": "Fred K. Schott",
"license": "MIT",
"type": "module",
"exports": {
".": "./magicthing.mjs",
"./snowpack-plugin": "./snowpack-plugin.cjs",
"./h": "./lib/h.js",
"./render/preact": "./lib/render/preact.js"
},
"scripts": {
"build": "tsc && npm run copy-js",
"copy-js": "copyfiles -u 1 src/*.js lib/"
},
"dependencies": {
"@types/node": "^14.14.31",
"@vue/server-renderer": "^3.0.7",
"acorn": "^7.4.0",
"astring": "^1.7.0",
"cheerio": "^0.22.0",
"css-tree": "^1.1.2",
"domhandler": "^4.0.0",
"es-module-lexer": "^0.4.1",
"gray-matter": "^4.0.2",
"htmlparser2": "^6.0.0",
"magic-string": "^0.25.3",
"micromark": "^2.11.4",
"micromark-extension-gfm": "^0.3.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"snowpack": "^3.1.0-pre.12",
"svelte": "^3.35.0",
"vue": "^3.0.7"
},
"devDependencies": {
"copyfiles": "^2.4.1",
"estree-walker": "^3.0.0",
"preact": "^10.5.12",
"preact-render-to-string": "^5.1.14",
"typescript": "^4.2.3"
}
}

66
snowpack-plugin.cjs Normal file
View file

@ -0,0 +1,66 @@
const { readFile } = require("fs").promises;
// Snowpack plugins must be CommonJS :(
const transformPromise = import("./lib/transform2.js");
module.exports = function (snowpackConfig, { resolve } = {}) {
return {
name: "snowpack-hmx",
knownEntrypoints: ["deepmerge"],
resolve: {
input: [".hmx", ".md"],
output: [".js"],
},
async load({ filePath }) {
const { compilePage, compileComponent } = await transformPromise;
const contents = await readFile(filePath, "utf-8");
if (!filePath.includes("/pages/") && !filePath.includes("/layouts/")) {
const result = await compileComponent(contents, filePath, { resolve });
return result.contents;
}
const result = await compilePage(contents, filePath, { resolve });
try {
return /* js */ `
${result.contents}
export default async (childDatas, childRenderFns) => {
// Kind of hacky, can clean up if this works
const renderHmx = {setup, head, body};
const merge = (await import('deepmerge')).default;
const content = childDatas && childDatas[0].content;
const _data = await renderHmx.setup({content});
if (_data.layout) {
const renderLayout = (await import('/_hmx/layouts/' + _data.layout.replace(/.*layouts\\//, "").replace(/\.hmx$/, '.js'))).default;
return renderLayout(
[...(childDatas || []), _data],
[...(childRenderFns || []), renderHmx]
);
}
const data = merge.all([_data, ...(childDatas || [])]);
let headResult;
let bodyResult;
for (const renderFn of (childRenderFns || [])) {
let headAndBody = await Promise.all([
renderFn.head(data, headResult),
renderFn.body(data, bodyResult)
]);
headResult = headAndBody[0];
bodyResult = headAndBody[1];
}
return h(Fragment, null, [
renderHmx.head(data, headResult, true),
renderHmx.body(data, bodyResult, true),
]);
};
`;
} catch (err) {
console.error(err);
}
return result.contents;
},
};
};

22
src/@types/compiler/Stats.d.ts vendored Normal file
View file

@ -0,0 +1,22 @@
interface Timing {
label: string;
start: number;
end: number;
children: Timing[];
}
export default class Stats {
start_time: number;
current_timing: Timing;
current_children: Timing[];
timings: Timing[];
stack: Timing[];
constructor();
start(label: any): void;
stop(label: any): void;
render(): {
timings: {
total: number;
};
};
}
export {};

View file

@ -0,0 +1,130 @@
import Stats from '../Stats';
import { Scope } from './utils/scope';
import Stylesheet from './css/Stylesheet';
import Fragment from './nodes/Fragment';
import { Ast, CompileOptions, Var, Warning, CssResult } from '../interfaces';
import TemplateScope from './nodes/shared/TemplateScope';
import Slot from './nodes/Slot';
import { Node, ImportDeclaration, Identifier } from 'estree';
import Element from './nodes/Element';
interface ComponentOptions {
namespace?: string;
tag?: string;
immutable?: boolean;
accessors?: boolean;
preserveWhitespace?: boolean;
}
export default class Component {
stats: Stats;
warnings: Warning[];
ignores: Set<string>;
ignore_stack: Array<Set<string>>;
ast: Ast;
original_ast: Ast;
source: string;
name: Identifier;
compile_options: CompileOptions;
fragment: Fragment;
module_scope: Scope;
instance_scope: Scope;
instance_scope_map: WeakMap<Node, Scope>;
component_options: ComponentOptions;
namespace: string;
tag: string;
accessors: boolean;
vars: Var[];
var_lookup: Map<string, Var>;
imports: ImportDeclaration[];
hoistable_nodes: Set<Node>;
node_for_declaration: Map<string, Node>;
partly_hoisted: Array<(Node | Node[])>;
fully_hoisted: Array<(Node | Node[])>;
reactive_declarations: Array<{
assignees: Set<string>;
dependencies: Set<string>;
node: Node;
declaration: Node;
}>;
reactive_declaration_nodes: Set<Node>;
has_reactive_assignments: boolean;
injected_reactive_declaration_vars: Set<string>;
helpers: Map<string, Identifier>;
globals: Map<string, Identifier>;
indirect_dependencies: Map<string, Set<string>>;
file: string;
locate: (c: number) => {
line: number;
column: number;
};
elements: Element[];
stylesheet: Stylesheet;
aliases: Map<string, Identifier>;
used_names: Set<string>;
globally_used_names: Set<string>;
slots: Map<string, Slot>;
slot_outlets: Set<string>;
constructor(ast: Ast, source: string, name: string, compile_options: CompileOptions, stats: Stats, warnings: Warning[]);
add_var(variable: Var): void;
add_reference(name: string): void;
alias(name: string): Identifier;
apply_stylesheet(element: Element): void;
global(name: string): Identifier;
generate(result?: {
js: Node[];
css: CssResult;
}): {
js: any;
css: any;
ast: Ast;
warnings: Warning[];
vars: {
name: string;
export_name: string;
injected: boolean;
module: boolean;
mutated: boolean;
reassigned: boolean;
referenced: boolean;
writable: boolean;
referenced_from_script: boolean;
}[];
stats: {
timings: {
total: number;
};
};
};
get_unique_name(name: string, scope?: Scope): Identifier;
get_unique_name_maker(): (name: string) => Identifier;
error(pos: {
start: number;
end: number;
}, e: {
code: string;
message: string;
}): void;
warn(pos: {
start: number;
end: number;
}, warning: {
code: string;
message: string;
}): void;
extract_imports(node: any): void;
extract_exports(node: any): any;
extract_javascript(script: any): any;
walk_module_js(): void;
walk_instance_js_pre_template(): void;
walk_instance_js_post_template(): void;
post_template_walk(): void;
track_references_and_mutations(): void;
warn_on_undefined_store_value_references(node: Node, parent: Node, prop: string, scope: Scope): void;
loop_protect(node: any, scope: Scope, timeout: number): Node | null;
rewrite_props(get_insert: (variable: Var) => Node[]): void;
hoist_instance_declarations(): void;
extract_reactive_declarations(): void;
warn_if_undefined(name: string, node: any, template_scope: TemplateScope): void;
push_ignores(ignores: any): void;
pop_ignores(): void;
}
export {};

View file

@ -0,0 +1,14 @@
import { ModuleFormat } from '../interfaces';
import { Identifier, ImportDeclaration } from 'estree';
interface Export {
name: string;
as: string;
}
export default function create_module(program: any, format: ModuleFormat, name: Identifier, banner: string, sveltePath: string, helpers: Array<{
name: string;
alias: Identifier;
}>, globals: Array<{
name: string;
alias: Identifier;
}>, imports: ImportDeclaration[], module_exports: Export[]): void;
export {};

View file

@ -0,0 +1,30 @@
import MagicString from 'magic-string';
import Stylesheet from './Stylesheet';
import { CssNode } from './interfaces';
import Component from '../Component';
import Element from '../nodes/Element';
export default class Selector {
node: CssNode;
stylesheet: Stylesheet;
blocks: Block[];
local_blocks: Block[];
used: boolean;
constructor(node: CssNode, stylesheet: Stylesheet);
apply(node: Element): void;
minify(code: MagicString): void;
transform(code: MagicString, attr: string, max_amount_class_specificity_increased: number): void;
validate(component: Component): void;
get_amount_class_specificity_increased(): number;
}
declare class Block {
global: boolean;
host: boolean;
combinator: CssNode;
selectors: CssNode[];
start: number;
end: number;
should_encapsulate: boolean;
constructor(combinator: CssNode);
add(selector: CssNode): void;
}
export {};

View file

@ -0,0 +1,67 @@
import MagicString from 'magic-string';
import Selector from './Selector';
import Element from '../nodes/Element';
import { Ast, CssHashGetter } from '../../interfaces';
import Component from '../Component';
import { CssNode } from './interfaces';
declare class Rule {
selectors: Selector[];
declarations: Declaration[];
node: CssNode;
parent: Atrule;
constructor(node: CssNode, stylesheet: any, parent?: Atrule);
apply(node: Element): void;
is_used(dev: boolean): boolean;
minify(code: MagicString, _dev: boolean): void;
transform(code: MagicString, id: string, keyframes: Map<string, string>, max_amount_class_specificity_increased: number): boolean;
validate(component: Component): void;
warn_on_unused_selector(handler: (selector: Selector) => void): void;
get_max_amount_class_specificity_increased(): number;
}
declare class Declaration {
node: CssNode;
constructor(node: CssNode);
transform(code: MagicString, keyframes: Map<string, string>): void;
minify(code: MagicString): void;
}
declare class Atrule {
node: CssNode;
children: Array<Atrule | Rule>;
declarations: Declaration[];
constructor(node: CssNode);
apply(node: Element): void;
is_used(_dev: boolean): boolean;
minify(code: MagicString, dev: boolean): void;
transform(code: MagicString, id: string, keyframes: Map<string, string>, max_amount_class_specificity_increased: number): void;
validate(component: Component): void;
warn_on_unused_selector(handler: (selector: Selector) => void): void;
get_max_amount_class_specificity_increased(): any;
}
export default class Stylesheet {
source: string;
ast: Ast;
filename: string;
dev: boolean;
has_styles: boolean;
id: string;
children: Array<Rule | Atrule>;
keyframes: Map<string, string>;
nodes_with_css_class: Set<CssNode>;
constructor({ source, ast, component_name, filename, dev, get_css_hash }: {
source: string;
ast: Ast;
filename: string | undefined;
component_name: string | undefined;
dev: boolean;
get_css_hash: CssHashGetter;
});
apply(node: Element): void;
reify(): void;
render(file: string, should_transform_selectors: boolean): {
code: string;
map: import("magic-string").SourceMap;
};
validate(component: Component): void;
warn_on_unused_selectors(component: Component): void;
}
export {};

View file

@ -0,0 +1,3 @@
import { Node } from 'estree';
export declare const UNKNOWN: {};
export declare function gather_possible_values(node: Node, set: Set<string | {}>): void;

View file

@ -0,0 +1,6 @@
export interface CssNode {
type: string;
start: number;
end: number;
[prop_name: string]: any;
}

23
src/@types/compiler/compile/index.d.ts vendored Normal file
View file

@ -0,0 +1,23 @@
import { CompileOptions, Warning } from '../interfaces';
export default function compile(source: string, options?: CompileOptions): {
js: any;
css: any;
ast: import("../interfaces").Ast;
warnings: Warning[];
vars: {
name: string;
export_name: string;
injected: boolean;
module: boolean;
mutated: boolean;
reassigned: boolean;
referenced: boolean;
writable: boolean;
referenced_from_script: boolean;
}[];
stats: {
timings: {
total: number;
};
};
};

View file

@ -0,0 +1,2 @@
declare const _default: Set<string>;
export default _default;

View file

@ -0,0 +1,13 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { Directive } from '../../interfaces';
export default class Action extends Node {
type: 'Action';
name: string;
expression: Expression;
uses_context: boolean;
template_scope: TemplateScope;
constructor(component: Component, parent: Node, scope: TemplateScope, info: Directive);
}

View file

@ -0,0 +1,12 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import Element from './Element';
export default class Animation extends Node {
type: 'Animation';
name: string;
expression: Expression;
constructor(component: Component, parent: Element, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,30 @@
import Component from '../Component';
import Node from './shared/Node';
import Element from './Element';
import Text from './Text';
import Expression from './shared/Expression';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class Attribute extends Node {
type: 'Attribute' | 'Spread';
start: number;
end: number;
scope: TemplateScope;
component: Component;
parent: Element;
name: string;
is_spread: boolean;
is_true: boolean;
is_static: boolean;
expression?: Expression;
chunks: Array<Text | Expression>;
dependencies: Set<string>;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
get_dependencies(): string[];
get_value(block: any): import("estree").Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").Program | import("estree").FunctionDeclaration | import("estree").FunctionExpression | import("estree").ArrowFunctionExpression | import("estree").SwitchCase | import("estree").CatchClause | import("estree").VariableDeclarator | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").ClassDeclaration | import("estree").ThisExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").YieldExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").BinaryExpression | import("estree").AssignmentExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").ConditionalExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").SequenceExpression | import("estree").TemplateLiteral | import("estree").TaggedTemplateExpression | import("estree").ClassExpression | import("estree").MetaProperty | import("estree").AwaitExpression | import("estree").ImportExpression | import("estree").ChainExpression | import("estree").Property | import("estree").Super | import("estree").TemplateElement | import("estree").SpreadElement | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").ClassBody | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | {
type: string;
value: string;
};
get_static_value(): string | true;
should_cache(): boolean;
}

View file

@ -0,0 +1,22 @@
import Node from './shared/Node';
import PendingBlock from './PendingBlock';
import ThenBlock from './ThenBlock';
import CatchBlock from './CatchBlock';
import Expression from './shared/Expression';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import { Context } from './shared/Context';
import { Node as ESTreeNode } from 'estree';
export default class AwaitBlock extends Node {
type: 'AwaitBlock';
expression: Expression;
then_contexts: Context[];
catch_contexts: Context[];
then_node: ESTreeNode | null;
catch_node: ESTreeNode | null;
pending: PendingBlock;
then: ThenBlock;
catch: CatchBlock;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,19 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { Node as ESTreeNode } from 'estree';
import { TemplateNode } from '../../interfaces';
import Element from './Element';
import InlineComponent from './InlineComponent';
import Window from './Window';
export default class Binding extends Node {
type: 'Binding';
name: string;
expression: Expression;
raw_expression: ESTreeNode;
is_contextual: boolean;
is_readonly: boolean;
constructor(component: Component, parent: Element | InlineComponent | Window, scope: TemplateScope, info: TemplateNode);
is_readonly_media_attribute(): boolean;
}

View file

@ -0,0 +1,10 @@
import Node from './shared/Node';
import EventHandler from './EventHandler';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class Body extends Node {
type: 'Body';
handlers: EventHandler[];
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,10 @@
import TemplateScope from './shared/TemplateScope';
import AbstractBlock from './shared/AbstractBlock';
import AwaitBlock from './AwaitBlock';
import Component from '../Component';
import { TemplateNode } from '../../interfaces';
export default class CatchBlock extends AbstractBlock {
type: 'CatchBlock';
scope: TemplateScope;
constructor(component: Component, parent: AwaitBlock, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,11 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import { TemplateNode } from '../../interfaces';
import TemplateScope from './shared/TemplateScope';
import Component from '../Component';
export default class Class extends Node {
type: 'Class';
name: string;
expression: Expression;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,10 @@
import { TemplateNode } from '../../interfaces';
import Component from '../Component';
import Node from './shared/Node';
import TemplateScope from './shared/TemplateScope';
export default class Comment extends Node {
type: 'Comment';
data: string;
ignores: string[];
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,11 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import { INode } from './interfaces';
export default class DebugTag extends Node {
type: 'DebugTag';
expressions: Expression[];
constructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,13 @@
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import Node from './shared/Node';
import Let from './Let';
import { INode } from './interfaces';
export default class DefaultSlotTemplate extends Node {
type: 'SlotTemplate';
scope: TemplateScope;
children: INode[];
lets: Let[];
slot_template_name: string;
constructor(component: Component, parent: INode, scope: TemplateScope, info: any, lets: Let[], children: INode[]);
}

View file

@ -0,0 +1,24 @@
import ElseBlock from './ElseBlock';
import Expression from './shared/Expression';
import TemplateScope from './shared/TemplateScope';
import AbstractBlock from './shared/AbstractBlock';
import { Context } from './shared/Context';
import { Node } from 'estree';
import Component from '../Component';
import { TemplateNode } from '../../interfaces';
export default class EachBlock extends AbstractBlock {
type: 'EachBlock';
expression: Expression;
context_node: Node;
iterations: string;
index: string;
context: string;
key: Expression;
scope: TemplateScope;
contexts: Context[];
has_animation: boolean;
has_binding: boolean;
has_index_binding: boolean;
else?: ElseBlock;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,41 @@
import Node from './shared/Node';
import Attribute from './Attribute';
import Binding from './Binding';
import EventHandler from './EventHandler';
import Transition from './Transition';
import Animation from './Animation';
import Action from './Action';
import Class from './Class';
import Let from './Let';
import TemplateScope from './shared/TemplateScope';
import { INode } from './interfaces';
import Component from '../Component';
export default class Element extends Node {
type: 'Element';
name: string;
scope: TemplateScope;
attributes: Attribute[];
actions: Action[];
bindings: Binding[];
classes: Class[];
handlers: EventHandler[];
lets: Let[];
intro?: Transition;
outro?: Transition;
animation?: Animation;
children: INode[];
namespace: string;
needs_manual_style_scoping: boolean;
constructor(component: Component, parent: Node, scope: TemplateScope, info: any);
validate(): void;
validate_attributes(): void;
validate_attributes_a11y(): void;
validate_special_cases(): void;
validate_bindings_foreign(): void;
validate_bindings(): void;
validate_content(): void;
validate_event_handlers(): void;
is_media_node(): boolean;
add_css_class(): void;
get slot_template_name(): string;
}

View file

@ -0,0 +1,9 @@
import AbstractBlock from './shared/AbstractBlock';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import Node from './shared/Node';
export default class ElseBlock extends AbstractBlock {
type: 'ElseBlock';
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,17 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
import { Identifier } from 'estree';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class EventHandler extends Node {
type: 'EventHandler';
name: string;
modifiers: Set<string>;
expression: Expression;
handler_name: Identifier;
uses_context: boolean;
can_make_passive: boolean;
constructor(component: Component, parent: Node, template_scope: TemplateScope, info: TemplateNode);
get reassigned(): boolean;
}

View file

@ -0,0 +1,13 @@
import Node from './shared/Node';
import Component from '../Component';
import Block from '../render_dom/Block';
import TemplateScope from './shared/TemplateScope';
import { INode } from './interfaces';
import { TemplateNode } from '../../interfaces';
export default class Fragment extends Node {
type: 'Fragment';
block: Block;
children: INode[];
scope: TemplateScope;
constructor(component: Component, info: TemplateNode);
}

View file

@ -0,0 +1,10 @@
import Node from './shared/Node';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class Head extends Node {
type: 'Head';
children: any[];
id: string;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,13 @@
import ElseBlock from './ElseBlock';
import Expression from './shared/Expression';
import AbstractBlock from './shared/AbstractBlock';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import Node from './shared/Node';
export default class IfBlock extends AbstractBlock {
type: 'IfBlock';
expression: Expression;
else: ElseBlock;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,23 @@
import Node from './shared/Node';
import Attribute from './Attribute';
import Binding from './Binding';
import EventHandler from './EventHandler';
import Expression from './shared/Expression';
import Component from '../Component';
import Let from './Let';
import TemplateScope from './shared/TemplateScope';
import { INode } from './interfaces';
import { TemplateNode } from '../../interfaces';
export default class InlineComponent extends Node {
type: 'InlineComponent';
name: string;
expression: Expression;
attributes: Attribute[];
bindings: Binding[];
handlers: EventHandler[];
lets: Let[];
children: INode[];
scope: TemplateScope;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
get slot_template_name(): string;
}

View file

@ -0,0 +1,11 @@
import Expression from './shared/Expression';
import AbstractBlock from './shared/AbstractBlock';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import Node from './shared/Node';
export default class KeyBlock extends AbstractBlock {
type: 'KeyBlock';
expression: Expression;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,12 @@
import Node from './shared/Node';
import Component from '../Component';
import { Identifier } from 'estree';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class Let extends Node {
type: 'Let';
name: Identifier;
value: Identifier;
names: string[];
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,4 @@
import Tag from './shared/Tag';
export default class MustacheTag extends Tag {
type: 'MustacheTag';
}

View file

@ -0,0 +1,4 @@
import Node from './shared/Node';
export default class Options extends Node {
type: 'Options';
}

View file

@ -0,0 +1,9 @@
import AbstractBlock from './shared/AbstractBlock';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import Node from './shared/Node';
export default class PendingBlock extends AbstractBlock {
type: 'PendingBlock';
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,4 @@
import Tag from './shared/Tag';
export default class RawMustacheTag extends Tag {
type: 'RawMustacheTag';
}

View file

@ -0,0 +1,14 @@
import Element from './Element';
import Attribute from './Attribute';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { INode } from './interfaces';
import { TemplateNode } from '../../interfaces';
export default class Slot extends Element {
type: 'Element';
name: string;
children: INode[];
slot_name: string;
values: Map<string, Attribute>;
constructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,16 @@
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import Node from './shared/Node';
import Let from './Let';
import Attribute from './Attribute';
import { INode } from './interfaces';
export default class SlotTemplate extends Node {
type: 'SlotTemplate';
scope: TemplateScope;
children: INode[];
lets: Let[];
slot_attribute: Attribute;
slot_template_name: string;
constructor(component: Component, parent: INode, scope: TemplateScope, info: any);
validate_slot_template_placement(): void;
}

View file

@ -0,0 +1,12 @@
import Node from './shared/Node';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { INode } from './interfaces';
import { TemplateNode } from '../../interfaces';
export default class Text extends Node {
type: 'Text';
data: string;
synthetic: boolean;
constructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode);
should_skip(): any;
}

View file

@ -0,0 +1,10 @@
import TemplateScope from './shared/TemplateScope';
import AbstractBlock from './shared/AbstractBlock';
import AwaitBlock from './AwaitBlock';
import Component from '../Component';
import { TemplateNode } from '../../interfaces';
export default class ThenBlock extends AbstractBlock {
type: 'ThenBlock';
scope: TemplateScope;
constructor(component: Component, parent: AwaitBlock, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,11 @@
import Node from './shared/Node';
import { Children } from './shared/map_children';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class Title extends Node {
type: 'Title';
children: Children;
should_cache: boolean;
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,14 @@
import Node from './shared/Node';
import Expression from './shared/Expression';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
import Element from './Element';
export default class Transition extends Node {
type: 'Transition';
name: string;
directive: string;
expression: Expression;
is_local: boolean;
constructor(component: Component, parent: Element, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,14 @@
import Node from './shared/Node';
import Binding from './Binding';
import EventHandler from './EventHandler';
import Action from './Action';
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import { TemplateNode } from '../../interfaces';
export default class Window extends Node {
type: 'Window';
handlers: EventHandler[];
bindings: Binding[];
actions: Action[];
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
}

View file

@ -0,0 +1,34 @@
import Tag from './shared/Tag';
import Action from './Action';
import Animation from './Animation';
import Attribute from './Attribute';
import AwaitBlock from './AwaitBlock';
import Binding from './Binding';
import Body from './Body';
import CatchBlock from './CatchBlock';
import Class from './Class';
import Comment from './Comment';
import DebugTag from './DebugTag';
import EachBlock from './EachBlock';
import Element from './Element';
import ElseBlock from './ElseBlock';
import EventHandler from './EventHandler';
import Fragment from './Fragment';
import Head from './Head';
import IfBlock from './IfBlock';
import InlineComponent from './InlineComponent';
import KeyBlock from './KeyBlock';
import Let from './Let';
import MustacheTag from './MustacheTag';
import Options from './Options';
import PendingBlock from './PendingBlock';
import RawMustacheTag from './RawMustacheTag';
import Slot from './Slot';
import SlotTemplate from './SlotTemplate';
import DefaultSlotTemplate from './DefaultSlotTemplate';
import Text from './Text';
import ThenBlock from './ThenBlock';
import Title from './Title';
import Transition from './Transition';
import Window from './Window';
export declare type INode = Action | Animation | Attribute | AwaitBlock | Binding | Body | CatchBlock | Class | Comment | DebugTag | EachBlock | Element | ElseBlock | EventHandler | Fragment | Head | IfBlock | InlineComponent | KeyBlock | Let | MustacheTag | Options | PendingBlock | RawMustacheTag | Slot | SlotTemplate | DefaultSlotTemplate | Tag | Text | ThenBlock | Title | Transition | Window;

View file

@ -0,0 +1,10 @@
import Block from '../../render_dom/Block';
import Component from '../../Component';
import Node from './Node';
import { INode } from '../interfaces';
export default class AbstractBlock extends Node {
block: Block;
children: INode[];
constructor(component: Component, parent: any, scope: any, info: any);
warn_if_empty_block(): void;
}

View file

@ -0,0 +1,8 @@
import { Node, Identifier } from 'estree';
export interface Context {
key: Identifier;
name?: string;
modifier: (node: Node) => Node;
default_modifier: (node: Node, to_ctx: (name: string) => Node) => Node;
}
export declare function unpack_destructuring(contexts: Context[], node: Node, modifier?: Context['modifier'], default_modifier?: Context['default_modifier']): void;

View file

@ -0,0 +1,26 @@
import Component from '../../Component';
import { Scope } from '../../utils/scope';
import TemplateScope from './TemplateScope';
import Block from '../../render_dom/Block';
import { Node } from 'estree';
import { INode } from '../interfaces';
declare type Owner = INode;
export default class Expression {
type: 'Expression';
component: Component;
owner: Owner;
node: Node;
references: Set<string>;
dependencies: Set<string>;
contextual_dependencies: Set<string>;
template_scope: TemplateScope;
scope: Scope;
scope_map: WeakMap<Node, Scope>;
declarations: Array<(Node | Node[])>;
uses_context: boolean;
manipulated: Node;
constructor(component: Component, owner: Owner, template_scope: TemplateScope, info: Node, lazy?: boolean);
dynamic_dependencies(): string[];
manipulate(block?: Block): Node;
}
export {};

View file

@ -0,0 +1,21 @@
import Attribute from '../Attribute';
import Component from '../../Component';
import { INode } from '../interfaces';
import { TemplateNode } from '../../../interfaces';
export default class Node {
readonly start: number;
readonly end: number;
readonly component: Component;
readonly parent: INode;
readonly type: string;
prev?: INode;
next?: INode;
can_use_innerhtml: boolean;
var: string;
attributes: Attribute[];
constructor(component: Component, parent: Node, _scope: any, info: TemplateNode);
cannot_use_innerhtml(): void;
find_nearest(selector: RegExp): any;
get_static_attribute_value(name: string): string | true;
has_ancestor(type: string): any;
}

View file

@ -0,0 +1,8 @@
import Node from './Node';
import Expression from './Expression';
export default class Tag extends Node {
type: 'MustacheTag' | 'RawMustacheTag';
expression: Expression;
should_cache: boolean;
constructor(component: any, parent: any, scope: any, info: any);
}

View file

@ -0,0 +1,21 @@
import EachBlock from '../EachBlock';
import ThenBlock from '../ThenBlock';
import CatchBlock from '../CatchBlock';
import InlineComponent from '../InlineComponent';
import Element from '../Element';
import SlotTemplate from '../SlotTemplate';
declare type NodeWithScope = EachBlock | ThenBlock | CatchBlock | InlineComponent | Element | SlotTemplate;
export default class TemplateScope {
names: Set<string>;
dependencies_for_name: Map<string, Set<string>>;
owners: Map<string, NodeWithScope>;
parent?: TemplateScope;
constructor(parent?: TemplateScope);
add(name: any, dependencies: Set<string>, owner: any): this;
child(): TemplateScope;
is_top_level(name: string): any;
get_owner(name: string): NodeWithScope;
is_let(name: string): boolean;
is_await(name: string): boolean;
}
export {};

View file

@ -0,0 +1,3 @@
import Component from '../../Component';
import TemplateScope from './TemplateScope';
export default function is_contextual(component: Component, scope: TemplateScope, name: string): boolean;

View file

@ -0,0 +1,20 @@
import AwaitBlock from '../AwaitBlock';
import Body from '../Body';
import Comment from '../Comment';
import EachBlock from '../EachBlock';
import Element from '../Element';
import Head from '../Head';
import IfBlock from '../IfBlock';
import InlineComponent from '../InlineComponent';
import KeyBlock from '../KeyBlock';
import MustacheTag from '../MustacheTag';
import Options from '../Options';
import RawMustacheTag from '../RawMustacheTag';
import DebugTag from '../DebugTag';
import SlotTemplate from '../SlotTemplate';
import Text from '../Text';
import Title from '../Title';
import Window from '../Window';
import { TemplateNode } from '../../../interfaces';
export declare type Children = ReturnType<typeof map_children>;
export default function map_children(component: any, parent: any, scope: any, children: TemplateNode[]): (AwaitBlock | Body | Comment | DebugTag | EachBlock | Element | Head | IfBlock | InlineComponent | KeyBlock | MustacheTag | Options | RawMustacheTag | SlotTemplate | Text | Title | Window)[];

View file

@ -0,0 +1,78 @@
import Renderer from './Renderer';
import Wrapper from './wrappers/shared/Wrapper';
import { Node, Identifier } from 'estree';
export interface Bindings {
object: Identifier;
property: Identifier;
snippet: Node;
store: string;
modifier: (node: Node) => Node;
}
export interface BlockOptions {
parent?: Block;
name: Identifier;
type: string;
renderer?: Renderer;
comment?: string;
key?: Identifier;
bindings?: Map<string, Bindings>;
dependencies?: Set<string>;
}
export default class Block {
parent?: Block;
renderer: Renderer;
name: Identifier;
type: string;
comment?: string;
wrappers: Wrapper[];
key: Identifier;
first: Identifier;
dependencies: Set<string>;
bindings: Map<string, Bindings>;
binding_group_initialised: Set<string>;
chunks: {
declarations: Array<Node | Node[]>;
init: Array<Node | Node[]>;
create: Array<Node | Node[]>;
claim: Array<Node | Node[]>;
hydrate: Array<Node | Node[]>;
mount: Array<Node | Node[]>;
measure: Array<Node | Node[]>;
fix: Array<Node | Node[]>;
animate: Array<Node | Node[]>;
intro: Array<Node | Node[]>;
update: Array<Node | Node[]>;
outro: Array<Node | Node[]>;
destroy: Array<Node | Node[]>;
};
event_listeners: Node[];
maintain_context: boolean;
has_animation: boolean;
has_intros: boolean;
has_outros: boolean;
has_intro_method: boolean;
has_outro_method: boolean;
outros: number;
aliases: Map<string, Identifier>;
variables: Map<string, {
id: Identifier;
init?: Node;
}>;
get_unique_name: (name: string) => Identifier;
has_update_method: boolean;
autofocus: string;
constructor(options: BlockOptions);
assign_variable_names(): void;
add_dependencies(dependencies: Set<string>): void;
add_element(id: Identifier, render_statement: Node, claim_statement: Node, parent_node: Node, no_detach?: boolean): void;
add_intro(local?: boolean): void;
add_outro(local?: boolean): void;
add_animation(): void;
add_variable(id: Identifier, init?: Node): void;
alias(name: string): Identifier;
child(options: BlockOptions): Block;
get_contents(key?: any): Node[];
has_content(): boolean;
render(): Node[];
render_listeners(chunk?: string): void;
}

View file

@ -0,0 +1,45 @@
import Block from './Block';
import { CompileOptions, Var } from '../../interfaces';
import Component from '../Component';
import FragmentWrapper from './wrappers/Fragment';
import { Node, Identifier, MemberExpression, Literal, Expression } from 'estree';
interface ContextMember {
name: string;
index: Literal;
is_contextual: boolean;
is_non_contextual: boolean;
variable: Var;
priority: number;
}
export default class Renderer {
component: Component;
options: CompileOptions;
context: ContextMember[];
initial_context: ContextMember[];
context_lookup: Map<string, ContextMember>;
context_overflow: boolean;
blocks: Array<Block | Node | Node[]>;
readonly: Set<string>;
meta_bindings: Array<Node | Node[]>;
binding_groups: Map<string, {
binding_group: (to_reference?: boolean) => Node;
is_context: boolean;
contexts: string[];
index: number;
keypath: string;
}>;
block: Block;
fragment: FragmentWrapper;
file_var: Identifier;
locate: (c: number) => {
line: number;
column: number;
};
constructor(component: Component, options: CompileOptions);
add_to_context(name: string, contextual?: boolean): ContextMember;
invalidate(name: string, value?: any, main_execution_context?: boolean): any;
dirty(names: string[], is_reactive_declaration?: boolean): Expression;
reference(node: string | Identifier | MemberExpression): any;
remove_block(block: Block | Node | Node[]): void;
}
export {};

View file

@ -0,0 +1,7 @@
import Component from '../Component';
import { CompileOptions, CssResult } from '../../interfaces';
import { Node } from 'estree';
export default function dom(component: Component, options: CompileOptions): {
js: Node[];
css: CssResult;
};

View file

@ -0,0 +1,5 @@
import { Scope } from '../utils/scope';
import { Node } from 'estree';
import Renderer from './Renderer';
export declare function invalidate(renderer: Renderer, scope: Scope, node: Node, names: Set<string>, main_execution_context?: boolean): any;
export declare function renderer_invalidate(renderer: Renderer, name: string, value?: any, main_execution_context?: boolean): any;

View file

@ -0,0 +1,38 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import AwaitBlock from '../../nodes/AwaitBlock';
import FragmentWrapper from './Fragment';
import PendingBlock from '../../nodes/PendingBlock';
import ThenBlock from '../../nodes/ThenBlock';
import CatchBlock from '../../nodes/CatchBlock';
import { Context } from '../../nodes/shared/Context';
import { Identifier, Literal, Node } from 'estree';
declare type Status = 'pending' | 'then' | 'catch';
declare class AwaitBlockBranch extends Wrapper {
parent: AwaitBlockWrapper;
node: PendingBlock | ThenBlock | CatchBlock;
block: Block;
fragment: FragmentWrapper;
is_dynamic: boolean;
var: any;
status: Status;
value: string;
value_index: Literal;
value_contexts: Context[];
is_destructured: boolean;
constructor(status: Status, renderer: Renderer, block: Block, parent: AwaitBlockWrapper, node: PendingBlock | ThenBlock | CatchBlock, strip_whitespace: boolean, next_sibling: Wrapper);
add_context(node: Node | null, contexts: Context[]): void;
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
render_destructure(): void;
}
export default class AwaitBlockWrapper extends Wrapper {
node: AwaitBlock;
pending: AwaitBlockBranch;
then: AwaitBlockBranch;
catch: AwaitBlockBranch;
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: AwaitBlock, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
}
export {};

View file

@ -0,0 +1,13 @@
import Block from '../Block';
import Wrapper from './shared/Wrapper';
import Body from '../../nodes/Body';
import { Identifier } from 'estree';
import EventHandler from './Element/EventHandler';
import { TemplateNode } from '../../../interfaces';
import Renderer from '../Renderer';
export default class BodyWrapper extends Wrapper {
node: Body;
handlers: EventHandler[];
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: TemplateNode);
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,10 @@
import Renderer from '../Renderer';
import Wrapper from './shared/Wrapper';
import Block from '../Block';
import DebugTag from '../../nodes/DebugTag';
import { Identifier } from 'estree';
export default class DebugTagWrapper extends Wrapper {
node: DebugTag;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: DebugTag, _strip_whitespace: boolean, _next_sibling: Wrapper);
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,56 @@
import Renderer from '../Renderer';
import Block from '../Block';
import Wrapper from './shared/Wrapper';
import EachBlock from '../../nodes/EachBlock';
import FragmentWrapper from './Fragment';
import ElseBlock from '../../nodes/ElseBlock';
import { Identifier, Node } from 'estree';
export declare class ElseBlockWrapper extends Wrapper {
node: ElseBlock;
block: Block;
fragment: FragmentWrapper;
is_dynamic: boolean;
var: any;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: ElseBlock, strip_whitespace: boolean, next_sibling: Wrapper);
}
export default class EachBlockWrapper extends Wrapper {
block: Block;
node: EachBlock;
fragment: FragmentWrapper;
else?: ElseBlockWrapper;
vars: {
create_each_block: Identifier;
each_block_value: Identifier;
get_each_context: Identifier;
iterations: Identifier;
fixed_length: number;
data_length: Node | number;
view_length: Node | number;
};
context_props: Array<Node | Node[]>;
index_name: Identifier;
updates: Array<Node | Node[]>;
dependencies: Set<string>;
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: EachBlock, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
render_keyed({ block, parent_node, parent_nodes, snippet, initial_anchor_node, initial_mount_node, update_anchor_node, update_mount_node }: {
block: Block;
parent_node: Identifier;
parent_nodes: Identifier;
snippet: Node;
initial_anchor_node: Identifier;
initial_mount_node: Identifier;
update_anchor_node: Identifier;
update_mount_node: Identifier;
}): void;
render_unkeyed({ block, parent_nodes, snippet, initial_anchor_node, initial_mount_node, update_anchor_node, update_mount_node }: {
block: Block;
parent_nodes: Identifier;
snippet: Node;
initial_anchor_node: Identifier;
initial_mount_node: Identifier;
update_anchor_node: Identifier;
update_mount_node: Identifier;
}): void;
}

View file

@ -0,0 +1,42 @@
import Attribute from '../../../nodes/Attribute';
import Block from '../../Block';
import ElementWrapper from './index';
import { Identifier, Node } from 'estree';
export declare class BaseAttributeWrapper {
node: Attribute;
parent: ElementWrapper;
constructor(parent: ElementWrapper, block: Block, node: Attribute);
render(_block: Block): void;
}
export default class AttributeWrapper extends BaseAttributeWrapper {
node: Attribute;
parent: ElementWrapper;
metadata: any;
name: string;
property_name: string;
is_indirectly_bound_value: boolean;
is_src: boolean;
is_select_value_attribute: boolean;
is_input_value: boolean;
should_cache: boolean;
last: Identifier;
constructor(parent: ElementWrapper, block: Block, node: Attribute);
render(block: Block): void;
get_init(block: Block, value: any): any;
get_dom_update_conditions(block: Block, dependency_condition: Node): Node;
get_dependencies(): string[];
get_metadata(): any;
get_value(block: any): Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").Program | import("estree").FunctionDeclaration | import("estree").FunctionExpression | import("estree").ArrowFunctionExpression | import("estree").SwitchCase | import("estree").CatchClause | import("estree").VariableDeclarator | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").ClassDeclaration | import("estree").ThisExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").YieldExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").BinaryExpression | import("estree").AssignmentExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").ConditionalExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").SequenceExpression | import("estree").TemplateLiteral | import("estree").TaggedTemplateExpression | import("estree").ClassExpression | import("estree").MetaProperty | import("estree").AwaitExpression | import("estree").ImportExpression | import("estree").ChainExpression | import("estree").Property | import("estree").Super | import("estree").TemplateElement | import("estree").SpreadElement | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").ClassBody | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | {
type: string;
value: string;
};
get_class_name_text(block: any): Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").Program | import("estree").FunctionDeclaration | import("estree").FunctionExpression | import("estree").ArrowFunctionExpression | import("estree").SwitchCase | import("estree").CatchClause | import("estree").VariableDeclarator | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").ClassDeclaration | import("estree").ThisExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").YieldExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").BinaryExpression | import("estree").AssignmentExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").ConditionalExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").SequenceExpression | import("estree").TemplateLiteral | import("estree").TaggedTemplateExpression | import("estree").ClassExpression | import("estree").MetaProperty | import("estree").AwaitExpression | import("estree").ImportExpression | import("estree").ChainExpression | import("estree").Property | import("estree").Super | import("estree").TemplateElement | import("estree").SpreadElement | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").ClassBody | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | {
type: string;
value: string;
};
render_chunks(block: Block): (Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").Program | import("estree").FunctionDeclaration | import("estree").FunctionExpression | import("estree").ArrowFunctionExpression | import("estree").SwitchCase | import("estree").CatchClause | import("estree").VariableDeclarator | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").ClassDeclaration | import("estree").ThisExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").YieldExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").BinaryExpression | import("estree").AssignmentExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").ConditionalExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").SequenceExpression | import("estree").TemplateLiteral | import("estree").TaggedTemplateExpression | import("estree").ClassExpression | import("estree").MetaProperty | import("estree").AwaitExpression | import("estree").ImportExpression | import("estree").ChainExpression | import("estree").Property | import("estree").Super | import("estree").TemplateElement | import("estree").SpreadElement | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").ClassBody | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier | {
type: string;
value: string;
})[];
stringify(): string;
}

View file

@ -0,0 +1,23 @@
import Binding from '../../../nodes/Binding';
import ElementWrapper from '../Element';
import InlineComponentWrapper from '../InlineComponent';
import Block from '../../Block';
import { Node, Identifier } from 'estree';
export default class BindingWrapper {
node: Binding;
parent: ElementWrapper | InlineComponentWrapper;
object: string;
handler: {
uses_context: boolean;
mutation: (Node | Node[]);
contextual_dependencies: Set<string>;
lhs?: Node;
};
snippet: Node;
is_readonly: boolean;
needs_lock: boolean;
constructor(block: Block, node: Binding, parent: ElementWrapper | InlineComponentWrapper);
get_dependencies(): Set<string>;
is_readonly_media_attribute(): boolean;
render(block: Block, lock: Identifier): void;
}

View file

@ -0,0 +1,11 @@
import EventHandler from '../../../nodes/EventHandler';
import Wrapper from '../shared/Wrapper';
import Block from '../../Block';
import { Expression } from 'estree';
export default class EventHandlerWrapper {
node: EventHandler;
parent: Wrapper;
constructor(node: EventHandler, parent: Wrapper);
get_snippet(block: any): any;
render(block: Block, target: string | Expression): void;
}

View file

@ -0,0 +1,3 @@
import { BaseAttributeWrapper } from './Attribute';
export default class SpreadAttributeWrapper extends BaseAttributeWrapper {
}

View file

@ -0,0 +1,16 @@
import Attribute from '../../../nodes/Attribute';
import Block from '../../Block';
import AttributeWrapper from './Attribute';
import ElementWrapper from '../Element';
import Expression from '../../../nodes/shared/Expression';
import Text from '../../../nodes/Text';
export interface StyleProp {
key: string;
value: Array<Text | Expression>;
important: boolean;
}
export default class StyleAttributeWrapper extends AttributeWrapper {
node: Attribute;
parent: ElementWrapper;
render(block: Block): void;
}

View file

@ -0,0 +1 @@
export default function fix_attribute_casing(name: any): any;

View file

@ -0,0 +1,3 @@
import AttributeWrapper from './Attribute';
import BindingWrapper from './Binding';
export default function handle_select_value_binding(attr: AttributeWrapper | BindingWrapper, dependencies: Set<string>): void;

View file

@ -0,0 +1,41 @@
import Renderer from '../../Renderer';
import Element from '../../../nodes/Element';
import Wrapper from '../shared/Wrapper';
import Block from '../../Block';
import FragmentWrapper from '../Fragment';
import AttributeWrapper from './Attribute';
import StyleAttributeWrapper from './StyleAttribute';
import SpreadAttributeWrapper from './SpreadAttribute';
import Binding from './Binding';
import { Identifier } from 'estree';
import EventHandler from './EventHandler';
interface BindingGroup {
events: string[];
bindings: Binding[];
}
export default class ElementWrapper extends Wrapper {
node: Element;
fragment: FragmentWrapper;
attributes: Array<AttributeWrapper | StyleAttributeWrapper | SpreadAttributeWrapper>;
bindings: Binding[];
event_handlers: EventHandler[];
class_dependencies: string[];
select_binding_dependencies?: Set<string>;
var: any;
void: boolean;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Element, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
can_use_textcontent(): boolean;
get_render_statement(block: Block): import("estree").Expression;
get_claim_statement(nodes: Identifier): import("estree").Expression;
add_directives_in_order(block: Block): void;
add_bindings(block: Block, binding_group: BindingGroup): void;
add_this_binding(block: Block, this_binding: Binding): void;
add_attributes(block: Block): void;
add_spread_attributes(block: Block): void;
add_transitions(block: Block): void;
add_animation(block: Block): void;
add_classes(block: Block): void;
add_manual_style_scoping(block: any): void;
}
export {};

View file

@ -0,0 +1,10 @@
import Wrapper from './shared/Wrapper';
import { INode } from '../../nodes/interfaces';
import Renderer from '../Renderer';
import Block from '../Block';
import { Identifier } from 'estree';
export default class FragmentWrapper {
nodes: Wrapper[];
constructor(renderer: Renderer, block: Block, nodes: INode[], parent: Wrapper, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,12 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import Head from '../../nodes/Head';
import FragmentWrapper from './Fragment';
import { Identifier } from 'estree';
export default class HeadWrapper extends Wrapper {
fragment: FragmentWrapper;
node: Head;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Head, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,54 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import EachBlock from '../../nodes/EachBlock';
import IfBlock from '../../nodes/IfBlock';
import ElseBlock from '../../nodes/ElseBlock';
import FragmentWrapper from './Fragment';
import { Identifier, Node, UnaryExpression } from 'estree';
declare class IfBlockBranch extends Wrapper {
block: Block;
fragment: FragmentWrapper;
dependencies?: string[];
condition?: any;
snippet?: Node;
is_dynamic: boolean;
var: any;
constructor(renderer: Renderer, block: Block, parent: IfBlockWrapper, node: IfBlock | ElseBlock, strip_whitespace: boolean, next_sibling: Wrapper);
}
export default class IfBlockWrapper extends Wrapper {
node: IfBlock;
branches: IfBlockBranch[];
needs_update: boolean;
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: EachBlock, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
render_compound(block: Block, parent_node: Identifier, _parent_nodes: Identifier, dynamic: any, { name, anchor, has_else, if_exists_condition, has_transitions }: {
name: any;
anchor: any;
has_else: any;
if_exists_condition: any;
has_transitions: any;
}, detaching: any): void;
render_compound_with_outros(block: Block, parent_node: Identifier, _parent_nodes: Identifier, dynamic: any, { name, anchor, has_else, has_transitions, if_exists_condition }: {
name: any;
anchor: any;
has_else: any;
has_transitions: any;
if_exists_condition: any;
}, detaching: any): void;
render_simple(block: Block, parent_node: Identifier, _parent_nodes: Identifier, dynamic: any, { name, anchor, if_exists_condition, has_transitions }: {
name: any;
anchor: any;
if_exists_condition: any;
has_transitions: any;
}, detaching: any): void;
get_initial_dirty_bit(): {
readonly type: "ArrayExpression" | "UnaryExpression";
elements: UnaryExpression[];
operator: import("estree").UnaryOperator;
prefix: true;
argument: import("estree").Expression;
};
}
export {};

View file

@ -0,0 +1,25 @@
import Wrapper from '../shared/Wrapper';
import Renderer from '../../Renderer';
import Block from '../../Block';
import InlineComponent from '../../../nodes/InlineComponent';
import FragmentWrapper from '../Fragment';
import TemplateScope from '../../../nodes/shared/TemplateScope';
import { Node, Identifier } from 'estree';
declare type SlotDefinition = {
block: Block;
scope: TemplateScope;
get_context?: Node;
get_changes?: Node;
};
export default class InlineComponentWrapper extends Wrapper {
var: Identifier;
slots: Map<string, SlotDefinition>;
node: InlineComponent;
fragment: FragmentWrapper;
children: Array<Wrapper | FragmentWrapper>;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: InlineComponent, strip_whitespace: boolean, next_sibling: Wrapper);
set_slot(name: string, slot_definition: SlotDefinition): void;
warn_if_reactive(): void;
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
}
export {};

View file

@ -0,0 +1,18 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import EachBlock from '../../nodes/EachBlock';
import KeyBlock from '../../nodes/KeyBlock';
import FragmentWrapper from './Fragment';
import { Identifier } from 'estree';
export default class KeyBlockWrapper extends Wrapper {
node: KeyBlock;
fragment: FragmentWrapper;
block: Block;
dependencies: string[];
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: EachBlock, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
render_static_key(_block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
render_dynamic_key(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,12 @@
import Renderer from '../Renderer';
import Block from '../Block';
import Tag from './shared/Tag';
import Wrapper from './shared/Wrapper';
import MustacheTag from '../../nodes/MustacheTag';
import RawMustacheTag from '../../nodes/RawMustacheTag';
import { Identifier } from 'estree';
export default class MustacheTagWrapper extends Tag {
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: MustacheTag | RawMustacheTag);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,12 @@
import Renderer from '../Renderer';
import Block from '../Block';
import Tag from './shared/Tag';
import Wrapper from './shared/Wrapper';
import MustacheTag from '../../nodes/MustacheTag';
import RawMustacheTag from '../../nodes/RawMustacheTag';
import { Identifier } from 'estree';
export default class RawMustacheTagWrapper extends Tag {
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: MustacheTag | RawMustacheTag);
render(block: Block, parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,17 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import Slot from '../../nodes/Slot';
import FragmentWrapper from './Fragment';
import { Identifier } from 'estree';
export default class SlotWrapper extends Wrapper {
node: Slot;
fragment: FragmentWrapper;
fallback: Block | null;
slot_block: Block;
var: Identifier;
dependencies: Set<string>;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Slot, strip_whitespace: boolean, next_sibling: Wrapper);
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
is_dependency_dynamic(name: string): boolean;
}

View file

@ -0,0 +1,22 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import FragmentWrapper from './Fragment';
import InlineComponentWrapper from './InlineComponent';
import { INode } from '../../nodes/interfaces';
import Let from '../../nodes/Let';
import TemplateScope from '../../nodes/shared/TemplateScope';
declare type NodeWithLets = INode & {
scope: TemplateScope;
lets: Let[];
slot_template_name: string;
};
export default class SlotTemplateWrapper extends Wrapper {
node: NodeWithLets;
fragment: FragmentWrapper;
block: Block;
parent: InlineComponentWrapper;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: NodeWithLets, strip_whitespace: boolean, next_sibling: Wrapper);
render(): void;
}
export {};

View file

@ -0,0 +1,14 @@
import Renderer from '../Renderer';
import Block from '../Block';
import Text from '../../nodes/Text';
import Wrapper from './shared/Wrapper';
import { Identifier } from 'estree';
export default class TextWrapper extends Wrapper {
node: Text;
data: string;
skip: boolean;
var: Identifier;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Text, data: string);
use_space(): boolean;
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,10 @@
import Wrapper from './shared/Wrapper';
import Renderer from '../Renderer';
import Block from '../Block';
import Title from '../../nodes/Title';
import { Identifier } from 'estree';
export default class TitleWrapper extends Wrapper {
node: Title;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Title, _strip_whitespace: boolean, _next_sibling: Wrapper);
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,13 @@
import Renderer from '../Renderer';
import Block from '../Block';
import Wrapper from './shared/Wrapper';
import Window from '../../nodes/Window';
import { Identifier } from 'estree';
import { TemplateNode } from '../../../interfaces';
import EventHandler from './Element/EventHandler';
export default class WindowWrapper extends Wrapper {
node: Window;
handlers: EventHandler[];
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: TemplateNode);
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,14 @@
import Wrapper from './Wrapper';
import Renderer from '../../Renderer';
import Block from '../../Block';
import MustacheTag from '../../../nodes/MustacheTag';
import RawMustacheTag from '../../../nodes/RawMustacheTag';
import { Node } from 'estree';
export default class Tag extends Wrapper {
node: MustacheTag | RawMustacheTag;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: MustacheTag | RawMustacheTag);
is_dependencies_static(): boolean;
rename_this_method(block: Block, update: ((value: Node) => (Node | Node[]))): {
init: import("estree").Identifier | import("estree").SimpleLiteral | import("estree").RegExpLiteral | import("estree").Program | import("estree").FunctionDeclaration | import("estree").FunctionExpression | import("estree").ArrowFunctionExpression | import("estree").SwitchCase | import("estree").CatchClause | import("estree").VariableDeclarator | import("estree").ExpressionStatement | import("estree").BlockStatement | import("estree").EmptyStatement | import("estree").DebuggerStatement | import("estree").WithStatement | import("estree").ReturnStatement | import("estree").LabeledStatement | import("estree").BreakStatement | import("estree").ContinueStatement | import("estree").IfStatement | import("estree").SwitchStatement | import("estree").ThrowStatement | import("estree").TryStatement | import("estree").WhileStatement | import("estree").DoWhileStatement | import("estree").ForStatement | import("estree").ForInStatement | import("estree").ForOfStatement | import("estree").VariableDeclaration | import("estree").ClassDeclaration | import("estree").ThisExpression | import("estree").ArrayExpression | import("estree").ObjectExpression | import("estree").YieldExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").BinaryExpression | import("estree").AssignmentExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").ConditionalExpression | import("estree").SimpleCallExpression | import("estree").NewExpression | import("estree").SequenceExpression | import("estree").TemplateLiteral | import("estree").TaggedTemplateExpression | import("estree").ClassExpression | import("estree").MetaProperty | import("estree").AwaitExpression | import("estree").ImportExpression | import("estree").ChainExpression | import("estree").Property | import("estree").Super | import("estree").TemplateElement | import("estree").SpreadElement | import("estree").ObjectPattern | import("estree").ArrayPattern | import("estree").RestElement | import("estree").AssignmentPattern | import("estree").ClassBody | import("estree").MethodDefinition | import("estree").ImportDeclaration | import("estree").ExportNamedDeclaration | import("estree").ExportDefaultDeclaration | import("estree").ExportAllDeclaration | import("estree").ImportSpecifier | import("estree").ImportDefaultSpecifier | import("estree").ImportNamespaceSpecifier | import("estree").ExportSpecifier;
};
}

View file

@ -0,0 +1,21 @@
import Renderer from '../../Renderer';
import Block from '../../Block';
import { TemplateNode } from '../../../../interfaces';
import { Identifier } from 'estree';
export default class Wrapper {
renderer: Renderer;
parent: Wrapper;
node: TemplateNode;
prev: Wrapper | null;
next: Wrapper | null;
var: Identifier;
can_use_innerhtml: boolean;
is_static_content: boolean;
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: TemplateNode);
cannot_use_innerhtml(): void;
not_static_content(): void;
get_or_create_anchor(block: Block, parent_node: Identifier, parent_nodes: Identifier): Identifier;
get_update_mount_node(anchor: Identifier): Identifier;
is_dom_node(): boolean;
render(_block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
}

View file

@ -0,0 +1,4 @@
import Block from '../../Block';
import Action from '../../../nodes/Action';
export default function add_actions(block: Block, target: string, actions: Action[]): void;
export declare function add_action(block: Block, target: string, action: Action): void;

View file

@ -0,0 +1,5 @@
import Block from '../../Block';
import EventHandler from '../Element/EventHandler';
import { Expression } from 'estree';
export default function add_event_handlers(block: Block, target: string | Expression, handlers: EventHandler[]): void;
export declare function add_event_handler(block: Block, target: string | Expression, handler: EventHandler): void;

View file

@ -0,0 +1,5 @@
import Component from '../../../Component';
import Block from '../../Block';
import BindingWrapper from '../Element/Binding';
import { Identifier } from 'estree';
export default function bind_this(component: Component, block: Block, binding: BindingWrapper, variable: Identifier): import("estree").Node[];

View file

@ -0,0 +1,3 @@
import Component from '../../../Component';
import { INode } from '../../../nodes/interfaces';
export default function create_debugging_comment(node: INode, component: Component): string;

View file

@ -0,0 +1,14 @@
import Let from '../../../nodes/Let';
import Block from '../../Block';
import TemplateScope from '../../../nodes/shared/TemplateScope';
export declare function get_slot_definition(block: Block, scope: TemplateScope, lets: Let[]): {
block: Block;
scope: TemplateScope;
get_context?: undefined;
get_changes?: undefined;
} | {
block: Block;
scope: TemplateScope;
get_context: import("estree").Expression;
get_changes: import("estree").Expression;
};

View file

@ -0,0 +1,2 @@
import { Var } from '../../../../interfaces';
export default function is_dynamic(variable: Var): boolean;

View file

@ -0,0 +1 @@
export declare function is_head(node: any): boolean;

View file

@ -0,0 +1,4 @@
import InlineComponentWrapper from '../InlineComponent';
import ElementWrapper from '../Element';
import Binding from '../../../nodes/Binding';
export default function mark_each_block_bindings(parent: ElementWrapper | InlineComponentWrapper, binding: Binding): void;

View file

@ -0,0 +1,33 @@
import { AppendTarget, CompileOptions } from '../../interfaces';
import { INode } from '../nodes/interfaces';
import { Expression, TemplateLiteral, Identifier } from 'estree';
export interface RenderOptions extends CompileOptions {
locate: (c: number) => {
line: number;
column: number;
};
head_id?: string;
}
export default class Renderer {
has_bindings: boolean;
name: Identifier;
stack: Array<{
current: {
value: string;
};
literal: TemplateLiteral;
}>;
current: {
value: string;
};
literal: TemplateLiteral;
targets: AppendTarget[];
constructor({ name }: {
name: any;
});
add_string(str: string): void;
add_expression(node: Expression): void;
push(): void;
pop(): TemplateLiteral;
render(nodes: INode[], options: RenderOptions): void;
}

View file

@ -0,0 +1,3 @@
import Renderer, { RenderOptions } from '../Renderer';
import AwaitBlock from '../../nodes/AwaitBlock';
export default function (node: AwaitBlock, renderer: Renderer, options: RenderOptions): void;

View file

@ -0,0 +1,3 @@
import Renderer, { RenderOptions } from '../Renderer';
import Comment from '../../nodes/Comment';
export default function (_node: Comment, _renderer: Renderer, _options: RenderOptions): void;

View file

@ -0,0 +1,3 @@
import DebugTag from '../../nodes/DebugTag';
import Renderer, { RenderOptions } from '../Renderer';
export default function (node: DebugTag, renderer: Renderer, options: RenderOptions): void;

View file

@ -0,0 +1,3 @@
import Renderer, { RenderOptions } from '../Renderer';
import EachBlock from '../../nodes/EachBlock';
export default function (node: EachBlock, renderer: Renderer, options: RenderOptions): void;

View file

@ -0,0 +1,3 @@
import Renderer, { RenderOptions } from '../Renderer';
import Element from '../../nodes/Element';
export default function (node: Element, renderer: Renderer, options: RenderOptions): void;

View file

@ -0,0 +1,3 @@
import Renderer, { RenderOptions } from '../Renderer';
import Head from '../../nodes/Head';
export default function (node: Head, renderer: Renderer, options: RenderOptions): void;

Some files were not shown because too many files have changed in this diff Show more