import type { NodePath } from '@babel/traverse'; import * as t from '@babel/types'; import { PartType } from 'lit-html/directive.js'; import type { EnsureImport } from './compiler-utils.js'; import type { CompiledContext, TemplateContext } from './transpiler.js'; interface CallBindingAttribute extends t.JSXAttribute { value: t.JSXExpressionContainer & { expression: t.CallExpression & { callee: t.MemberExpression & { object: t.Identifier; property: t.Identifier; }; arguments: [t.Expression]; }; }; } interface JSXAttributeWithExpression extends t.JSXAttribute { value: t.JSXExpressionContainer & { expression: t.Expression; }; } interface JSXAttributeWithoutExpression extends t.JSXAttribute { value: Exclude; } interface JSXAttributeBoolean extends t.JSXAttribute { value: null | undefined; } interface ValueBinding { type: 'prop' | 'bool'; name: string; expression: t.Expression; } export declare class AttributeValidators { static isCustomElementIdentifier(attr: t.JSXAttribute): attr is t.JSXAttribute; static isCallBinding(attr: t.JSXAttribute): attr is CallBindingAttribute; static isDirective(attr: t.JSXAttribute): attr is JSXAttributeWithExpression; static isRef(attr: t.JSXAttribute): attr is JSXAttributeWithExpression; static isClassListBinding(attr: t.JSXAttribute): attr is JSXAttributeWithExpression; static isStyleListBinding(attr: t.JSXAttribute): attr is JSXAttributeWithExpression; static isEvent(attr: t.JSXAttribute): attr is JSXAttributeWithExpression; static isExpression(attr: t.JSXAttribute): attr is JSXAttributeWithExpression; static isNonExpression(attribute: t.JSXAttribute): attribute is JSXAttributeWithoutExpression; static isSpread(attr: t.JSXAttribute | t.JSXSpreadAttribute): attr is t.JSXSpreadAttribute; static isBoolean(attr: t.JSXAttribute): attr is JSXAttributeBoolean; } export interface ProcessorContext { builder: unknown; program: t.Program; path: NodePath; tagName: string; isInitialElement: boolean; importsUsed: Set>; } declare abstract class AttributeProcessor { abstract customElementIdentifier(attr: t.JSXAttribute, context: TContext): void; abstract callBinding(attr: CallBindingAttribute, context: TContext): void; abstract directive(attr: JSXAttributeWithExpression, context: TContext): void; abstract ref(attr: JSXAttributeWithExpression, context: TContext): void; abstract classList(attr: JSXAttributeWithExpression, context: TContext): void; abstract styleList(attr: JSXAttributeWithExpression, context: TContext): void; abstract event(attr: JSXAttributeWithExpression, context: TContext): void; abstract expression(attr: JSXAttributeWithExpression, context: TContext): void; abstract nonExpression(attr: JSXAttributeWithoutExpression, context: TContext): void; abstract spread(attr: t.JSXSpreadAttribute, context: TContext): void; abstract boolean(attr: JSXAttributeBoolean, context: TContext): void; processAttribute(attr: t.JSXAttribute | t.JSXSpreadAttribute, context: TContext): void; protected createValueBinding(attr: CallBindingAttribute, context: TContext): ValueBinding; protected createDirective(attr: JSXAttributeWithExpression, context: TContext): t.Expression[]; protected createRef(attr: JSXAttributeWithExpression, context: TContext): t.CallExpression; protected createClassList(attr: JSXAttributeWithExpression, context: TContext): t.CallExpression; protected createStyleList(attr: JSXAttributeWithExpression, context: TContext): t.CallExpression; protected createEvent(attr: JSXAttributeWithExpression, context: TContext): [string, t.Expression]; protected createExpression(attr: JSXAttributeWithExpression, context: TContext): [string, t.Expression]; protected createNonExpression(attr: JSXAttributeWithoutExpression, context: TContext): [string, string]; protected createSpread(attr: t.JSXSpreadAttribute, context: TContext): t.CallExpression; protected createBoolean(attr: JSXAttributeBoolean, context: TContext): string; } export declare class TemplateAttributeProcessor extends AttributeProcessor { customElementIdentifier(attr: t.JSXAttribute, context: TemplateContext): void; callBinding(attr: CallBindingAttribute, context: TemplateContext): void; directive(attr: JSXAttributeWithExpression, context: TemplateContext): void; ref(attr: JSXAttributeWithExpression, context: TemplateContext): void; classList(attr: JSXAttributeWithExpression, context: TemplateContext): void; styleList(attr: JSXAttributeWithExpression, context: TemplateContext): void; event(attr: JSXAttributeWithExpression, context: TemplateContext): void; expression(attr: JSXAttributeWithExpression, context: TemplateContext): void; nonExpression(attr: JSXAttributeWithoutExpression, context: TemplateContext): void; spread(attribute: t.JSXSpreadAttribute, context: TemplateContext): void; boolean(attribute: JSXAttributeBoolean, context: TemplateContext): void; protected valueBinding(attr: CallBindingAttribute, context: TemplateContext): void; } export declare class CompiledAttributeProcessor extends AttributeProcessor { customElementIdentifier(attr: t.JSXAttribute, context: CompiledContext): void; callBinding(attr: CallBindingAttribute, context: CompiledContext): void; directive(attr: JSXAttributeWithExpression, context: CompiledContext): void; ref(attr: JSXAttributeWithExpression, context: CompiledContext): void; classList(attr: JSXAttributeWithExpression, context: CompiledContext): void; styleList(attr: JSXAttributeWithExpression, context: CompiledContext): void; event(attr: JSXAttributeWithExpression, context: CompiledContext): void; expression(attr: JSXAttributeWithExpression, context: CompiledContext): void; nonExpression(attr: JSXAttributeWithoutExpression, context: CompiledContext): void; spread(attr: t.JSXSpreadAttribute, context: CompiledContext): void; boolean(attr: JSXAttributeBoolean, context: CompiledContext): void; protected valueBinding(attr: CallBindingAttribute, context: CompiledContext): void; } export declare class CreateCompiledPart { protected static createBasePart(type: PartType, index: number): t.ObjectProperty[]; protected static createAttributePart(index: number, name: string, ctor: string): t.ObjectExpression; static child(index: number): t.ObjectExpression; static element(index: number): t.ObjectExpression; static attribute(index: number, name: string): t.ObjectExpression; static property(index: number, name: string): t.ObjectExpression; static boolean(index: number, name: string): t.ObjectExpression; static event(index: number, name: string): t.ObjectExpression; } export declare const hasCustomElementIdentifier: (attributes: (t.JSXAttribute | t.JSXSpreadAttribute)[]) => boolean; export {}; //# sourceMappingURL=attribute-processor.d.ts.map