import { type ForOfStatement, type Interpolation, type IsBindingBehavior } from '@aurelia/expression-parser'; import { IAttributeComponentDefinition, IElementComponentDefinition } from './interfaces-template-compiler'; import { AttrSyntax } from './attribute-pattern'; import { BindingMode } from './binding-mode'; /** * Instruction type numeric ranges: * * Core instruction types (prefix: it): * 0-9: Hydration instructions (itHydrateElement, itHydrateAttribute, etc.) * 10-29: Property/binding instructions (itSetProperty, itPropertyBinding, etc.) * 30-49: DOM binding instructions (itTextBinding, itListenerBinding, etc.) * 50-59: Spread instructions * 60-99: Reserved for future core use * * Plugin ranges: * 100-119: @aurelia/i18n (itTranslation, itTranslationBind, itTranslationParameters) * 120-139: @aurelia/state (itStateBinding, itDispatchBinding) * 140-159: @aurelia/compat-v1 (itCall, itDelegate) * 160-199: Reserved for future official plugins * 200+: Third-party plugins */ export declare const itHydrateElement = 0; export declare const itHydrateAttribute = 1; export declare const itHydrateTemplateController = 2; export declare const itHydrateLetElement = 3; export declare const itSetProperty = 10; export declare const itInterpolation = 11; export declare const itPropertyBinding = 12; export declare const itLetBinding = 13; export declare const itRefBinding = 14; export declare const itIteratorBinding = 15; export declare const itMultiAttr = 16; export declare const itTextBinding = 30; export declare const itListenerBinding = 31; export declare const itAttributeBinding = 32; export declare const itStylePropertyBinding = 33; export declare const itSetAttribute = 34; export declare const itSetClassAttribute = 35; export declare const itSetStyleAttribute = 36; export declare const itSpreadTransferedBinding = 50; export declare const itSpreadElementProp = 51; export declare const itSpreadValueBinding = 52; /** * Base instruction interface - use `Instruction` union type for stricter typing */ export interface IInstruction { readonly type: number; } export declare const IInstruction: import("@aurelia/kernel").InterfaceSymbol; export declare function isInstruction(value: unknown): value is IInstruction; export interface InterpolationInstruction extends IInstruction { readonly type: typeof itInterpolation; readonly from: string | Interpolation; readonly to: string; } export interface PropertyBindingInstruction extends IInstruction { readonly type: typeof itPropertyBinding; readonly from: string | IsBindingBehavior; readonly to: string; readonly mode: BindingMode; } export interface IteratorBindingInstruction extends IInstruction { readonly type: typeof itIteratorBinding; readonly forOf: string | ForOfStatement; readonly to: string; readonly props: MultiAttrInstruction[]; } export interface RefBindingInstruction extends IInstruction { readonly type: typeof itRefBinding; readonly from: string | IsBindingBehavior; readonly to: string; } export interface SetPropertyInstruction extends IInstruction { readonly type: typeof itSetProperty; readonly value: unknown; readonly to: string; } export interface MultiAttrInstruction extends IInstruction { readonly type: typeof itMultiAttr; /** Expression source (JIT) or pre-parsed AST (AOT) */ readonly value: string | IsBindingBehavior; readonly to: string; readonly command: string | null; } export interface HydrateElementInstruction = Record, TDef extends IElementComponentDefinition = IElementComponentDefinition> extends IInstruction { readonly type: typeof itHydrateElement; /** * The name of the custom element this instruction is associated with */ readonly res: string | /* Constructable | */ TDef; /** * Bindable instructions for the custom element instance */ readonly props: IInstruction[]; /** * Indicates what projections are associated with the element usage */ readonly projections: Record | null; /** * Indicates whether the usage of the custom element was with a containerless attribute or not */ readonly containerless: boolean; /** * A list of captured attr syntaxes */ readonly captures: AttrSyntax[] | undefined; /** * Any data associated with this instruction */ readonly data: T; } export interface HydrateAttributeInstruction extends IInstruction { readonly type: typeof itHydrateAttribute; readonly res: string | /* Constructable | */ T; readonly alias: string | undefined; /** * Bindable instructions for the custom attribute instance */ readonly props: IInstruction[]; } export interface HydrateTemplateController extends IInstruction { readonly type: typeof itHydrateTemplateController; readonly def: IElementComponentDefinition; readonly res: string | /* Constructable | */ T; readonly alias: string | undefined; /** * Bindable instructions for the template controller instance */ readonly props: IInstruction[]; } export interface HydrateLetElementInstruction extends IInstruction { readonly type: typeof itHydrateLetElement; readonly instructions: LetBindingInstruction[]; readonly toBindingContext: boolean; } export interface LetBindingInstruction extends IInstruction { readonly type: typeof itLetBinding; readonly from: string | IsBindingBehavior | Interpolation; readonly to: string; } export interface TextBindingInstruction extends IInstruction { readonly type: typeof itTextBinding; readonly from: string | IsBindingBehavior; } export interface ListenerBindingInstruction extends IInstruction { readonly type: typeof itListenerBinding; readonly from: string | IsBindingBehavior; readonly to: string; readonly capture: boolean; readonly modifier: string | null; } export interface StylePropertyBindingInstruction extends IInstruction { readonly type: typeof itStylePropertyBinding; readonly from: string | IsBindingBehavior; readonly to: string; } export interface SetAttributeInstruction extends IInstruction { readonly type: typeof itSetAttribute; readonly value: string; readonly to: string; } export interface SetClassAttributeInstruction extends IInstruction { readonly type: typeof itSetClassAttribute; readonly value: string; } export interface SetStyleAttributeInstruction extends IInstruction { readonly type: typeof itSetStyleAttribute; readonly value: string; } export interface AttributeBindingInstruction extends IInstruction { readonly type: typeof itAttributeBinding; /** * `attr` and `to` have the same value on a normal attribute * Will be different on `class` and `style` * on `class`: attr = `class` (from binding command), to = attribute name * on `style`: attr = `style` (from binding command), to = attribute name */ readonly attr: string; readonly from: string | IsBindingBehavior; readonly to: string; } export interface SpreadTransferedBindingInstruction extends IInstruction { readonly type: typeof itSpreadTransferedBinding; } /** * When spreading any attribute bindings onto an element, * it's possible that some attributes will be targeting the bindable properties of a custom element * This instruction is used to express that */ export interface SpreadElementPropBindingInstruction extends IInstruction { readonly type: typeof itSpreadElementProp; readonly instruction: IInstruction; } export interface SpreadValueBindingInstruction extends IInstruction { readonly type: typeof itSpreadValueBinding; readonly target: '$bindables' | '$element'; readonly from: string; } /** * Discriminated union of all core instruction types. * Use this for stricter typing instead of IInstruction where possible. */ export type Instruction = InterpolationInstruction | PropertyBindingInstruction | IteratorBindingInstruction | RefBindingInstruction | SetPropertyInstruction | MultiAttrInstruction | HydrateElementInstruction | HydrateAttributeInstruction | HydrateTemplateController | HydrateLetElementInstruction | LetBindingInstruction | TextBindingInstruction | ListenerBindingInstruction | StylePropertyBindingInstruction | SetAttributeInstruction | SetClassAttributeInstruction | SetStyleAttributeInstruction | AttributeBindingInstruction | SpreadTransferedBindingInstruction | SpreadElementPropBindingInstruction | SpreadValueBindingInstruction; //# sourceMappingURL=instructions.d.ts.map