on second thoughts

pull/15820/head
Rich Harris 4 months ago
parent 75680a9a5e
commit 2ffb863b5d

@ -1,6 +1,6 @@
import type { Scope } from '../scope.js';
import type { ComponentAnalysis, ReactiveStatement } from '../types.js';
import type { AST, ExpressionMetadata, StateFields, ValidatedCompileOptions } from '#compiler';
import type { AST, ExpressionMetadata, StateField, ValidatedCompileOptions } from '#compiler';
import type { ClassBody } from 'estree';
export interface AnalysisState {
@ -21,8 +21,8 @@ export interface AnalysisState {
expression: ExpressionMetadata | null;
/** Used to analyze class state. */
classes: Map<ClassBody, StateFields>;
state_fields: StateFields | null;
classes: Map<ClassBody, Record<string, StateField>>;
state_fields: Record<string, StateField> | null;
function_depth: number;

@ -1,5 +1,5 @@
/** @import { AssignmentExpression, ClassBody, PropertyDefinition, Expression, PrivateIdentifier, MethodDefinition } from 'estree' */
/** @import { StateFields } from '#compiler' */
/** @import { StateField } from '#compiler' */
/** @import { Context } from '../types' */
import { get_rune } from '../../scope.js';
import * as e from '../../../errors.js';
@ -15,7 +15,7 @@ export function ClassBody(node, context) {
return;
}
/** @type {StateFields} */
/** @type {Record<string, StateField>} */
const state_fields = {};
/** @type {string[]} */

@ -271,11 +271,9 @@ export interface ExpressionMetadata {
has_call: boolean;
}
export interface StateFields {
[name: string]: {
export interface StateField {
type: StateCreationRuneName;
node: PropertyDefinition | AssignmentExpression;
};
}
export * from './template.js';

Loading…
Cancel
Save