pull/15538/head
Rich Harris 4 months ago
parent 22cf914aad
commit a9f2d6f6d0

@ -1,7 +1,7 @@
/**
* @import { ComponentContext, TemplateOperations, ComponentClientTransformState } from "../types.js"
* @import { ComponentContext, ComponentClientTransformState } from "../types.js"
* @import { Identifier, Expression } from "estree"
* @import { AST, Namespace } from '#compiler'
* @import { Namespace } from '#compiler'
* @import { SourceLocation } from '#shared'
*/
import { dev } from '../../../../state.js';

@ -1,13 +1,11 @@
/**
* @import { TemplateOperations } from "../types.js"
* @import { ObjectExpression, Identifier, ArrayExpression, Property, Expression, Literal } from "estree"
*/
/** @import { TemplateOperation } from '../types.js' */
/** @import { ObjectExpression, Identifier, ArrayExpression, Property, Expression, Literal } from 'estree' */
import * as b from '../../../../utils/builders.js';
import { regex_is_valid_identifier } from '../../../patterns.js';
import fix_attribute_casing from './fix-attribute-casing.js';
/**
* @param {TemplateOperations} items
* @param {TemplateOperation[]} items
*/
export function template_to_functions(items) {
let elements = b.array([]);

@ -1,11 +1,9 @@
/**
* @import { TemplateOperations } from "../types.js"
*/
/** @import { TemplateOperation } from '../types.js' */
import { escape_html } from '../../../../../escaping.js';
import { is_void } from '../../../../../utils.js';
/**
* @param {TemplateOperations} items
* @param {TemplateOperation[]} items
*/
export function template_to_string(items) {
/**

@ -36,7 +36,7 @@ export interface ClientTransformState extends TransformState {
>;
}
type TemplateOperations = Array<
type TemplateOperation =
| {
kind: 'create_element';
name: string;
@ -59,8 +59,7 @@ type TemplateOperations = Array<
}
| {
kind: 'pop_element';
}
>;
};
export interface ComponentClientTransformState extends ClientTransformState {
readonly analysis: ComponentAnalysis;
@ -79,7 +78,7 @@ export interface ComponentClientTransformState extends ClientTransformState {
/** Expressions used inside the render effect */
readonly expressions: Expression[];
/** The HTML template string */
readonly template: TemplateOperations;
readonly template: TemplateOperation[];
readonly locations: SourceLocation[];
readonly metadata: {
namespace: Namespace;

Loading…
Cancel
Save