New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aurelia/runtime-html

Package Overview
Dependencies
Maintainers
1
Versions
1026
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelia/runtime-html - npm Package Compare versions

Comparing version 2.0.1-dev.202312121308 to 2.0.1-dev.202401261010

2

dist/types/bindable.d.ts
import { Class } from '@aurelia/kernel';
import { BindingMode } from './binding/interfaces-bindings';
import { type BindingMode } from './binding/interfaces-bindings';
import type { Constructable } from '@aurelia/kernel';

@@ -4,0 +4,0 @@ import type { InterceptorFunc } from '@aurelia/runtime';

import { type IBinding, IAstEvaluator, IConnectableBinding, type ForOfStatement, type IObserverLocator, type IsBindingBehavior, type Scope } from '@aurelia/runtime';
import { BindingMode } from './interfaces-bindings';
import type { TaskQueue } from '@aurelia/platform';
import type { IServiceLocator } from '@aurelia/kernel';
import type { INode } from '../dom';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
export interface AttributeBinding extends IAstEvaluator, IConnectableBinding {

@@ -8,0 +7,0 @@ }

import { IAstEvaluator, IConnectableBinding } from '@aurelia/runtime';
import { BindingMode } from './interfaces-bindings';
import type { IServiceLocator } from '@aurelia/kernel';

@@ -7,3 +6,3 @@ import type { TaskQueue } from '@aurelia/platform';

import type { IPlatform } from '../platform';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
export interface ContentBinding extends IAstEvaluator, IConnectableBinding {

@@ -10,0 +9,0 @@ }

@@ -5,12 +5,13 @@ import { State } from '../templating/controller';

*/
export declare const enum BindingMode {
oneTime = 1,
toView = 2,
fromView = 4,
twoWay = 6,
export declare const BindingMode: Readonly<{
readonly oneTime: 1;
readonly toView: 2;
readonly fromView: 4;
readonly twoWay: 6;
/**
* Unspecified mode, bindings may act differently with this mode
*/
default = 8
}
readonly default: 8;
}>;
export type BindingMode = typeof BindingMode[keyof typeof BindingMode];
export interface IBindingController {

@@ -17,0 +18,0 @@ readonly state: State;

import { IAstEvaluator, IConnectableBinding } from '@aurelia/runtime';
import { BindingMode } from './interfaces-bindings';
import type { IServiceLocator } from '@aurelia/kernel';
import type { ITask, TaskQueue } from '@aurelia/platform';
import type { IBinding, ICollectionSubscriber, Interpolation, IObserverLocator, IsExpression, Scope } from '@aurelia/runtime';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
export interface InterpolationBinding extends IBinding {

@@ -8,0 +7,0 @@ }

import { IAstEvaluator, IBinding, IConnectableBinding, ISubscriber } from '@aurelia/runtime';
import { BindingMode } from './interfaces-bindings';
import type { IServiceLocator } from '@aurelia/kernel';
import type { TaskQueue } from '@aurelia/platform';
import type { ForOfStatement, IObserver, IObserverLocator, IsBindingBehavior, Scope } from '@aurelia/runtime';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
export interface PropertyBinding extends IAstEvaluator, IConnectableBinding {

@@ -8,0 +7,0 @@ }

@@ -11,3 +11,3 @@ export { bindable, Bindable, BindableDefinition, type PartialBindableDefinition, coercer, } from './bindable';

export { AttrSyntax, IAttributeParser, attributePattern, type AttributePatternDefinition, IAttributePattern, AttributePattern, Interpretation, ISyntaxInterpreter, AtPrefixedTriggerAttributePattern, ColonPrefixedBindAttributePattern, DotSeparatedAttributePattern, RefAttributePattern, } from './resources/attribute-pattern';
export { bindingCommand, type ICommandBuildInfo, BindingCommand, type BindingCommandInstance, BindingCommandDefinition, type BindingCommandKind, type BindingCommandType, CommandType, DefaultBindingCommand, ForBindingCommand, FromViewBindingCommand, OneTimeBindingCommand, ToViewBindingCommand, TwoWayBindingCommand, TriggerBindingCommand, CaptureBindingCommand, AttrBindingCommand, ClassBindingCommand, StyleBindingCommand, } from './resources/binding-command';
export { bindingCommand, type ICommandBuildInfo, BindingCommand, type BindingCommandInstance, BindingCommandDefinition, type BindingCommandKind, type BindingCommandType, type CommandType, DefaultBindingCommand, ForBindingCommand, FromViewBindingCommand, OneTimeBindingCommand, ToViewBindingCommand, TwoWayBindingCommand, TriggerBindingCommand, CaptureBindingCommand, AttrBindingCommand, ClassBindingCommand, StyleBindingCommand, } from './resources/binding-command';
export { IAttrMapper, type IsTwoWayPredicate, } from './compiler/attribute-mapper';

@@ -45,3 +45,3 @@ export { BindingMode, type IBindingController, } from './binding/interfaces-bindings';

export { AuSlot, } from './resources/custom-elements/au-slot';
export { DefinitionType, } from './resources/resources-shared';
export type { DefinitionType, } from './resources/resources-shared';
export { capture, containerless, customElement, CustomElement, type CustomElementDecorator, type CustomElementKind, type CustomElementType, CustomElementDefinition, type PartialCustomElementDefinition, useShadowDOM, processContent, } from './resources/custom-element';

@@ -56,3 +56,3 @@ export { AuCompose, type IDynamicComponentActivate, } from './resources/custom-elements/au-compose';

export { type PartialChildrenDefinition, children, ChildrenBinding, } from './templating/children';
export { Controller, isCustomElementController, isCustomElementViewModel, ViewModelKind, State, type ControllerVisitor, type IViewModel, IController, type IComponentController, type IContextualCustomElementController, type IControllerElementHydrationInstruction, type IHydratableController, IHydrationContext, type IDryCustomElementController, type ICustomAttributeController, type IHydratedController, type IHydratedComponentController, type IHydratedParentController, type ICompiledCustomElementController, type ICustomElementController, type ICustomElementViewModel, type ICustomAttributeViewModel, type IHydratedCustomElementViewModel, type IHydratedCustomAttributeViewModel, type ISyntheticView, } from './templating/controller';
export { Controller, isCustomElementController, isCustomElementViewModel, type ViewModelKind, State, type ControllerVisitor, type IViewModel, IController, type IComponentController, type IContextualCustomElementController, type IControllerElementHydrationInstruction, type IHydratableController, IHydrationContext, type IDryCustomElementController, type ICustomAttributeController, type IHydratedController, type IHydratedComponentController, type IHydratedParentController, type ICompiledCustomElementController, type ICustomElementController, type ICustomElementViewModel, type ICustomAttributeViewModel, type IHydratedCustomElementViewModel, type IHydratedCustomAttributeViewModel, type ISyntheticView, } from './templating/controller';
export { type IAuSlotProjections, type IAuSlot, type IAuSlotSubscriber, IAuSlotWatcher, IAuSlotsInfo, type PartialSlottedDefinition, AuSlotsInfo, slotted, } from './templating/controller.projection';

@@ -59,0 +59,0 @@ export { ILifecycleHooks, LifecycleHooksEntry, LifecycleHooksDefinition, type LifecycleHooksLookup, type LifecycleHook, LifecycleHooks, lifecycleHooks, } from './templating/lifecycle-hooks';

@@ -1,3 +0,2 @@

import { AccessorType } from '@aurelia/runtime';
import type { IAccessor } from '@aurelia/runtime';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
/**

@@ -4,0 +3,0 @@ * Attribute accessor in a XML document/element that can be accessed via a namespace.

@@ -1,2 +0,2 @@

import { SetterObserver, AccessorType, type ISubscriberCollection, type IObserverLocator } from '@aurelia/runtime';
import { SetterObserver, type AccessorType, type ISubscriberCollection, type IObserverLocator } from '@aurelia/runtime';
import { INodeObserver, INodeObserverConfigBase } from './observer-locator';

@@ -3,0 +3,0 @@ import type { INode } from '../dom';

@@ -1,3 +0,2 @@

import { AccessorType } from '@aurelia/runtime';
import type { IAccessor } from '@aurelia/runtime';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
export declare class ClassAttributeAccessor implements IAccessor {

@@ -4,0 +3,0 @@ readonly obj: HTMLElement;

@@ -1,3 +0,3 @@

import { AccessorType, IObserver } from '@aurelia/runtime';
import type { IAccessor } from '@aurelia/runtime';
import { IObserver } from '@aurelia/runtime';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
/**

@@ -4,0 +4,0 @@ * Attribute accessor for HTML elements.

@@ -1,2 +0,2 @@

import { AccessorType, type IObserverLocator, type ISubscriberCollection } from '@aurelia/runtime';
import { type AccessorType, type IObserverLocator, type ISubscriberCollection } from '@aurelia/runtime';
import type { INode } from '../dom';

@@ -3,0 +3,0 @@ import { INodeObserver, INodeObserverConfigBase } from './observer-locator';

@@ -1,3 +0,2 @@

import { AccessorType } from '@aurelia/runtime';
import type { IAccessor } from '@aurelia/runtime';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
export declare class StyleAttributeAccessor implements IAccessor {

@@ -4,0 +3,0 @@ readonly obj: HTMLElement;

@@ -1,3 +0,2 @@

import { AccessorType } from '@aurelia/runtime';
import type { ISubscriberCollection } from '@aurelia/runtime';
import type { AccessorType, ISubscriberCollection } from '@aurelia/runtime';
import type { INode } from '../dom';

@@ -4,0 +3,0 @@ import type { INodeObserver, INodeObserverConfigBase } from './observer-locator';

import { type IContainer, type Class, type IRegistry } from '@aurelia/kernel';
import { IExpressionParser, IObserverLocator, type Interpolation, type IsBindingBehavior, type ForOfStatement } from '@aurelia/runtime';
import { BindingMode } from './binding/interfaces-bindings';
import { type BindingMode } from './binding/interfaces-bindings';
import { CustomElementDefinition } from './resources/custom-element';

@@ -13,24 +13,25 @@ import { CustomAttributeDefinition } from './resources/custom-attribute';

import type { PartialCustomElementDefinition } from './resources/custom-element';
export declare const enum InstructionType {
hydrateElement = "ra",
hydrateAttribute = "rb",
hydrateTemplateController = "rc",
hydrateLetElement = "rd",
setProperty = "re",
interpolation = "rf",
propertyBinding = "rg",
letBinding = "ri",
refBinding = "rj",
iteratorBinding = "rk",
multiAttr = "rl",
textBinding = "ha",
listenerBinding = "hb",
attributeBinding = "hc",
stylePropertyBinding = "hd",
setAttribute = "he",
setClassAttribute = "hf",
setStyleAttribute = "hg",
spreadBinding = "hs",
spreadElementProp = "hp"
}
export declare const InstructionType: Readonly<{
hydrateElement: "ra";
hydrateAttribute: "rb";
hydrateTemplateController: "rc";
hydrateLetElement: "rd";
setProperty: "re";
interpolation: "rf";
propertyBinding: "rg";
letBinding: "ri";
refBinding: "rj";
iteratorBinding: "rk";
multiAttr: "rl";
textBinding: "ha";
listenerBinding: "hb";
attributeBinding: "hc";
stylePropertyBinding: "hd";
setAttribute: "he";
setClassAttribute: "hf";
setStyleAttribute: "hg";
spreadBinding: "hs";
spreadElementProp: "hp";
}>;
export type InstructionType = typeof InstructionType[keyof typeof InstructionType];
export type InstructionTypeName = string;

@@ -45,3 +46,3 @@ export interface IInstruction {

to: string;
readonly type = InstructionType.interpolation;
readonly type = "rf";
constructor(from: string | Interpolation, to: string);

@@ -53,3 +54,3 @@ }

mode: BindingMode;
readonly type = InstructionType.propertyBinding;
readonly type = "rg";
constructor(from: string | IsBindingBehavior, to: string, mode: BindingMode);

@@ -61,3 +62,3 @@ }

props: MultiAttrInstruction[];
readonly type = InstructionType.iteratorBinding;
readonly type = "rk";
constructor(forOf: string | ForOfStatement, to: string, props: MultiAttrInstruction[]);

@@ -68,3 +69,3 @@ }

readonly to: string;
readonly type = InstructionType.refBinding;
readonly type = "rj";
constructor(from: string | IsBindingBehavior, to: string);

@@ -75,3 +76,3 @@ }

to: string;
readonly type = InstructionType.setProperty;
readonly type = "re";
constructor(value: unknown, to: string);

@@ -83,3 +84,3 @@ }

command: string | null;
readonly type = InstructionType.multiAttr;
readonly type = "rl";
constructor(value: string, to: string, command: string | null);

@@ -109,3 +110,3 @@ }

captures: AttrSyntax[] | undefined;
readonly type = InstructionType.hydrateElement;
readonly type = "ra";
/**

@@ -147,3 +148,3 @@ * A special property that can be used to store <au-slot/> usage information

props: IInstruction[];
readonly type = InstructionType.hydrateAttribute;
readonly type = "rb";
constructor(res: string | /* Constructable | */ CustomAttributeDefinition, alias: string | undefined,

@@ -163,3 +164,3 @@ /**

props: IInstruction[];
readonly type = InstructionType.hydrateTemplateController;
readonly type = "rc";
constructor(def: PartialCustomElementDefinition, res: string | /* Constructable | */ CustomAttributeDefinition, alias: string | undefined,

@@ -174,3 +175,3 @@ /**

toBindingContext: boolean;
readonly type = InstructionType.hydrateLetElement;
readonly type = "rd";
constructor(instructions: LetBindingInstruction[], toBindingContext: boolean);

@@ -181,3 +182,3 @@ }

to: string;
readonly type = InstructionType.letBinding;
readonly type = "ri";
constructor(from: string | IsBindingBehavior | Interpolation, to: string);

@@ -187,3 +188,3 @@ }

from: string | IsBindingBehavior;
readonly type = InstructionType.textBinding;
readonly type = "ha";
constructor(from: string | IsBindingBehavior);

@@ -196,3 +197,3 @@ }

capture: boolean;
readonly type = InstructionType.listenerBinding;
readonly type = "hb";
constructor(from: string | IsBindingBehavior, to: string, preventDefault: boolean, capture: boolean);

@@ -203,3 +204,3 @@ }

to: string;
readonly type = InstructionType.stylePropertyBinding;
readonly type = "hd";
constructor(from: string | IsBindingBehavior, to: string);

@@ -210,3 +211,3 @@ }

to: string;
readonly type = InstructionType.setAttribute;
readonly type = "he";
constructor(value: string, to: string);

@@ -216,3 +217,3 @@ }

readonly value: string;
readonly type: InstructionType.setClassAttribute;
readonly type: typeof InstructionType.setClassAttribute;
constructor(value: string);

@@ -222,3 +223,3 @@ }

readonly value: string;
readonly type: InstructionType.setStyleAttribute;
readonly type: typeof InstructionType.setStyleAttribute;
constructor(value: string);

@@ -236,3 +237,3 @@ }

to: string;
readonly type = InstructionType.attributeBinding;
readonly type = "hc";
constructor(

@@ -248,7 +249,7 @@ /**

export declare class SpreadBindingInstruction {
readonly type = InstructionType.spreadBinding;
readonly type = "hs";
}
export declare class SpreadElementPropBindingInstruction {
readonly instructions: IInstruction;
readonly type = InstructionType.spreadElementProp;
readonly type = "hp";
constructor(instructions: IInstruction);

@@ -314,11 +315,11 @@ }

export declare class SetPropertyRenderer implements IRenderer {
target: InstructionType.setProperty;
target: typeof InstructionType.setProperty;
render(renderingCtrl: IHydratableController, target: IController, instruction: SetPropertyInstruction): void;
}
export declare class CustomElementRenderer implements IRenderer {
target: InstructionType.hydrateElement;
target: typeof InstructionType.hydrateElement;
render(renderingCtrl: IHydratableController, target: HTMLElement, instruction: HydrateElementInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class CustomAttributeRenderer implements IRenderer {
target: InstructionType.hydrateAttribute;
target: typeof InstructionType.hydrateAttribute;
render(

@@ -331,55 +332,55 @@ /**

export declare class TemplateControllerRenderer implements IRenderer {
target: InstructionType.hydrateTemplateController;
target: typeof InstructionType.hydrateTemplateController;
render(renderingCtrl: IHydratableController, target: HTMLElement, instruction: HydrateTemplateController, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class LetElementRenderer implements IRenderer {
target: InstructionType.hydrateLetElement;
target: typeof InstructionType.hydrateLetElement;
render(renderingCtrl: IHydratableController, target: Node & ChildNode, instruction: HydrateLetElementInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class RefBindingRenderer implements IRenderer {
target: InstructionType.refBinding;
target: typeof InstructionType.refBinding;
render(renderingCtrl: IHydratableController, target: INode, instruction: RefBindingInstruction, platform: IPlatform, exprParser: IExpressionParser): void;
}
export declare class InterpolationBindingRenderer implements IRenderer {
target: InstructionType.interpolation;
target: typeof InstructionType.interpolation;
render(renderingCtrl: IHydratableController, target: IController, instruction: InterpolationInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class PropertyBindingRenderer implements IRenderer {
target: InstructionType.propertyBinding;
target: typeof InstructionType.propertyBinding;
render(renderingCtrl: IHydratableController, target: IController, instruction: PropertyBindingInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class IteratorBindingRenderer implements IRenderer {
target: InstructionType.iteratorBinding;
target: typeof InstructionType.iteratorBinding;
render(renderingCtrl: IHydratableController, target: IController, instruction: IteratorBindingInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class TextBindingRenderer implements IRenderer {
target: InstructionType.textBinding;
target: typeof InstructionType.textBinding;
render(renderingCtrl: IHydratableController, target: ChildNode, instruction: TextBindingInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class ListenerBindingRenderer implements IRenderer {
target: InstructionType.listenerBinding;
target: typeof InstructionType.listenerBinding;
render(renderingCtrl: IHydratableController, target: HTMLElement, instruction: ListenerBindingInstruction, platform: IPlatform, exprParser: IExpressionParser): void;
}
export declare class SetAttributeRenderer implements IRenderer {
target: InstructionType.setAttribute;
target: typeof InstructionType.setAttribute;
render(_: IHydratableController, target: HTMLElement, instruction: SetAttributeInstruction): void;
}
export declare class SetClassAttributeRenderer implements IRenderer {
target: InstructionType.setClassAttribute;
target: typeof InstructionType.setClassAttribute;
render(_: IHydratableController, target: HTMLElement, instruction: SetClassAttributeInstruction): void;
}
export declare class SetStyleAttributeRenderer implements IRenderer {
target: InstructionType.setStyleAttribute;
target: typeof InstructionType.setStyleAttribute;
render(_: IHydratableController, target: HTMLElement, instruction: SetStyleAttributeInstruction): void;
}
export declare class StylePropertyBindingRenderer implements IRenderer {
target: InstructionType.stylePropertyBinding;
target: typeof InstructionType.stylePropertyBinding;
render(renderingCtrl: IHydratableController, target: HTMLElement, instruction: StylePropertyBindingInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class AttributeBindingRenderer implements IRenderer {
target: InstructionType.attributeBinding;
target: typeof InstructionType.attributeBinding;
render(renderingCtrl: IHydratableController, target: HTMLElement, instruction: AttributeBindingInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;
}
export declare class SpreadRenderer implements IRenderer {
readonly target: InstructionType.spreadBinding;
readonly target: typeof InstructionType.spreadBinding;
render(renderingCtrl: IHydratableController, target: HTMLElement, _instruction: SpreadBindingInstruction, platform: IPlatform, exprParser: IExpressionParser, observerLocator: IObserverLocator): void;

@@ -386,0 +387,0 @@ }

import { BindingBehaviorInstance, IBinding } from '@aurelia/runtime';
import { BindingMode } from '../../binding/interfaces-bindings';
import { type BindingMode } from '../../binding/interfaces-bindings';
import type { Scope } from '@aurelia/runtime';

@@ -14,13 +14,13 @@ export declare abstract class BindingModeBehavior implements BindingBehaviorInstance {

export declare class OneTimeBindingBehavior extends BindingModeBehavior {
get mode(): BindingMode;
get mode(): typeof BindingMode.oneTime;
}
export declare class ToViewBindingBehavior extends BindingModeBehavior {
get mode(): BindingMode;
get mode(): typeof BindingMode.toView;
}
export declare class FromViewBindingBehavior extends BindingModeBehavior {
get mode(): BindingMode;
get mode(): typeof BindingMode.fromView;
}
export declare class TwoWayBindingBehavior extends BindingModeBehavior {
get mode(): BindingMode;
get mode(): typeof BindingMode.twoWay;
}
//# sourceMappingURL=binding-mode.d.ts.map

@@ -10,9 +10,10 @@ import { IExpressionParser } from '@aurelia/runtime';

import type { CustomElementDefinition } from './custom-element';
export declare const ctNone: "None";
export declare const ctIgnoreAttr: "IgnoreAttr";
/**
* Characteristics of a binding command.
* - `None`: The normal process (check custom attribute -> check bindable -> command.build()) should take place.
* - `IgnoreAttr`: The binding command wants to take over the processing of an attribute. The template compiler keeps the attribute as is in compilation, instead of executing the normal process.
*/
export declare const enum CommandType {
None = 0,
IgnoreAttr = 1
}
export type CommandType = typeof ctNone | typeof ctIgnoreAttr;
export type PartialBindingCommandDefinition = PartialResourceDefinition<{

@@ -60,23 +61,23 @@ readonly type?: string | null;

export declare class OneTimeBindingCommand implements BindingCommandInstance {
get type(): CommandType.None;
get type(): 'None';
build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction;
}
export declare class ToViewBindingCommand implements BindingCommandInstance {
get type(): CommandType.None;
get type(): 'None';
build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction;
}
export declare class FromViewBindingCommand implements BindingCommandInstance {
get type(): CommandType.None;
get type(): 'None';
build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction;
}
export declare class TwoWayBindingCommand implements BindingCommandInstance {
get type(): CommandType.None;
get type(): 'None';
build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction;
}
export declare class DefaultBindingCommand implements BindingCommandInstance {
get type(): CommandType.None;
get type(): 'None';
build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction;
}
export declare class ForBindingCommand implements BindingCommandInstance {
get type(): CommandType.None;
get type(): 'None';
static get inject(): unknown[];

@@ -87,7 +88,7 @@ constructor(attrParser: IAttributeParser);

export declare class TriggerBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction;
}
export declare class CaptureBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction;

@@ -99,3 +100,3 @@ }

export declare class AttrBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction;

@@ -107,3 +108,3 @@ }

export declare class StyleBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction;

@@ -115,3 +116,3 @@ }

export declare class ClassBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction;

@@ -123,9 +124,9 @@ }

export declare class RefBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction;
}
export declare class SpreadBindingCommand implements BindingCommandInstance {
get type(): CommandType.IgnoreAttr;
get type(): 'IgnoreAttr';
build(_info: ICommandBuildInfo): IInstruction;
}
//# sourceMappingURL=binding-command.d.ts.map
import { Key } from '@aurelia/kernel';
import { DefinitionType } from './resources-shared';
import { BindingMode } from '../binding/interfaces-bindings';
import { type BindingMode } from '../binding/interfaces-bindings';
import type { Constructable, IContainer, IResourceKind, ResourceDefinition, PartialResourceDefinition, ResourceType } from '@aurelia/kernel';

@@ -72,3 +71,3 @@ import type { BindableDefinition, PartialBindableDefinition } from '../bindable';

readonly dependencies: Key[];
get type(): DefinitionType.Attribute;
get type(): 'Attribute';
private constructor();

@@ -75,0 +74,0 @@ static create<T extends Constructable = Constructable>(nameOrDef: string | PartialCustomAttributeDefinition, Type: CustomAttributeType<T>): CustomAttributeDefinition<T>;

@@ -1,2 +0,1 @@

import { DefinitionType } from './resources-shared';
import type { Constructable, IContainer, IResourceKind, ResourceType, PartialResourceDefinition, Key, ResourceDefinition, Injectable } from '@aurelia/kernel';

@@ -153,3 +152,3 @@ import type { BindableDefinition, PartialBindableDefinition } from '../bindable';

readonly processContent: ProcessContentHook | null;
get type(): DefinitionType.Element;
get type(): 'Element';
private constructor();

@@ -156,0 +155,0 @@ static create(def: PartialCustomElementDefinition, Type?: null): CustomElementDefinition;

@@ -1,5 +0,4 @@

export declare const enum DefinitionType {
Element = 1,
Attribute = 2
}
export declare const dtElement: "Element";
export declare const dtAttribute: "Attribute";
export type DefinitionType = typeof dtElement | typeof dtAttribute;
//# sourceMappingURL=resources-shared.d.ts.map

@@ -1,2 +0,2 @@

import { Scope } from '@aurelia/runtime';
import { type Scope } from '@aurelia/runtime';
import type { ICustomAttributeController, ICustomAttributeViewModel, IHydratedController, IHydratedParentController, IHydratableController, ISyntheticView, ControllerVisitor } from '../../templating/controller';

@@ -3,0 +3,0 @@ import type { INode } from '../../dom';

@@ -14,8 +14,2 @@ import { Scope, ICoercionConfiguration } from '@aurelia/runtime';

type BindingContext<C extends IViewModel> = Required<ICompileHooks> & Required<IActivationHooks<IHydratedController | null>> & C;
export declare const enum MountTarget {
none = 0,
host = 1,
shadowRoot = 2,
location = 3
}
export declare class Controller<C extends IViewModel = IViewModel> implements IController<C> {

@@ -141,7 +135,6 @@ container: IContainer;

export declare function isCustomElementViewModel(value: unknown): value is ICustomElementViewModel;
export declare const enum ViewModelKind {
customElement = 0,
customAttribute = 1,
synthetic = 2
}
declare const vmkCe: "customElement";
export declare const vmkCa: "customAttribute";
declare const vmkSynth: "synthetic";
export type ViewModelKind = typeof vmkCe | typeof vmkCa | typeof vmkSynth;
/**

@@ -211,3 +204,3 @@ * A controller that is ready for activation. It can be `ISyntheticView`, `ICustomElementController` or `ICustomAttributeController`.

export interface IComponentController<C extends IViewModel = IViewModel> extends IController<C> {
readonly vmKind: ViewModelKind.customAttribute | ViewModelKind.customElement;
readonly vmKind: 'customAttribute' | 'customElement';
readonly definition: CustomElementDefinition | CustomAttributeDefinition;

@@ -231,3 +224,3 @@ /**

export interface IHydratableController<C extends IViewModel = IViewModel> extends IController<C> {
readonly vmKind: ViewModelKind.customElement | ViewModelKind.synthetic;
readonly vmKind: 'customElement' | 'synthetic';
readonly mountTarget: MountTarget;

@@ -238,11 +231,12 @@ readonly definition: CustomElementDefinition | null;

}
export declare const enum State {
none = 0,
activating = 1,
activated = 2,
deactivating = 4,
deactivated = 8,
released = 16,
disposed = 32
}
export declare const State: Readonly<{
none: 0;
activating: 1;
activated: 2;
deactivating: 4;
deactivated: 8;
released: 16;
disposed: 32;
}>;
export type State = typeof State[keyof typeof State];
export declare function stringifyState(state: State): string;

@@ -257,3 +251,3 @@ /**

export interface ISyntheticView extends IHydratableController {
readonly vmKind: ViewModelKind.synthetic;
readonly vmKind: 'synthetic';
readonly definition: null;

@@ -315,3 +309,3 @@ readonly viewModel: null;

export interface ICustomAttributeController<C extends ICustomAttributeViewModel = ICustomAttributeViewModel> extends IComponentController<C> {
readonly vmKind: ViewModelKind.customAttribute;
readonly vmKind: 'customAttribute';
readonly definition: CustomAttributeDefinition;

@@ -342,3 +336,3 @@ /**

export interface IDryCustomElementController<C extends IViewModel = IViewModel> extends IComponentController<C>, IHydratableController<C> {
readonly vmKind: ViewModelKind.customElement;
readonly vmKind: 'customElement';
readonly definition: CustomElementDefinition;

@@ -345,0 +339,0 @@ /**

@@ -1,3 +0,3 @@

import { type IResolver, type Key, type Constructable, type IContainer, type IResourceKind, type ResourceDefinition, type IAllResolver, IOptionalResolver } from '@aurelia/kernel';
export declare const resource: <T extends Key>(key: T) => IResolver<T> & ((...args: unknown[]) => any);
import { type Key, type Constructable, type IContainer, type IResourceKind, type ResourceDefinition, type IAllResolver, IOptionalResolver } from '@aurelia/kernel';
export declare const resource: <T extends Key>(key: T) => import("@aurelia/kernel/dist/types/di").ICallableResolver<Key>;
export declare const optionalResource: <T extends Key>(key: T) => IOptionalResolver<T>;

@@ -4,0 +4,0 @@ /**

{
"name": "@aurelia/runtime-html",
"version": "2.0.1-dev.202312121308",
"version": "2.0.1-dev.202401261010",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"exports": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.cjs",
"import": "./dist/esm/index.mjs",
"development": "./dist/esm/index.dev.mjs"
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.cjs",
"import": "./dist/esm/index.mjs",
"development": "./dist/esm/index.dev.mjs"
},
"./development": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.dev.cjs",
"import": "./dist/esm/index.dev.mjs"
}
},

@@ -49,7 +56,7 @@ "types": "dist/types/index.d.ts",

"dependencies": {
"@aurelia/kernel": "2.0.1-dev.202312121308",
"@aurelia/metadata": "2.0.1-dev.202312121308",
"@aurelia/platform": "2.0.1-dev.202312121308",
"@aurelia/platform-browser": "2.0.1-dev.202312121308",
"@aurelia/runtime": "2.0.1-dev.202312121308"
"@aurelia/kernel": "2.0.1-dev.202401261010",
"@aurelia/metadata": "2.0.1-dev.202401261010",
"@aurelia/platform": "2.0.1-dev.202401261010",
"@aurelia/platform-browser": "2.0.1-dev.202401261010",
"@aurelia/runtime": "2.0.1-dev.202401261010"
},

@@ -56,0 +63,0 @@ "devDependencies": {

import { kebabCase, getPrototypeChain, noop, Class } from '@aurelia/kernel';
import { ICoercionConfiguration } from '@aurelia/runtime';
import { Metadata } from '@aurelia/metadata';
import { BindingMode } from './binding/interfaces-bindings';
import { toView, type BindingMode, twoWay } from './binding/interfaces-bindings';
import { appendAnnotationKey, defineMetadata, getAllAnnotations, getAnnotationKeyFor, getOwnMetadata } from './utilities-metadata';

@@ -163,3 +163,3 @@ import { isString, objectFreeze, objectKeys } from './utilities';

def.callback ?? `${prop}Changed`,
def.mode ?? BindingMode.toView,
def.mode ?? toView,
def.primary ?? false,

@@ -191,3 +191,3 @@ def.name ?? prop,

//@bindable({ property: 'prop' })
@bindable({ mode: BindingMode.twoWay })
@bindable({ mode: twoWay })
@bindable({ callback: 'propChanged' })

@@ -199,3 +199,3 @@ @bindable({ attribute: 'prop' })

@bindable({
mode: BindingMode.twoWay,
mode: twoWay,
callback: 'propChanged',

@@ -202,0 +202,0 @@ attribute: 'prop',

@@ -15,5 +15,5 @@ import {

import { State } from '../templating/controller';
import { activating } from '../templating/controller';
import { mixinAstEvaluator, mixinUseScope, mixingBindingLimited } from './binding-utils';
import { BindingMode } from './interfaces-bindings';
import { oneTime, toView } from './interfaces-bindings';

@@ -27,3 +27,3 @@ import type {

import type { INode } from '../dom';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
import { isString, safeString } from '../utilities';

@@ -144,3 +144,3 @@

// should observe?
(this.mode & BindingMode.toView) > 0 ? this : null
(this.mode & toView) > 0 ? this : null
);

@@ -151,3 +151,3 @@ this.obs.clear();

this._value = newValue;
const shouldQueueFlush = this._controller.state !== State.activating;
const shouldQueueFlush = this._controller.state !== activating;
if (shouldQueueFlush) {

@@ -184,5 +184,5 @@ // Queue the new one before canceling the old one, to prevent early yield

if (this.mode & (BindingMode.toView | BindingMode.oneTime)) {
if (this.mode & (toView | oneTime)) {
this.updateTarget(
this._value = astEvaluate(this.ast, _scope, this, /* should connect? */(this.mode & BindingMode.toView) > 0 ? this : null)
this._value = astEvaluate(this.ast, _scope, this, /* should connect? */(this.mode & toView) > 0 ? this : null)
);

@@ -189,0 +189,0 @@ }

import { type IServiceLocator, Key, type Constructable, IDisposable } from '@aurelia/kernel';
import { ITask, TaskStatus } from '@aurelia/platform';
import { ITask } from '@aurelia/platform';
import { astEvaluate, BindingBehaviorInstance, IBinding, IRateLimitOptions, ISignaler, Scope, type ISubscriber, type ValueConverterInstance } from '@aurelia/runtime';
import { BindingBehavior } from '../resources/binding-behavior';
import { ValueConverter } from '../resources/value-converter';
import { addSignalListener, def, defineHiddenProp, removeSignalListener } from '../utilities';
import { addSignalListener, def, defineHiddenProp, removeSignalListener, tsPending } from '../utilities';
import { createInterface, resource } from '../utilities-di';

@@ -216,3 +216,3 @@ import { PropertyBinding } from './property-binding';

// only call callback when there's actually task being queued
isPending = limiterTask?.status === TaskStatus.pending;
isPending = limiterTask?.status === tsPending;
dispose();

@@ -267,3 +267,3 @@ if (isPending) {

// only call callback when there's actually task being queued
isPending = limiterTask?.status === TaskStatus.pending;
isPending = limiterTask?.status === tsPending;
dispose();

@@ -270,0 +270,0 @@ if (isPending) {

@@ -9,4 +9,4 @@ import {

} from '@aurelia/runtime';
import { State } from '../templating/controller';
import { BindingMode } from './interfaces-bindings';
import { activating } from '../templating/controller';
import { toView } from './interfaces-bindings';
import type { IServiceLocator } from '@aurelia/kernel';

@@ -20,3 +20,3 @@ import type { ITask, QueueTaskOptions, TaskQueue } from '@aurelia/platform';

import { isArray, safeString } from '../utilities';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
import { mixinUseScope, mixingBindingLimited, mixinAstEvaluator } from './binding-utils';

@@ -40,3 +40,3 @@

// but it wouldn't matter here, just start with something for later check
public readonly mode: BindingMode = BindingMode.toView;
public readonly mode: BindingMode = toView;

@@ -116,3 +116,3 @@ /** @internal */

// should observe?
(this.mode & BindingMode.toView) > 0 ? this : null
(this.mode & toView) > 0 ? this : null
);

@@ -128,3 +128,3 @@ this.obs.clear();

}
const shouldQueueFlush = this._controller.state !== State.activating;
const shouldQueueFlush = this._controller.state !== activating;
if (shouldQueueFlush) {

@@ -147,3 +147,3 @@ this._queueUpdate(newValue);

this,
(this.mode & BindingMode.toView) > 0 ? this : null
(this.mode & toView) > 0 ? this : null
);

@@ -154,3 +154,3 @@ this.obs.clear();

}
const shouldQueueFlush = this._controller.state !== State.activating;
const shouldQueueFlush = this._controller.state !== activating;
if (shouldQueueFlush) {

@@ -179,3 +179,3 @@ this._queueUpdate(v);

this,
(this.mode & BindingMode.toView) > 0 ? this : null
(this.mode & toView) > 0 ? this : null
);

@@ -182,0 +182,0 @@ if (isArray(v)) {

import { State } from '../templating/controller';
import { objectFreeze } from '../utilities';

@@ -9,15 +10,21 @@ // Note: the oneTime binding now has a non-zero value for 2 reasons:

// This essentially adds extra information which binding could use to do smarter things and allows bindingBehaviors that add a mode instead of simply overwriting it
/** @internal */ export const oneTime = 0b0001;
/** @internal */ export const toView = 0b0010;
/** @internal */ export const fromView = 0b0100;
/** @internal */ export const twoWay = 0b0110;
/** @internal */ export const defaultMode = 0b1000;
/**
* Mode of a binding to operate
*/
export const enum BindingMode {
oneTime = 0b0001,
toView = 0b0010,
fromView = 0b0100,
twoWay = 0b0110,
export const BindingMode = /*@__PURE__*/ objectFreeze({
oneTime,
toView,
fromView,
twoWay,
/**
* Unspecified mode, bindings may act differently with this mode
*/
default = 0b1000
}
default: defaultMode,
} as const);
export type BindingMode = typeof BindingMode[keyof typeof BindingMode];

@@ -24,0 +31,0 @@ export interface IBindingController {

import {
AccessorOrObserver,
AccessorType,
astBind,

@@ -11,5 +10,5 @@ astEvaluate,

} from '@aurelia/runtime';
import { State } from '../templating/controller';
import { activating } from '../templating/controller';
import { mixinAstEvaluator, mixinUseScope, mixingBindingLimited } from './binding-utils';
import { BindingMode } from './interfaces-bindings';
import { toView } from './interfaces-bindings';

@@ -24,4 +23,4 @@ import type { IServiceLocator } from '@aurelia/kernel';

} from '@aurelia/runtime';
import { isArray } from '../utilities';
import type { IBindingController } from './interfaces-bindings';
import { atLayout, isArray } from '../utilities';
import type { BindingMode, IBindingController } from './interfaces-bindings';

@@ -118,3 +117,3 @@ const queueTaskOptions: QueueTaskOptions = {

// (2). if not, then fix tests to reflect the changes/platform to properly yield all with aurelia.start()
const shouldQueueFlush = this._controller.state !== State.activating && (targetObserver.type & AccessorType.Layout) > 0;
const shouldQueueFlush = this._controller.state !== activating && (targetObserver.type & atLayout) > 0;
let task: ITask | null;

@@ -181,3 +180,3 @@ if (shouldQueueFlush) {

// but it wouldn't matter here, just start with something for later check
public readonly mode: BindingMode = BindingMode.toView;
public readonly mode: BindingMode = toView;
public _scope?: Scope;

@@ -229,3 +228,3 @@ public task: ITask | null = null;

// should observe?
(this.mode & BindingMode.toView) > 0 ? this : null
(this.mode & toView) > 0 ? this : null
);

@@ -264,3 +263,3 @@ this.obs.clear();

this,
(this.mode & BindingMode.toView) > 0 ? this : null,
(this.mode & toView) > 0 ? this : null,
);

@@ -267,0 +266,0 @@ if (isArray(this._value)) {

@@ -1,5 +0,5 @@

import { AccessorType, astAssign, astBind, astEvaluate, astUnbind, connectable, IAstEvaluator, IBinding, IConnectableBinding, ISubscriber } from '@aurelia/runtime';
import { State } from '../templating/controller';
import { astAssign, astBind, astEvaluate, astUnbind, connectable, IAstEvaluator, IBinding, IConnectableBinding, ISubscriber } from '@aurelia/runtime';
import { activating } from '../templating/controller';
import { BindingTargetSubscriber, IFlushQueue, mixinAstEvaluator, mixinUseScope, mixingBindingLimited } from './binding-utils';
import { BindingMode } from './interfaces-bindings';
import { fromView, oneTime, toView } from './interfaces-bindings';

@@ -16,4 +16,5 @@ import type { IServiceLocator } from '@aurelia/kernel';

} from '@aurelia/runtime';
import type { IBindingController } from './interfaces-bindings';
import type { BindingMode, IBindingController } from './interfaces-bindings';
import { createMappedError, ErrorNames } from '../errors';
import { atLayout } from '../utilities';

@@ -93,7 +94,7 @@ export interface PropertyBinding extends IAstEvaluator, IConnectableBinding {}

// should observe?
(this.mode & BindingMode.toView) > 0 ? this : null
(this.mode & toView) > 0 ? this : null
);
this.obs.clear();
const shouldQueueFlush = this._controller.state !== State.activating && (this._targetObserver!.type & AccessorType.Layout) > 0;
const shouldQueueFlush = this._controller.state !== activating && (this._targetObserver!.type & atLayout) > 0;
if (shouldQueueFlush) {

@@ -134,3 +135,3 @@ // Queue the new one before canceling the old one, to prevent early yield

if (!targetObserver) {
if ($mode & BindingMode.fromView) {
if ($mode & fromView) {
targetObserver = observerLocator.getObserver(this.target, this.targetProperty);

@@ -143,5 +144,5 @@ } else {

const shouldConnect = ($mode & BindingMode.toView) > 0;
const shouldConnect = ($mode & toView) > 0;
if ($mode & (BindingMode.toView | BindingMode.oneTime)) {
if ($mode & (toView | oneTime)) {
this.updateTarget(

@@ -152,3 +153,3 @@ astEvaluate(this.ast, this._scope, this, shouldConnect ? this : null),

if ($mode & BindingMode.fromView) {
if ($mode & fromView) {
(targetObserver as IObserver).subscribe(this._targetSubscriber ??= new BindingTargetSubscriber(this, this.l.get(IFlushQueue)));

@@ -206,3 +207,3 @@ if (!shouldConnect) {

mixinUseScope(PropertyBinding);
mixingBindingLimited(PropertyBinding, (propBinding: PropertyBinding) => (propBinding.mode & BindingMode.fromView) ? 'updateSource' : 'updateTarget');
mixingBindingLimited(PropertyBinding, (propBinding: PropertyBinding) => (propBinding.mode & fromView) ? 'updateSource' : 'updateTarget');
connectable(PropertyBinding);

@@ -209,0 +210,0 @@ mixinAstEvaluator(true, false)(PropertyBinding);

@@ -5,4 +5,4 @@ import { IServiceLocator, Key, emptyArray } from '@aurelia/kernel';

import { CustomElementDefinition, findElementControllerFor } from '../resources/custom-element';
import { ICustomElementController, IHydrationContext, IController, ViewModelKind, IHydratableController } from '../templating/controller';
import { IHasController, IInstruction, ITemplateCompiler, InstructionType, SpreadElementPropBindingInstruction } from '../renderer';
import { ICustomElementController, IHydrationContext, IController, IHydratableController, vmkCa } from '../templating/controller';
import { IHasController, IInstruction, ITemplateCompiler, spreadBinding as $spreadBinding, SpreadElementPropBindingInstruction, spreadElementProp } from '../renderer';
import { IRendering } from '../templating/rendering';

@@ -64,6 +64,6 @@ import { IPlatform } from '../platform';

switch (inst.type) {
case InstructionType.spreadBinding:
case $spreadBinding:
renderSpreadInstruction(ancestor + 1);
break;
case InstructionType.spreadElementProp:
case spreadElementProp:
renderers[(inst as SpreadElementPropBindingInstruction).instructions.type].render(

@@ -143,3 +143,3 @@ spreadBinding,

public addChild(controller: IController) {
if (controller.vmKind !== ViewModelKind.customAttribute) {
if (controller.vmKind !== vmkCa) {
throw createMappedError(ErrorNames.no_spread_template_controller);

@@ -146,0 +146,0 @@ }

@@ -39,3 +39,3 @@ import { resolve } from '@aurelia/kernel';

// return the whole template that wraps it/them (and create a new one for the next input)
if (node == null || node.nodeName !== 'TEMPLATE' || node.nextElementSibling != null) {
if (needsWrapping(node)) {
this._template = this.t();

@@ -46,3 +46,3 @@ result = template;

// and clean up the template for the next input
template.content.removeChild(node);
template.content.removeChild(node!);
result = node as HTMLTemplateElement;

@@ -66,3 +66,38 @@ }

return input.cloneNode(true) as HTMLTemplateElement;
function needsWrapping(node: Element | null | undefined): boolean {
if (node == null) return true;
if (node.nodeName !== 'TEMPLATE') return true;
// At this point the node is a template element.
// If the template has meaningful siblings, then it needs wrapping.
// low-hanging fruit: check the next element sibling
const nextElementSibling = node.nextElementSibling;
if (nextElementSibling != null) return true;
// check the previous sibling
const prevSibling = node.previousSibling;
if (prevSibling != null) {
switch (prevSibling.nodeType) {
// The previous sibling cannot be an element, because the node is the first element in the template.
case 3: // Text
return prevSibling.textContent!.trim().length > 0;
}
}
// the previous sibling was not meaningful, so check the next sibling
const nextSibling = node.nextSibling;
if (nextSibling != null) {
switch (nextSibling.nodeType) {
// element is already checked above
case 3: // Text
return nextSibling.textContent!.trim().length > 0;
}
}
// neither the previous nor the next sibling was meaningful, hence the template does not need wrapping
return false;
}
}
}

@@ -75,3 +75,3 @@ export {

type BindingCommandType,
CommandType,
type CommandType,
DefaultBindingCommand,

@@ -271,3 +271,3 @@ ForBindingCommand,

} from './resources/custom-elements/au-slot';
export {
export type {
DefinitionType,

@@ -351,3 +351,3 @@ } from './resources/resources-shared';

isCustomElementViewModel,
ViewModelKind,
type ViewModelKind,
State,

@@ -354,0 +354,0 @@ type ControllerVisitor,

@@ -1,5 +0,4 @@

import { AccessorType } from '@aurelia/runtime';
import { createLookup } from '../utilities';
import { atLayout, atNode, createLookup } from '../utilities';
import type { IAccessor } from '@aurelia/runtime';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
import { mixinNoopSubscribable } from './observation-utils';

@@ -21,3 +20,3 @@

// but for simplicity, always treat as such
public type: AccessorType = AccessorType.Node | AccessorType.Layout;
public type: AccessorType = (atNode | atLayout) as AccessorType;

@@ -24,0 +23,0 @@ public constructor(

@@ -5,3 +5,3 @@ import {

subscriberCollection,
AccessorType,
type AccessorType,
type ICollectionObserver,

@@ -12,3 +12,3 @@ type ISubscriberCollection,

import { getCollectionObserver, INodeObserver, INodeObserverConfigBase } from './observer-locator';
import { hasOwnProperty, isArray } from '../utilities';
import { atLayout, atNode, atObserver, hasOwnProperty, isArray } from '../utilities';

@@ -36,3 +36,3 @@ import type { INode } from '../dom';

export class CheckedObserver implements INodeObserver {
public type: AccessorType = AccessorType.Node | AccessorType.Observer | AccessorType.Layout;
public type: AccessorType = (atNode | atObserver | atLayout) as AccessorType;

@@ -39,0 +39,0 @@ /** @internal */

import { emptyArray } from '@aurelia/kernel';
import { AccessorType } from '@aurelia/runtime';
import { isString } from '../utilities';
import { atLayout, atNode, isString } from '../utilities';
import type { IAccessor } from '@aurelia/runtime';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
import { mixinNoopSubscribable } from './observation-utils';

@@ -10,3 +9,3 @@

public get doNotCache(): true { return true; }
public type: AccessorType = AccessorType.Node | AccessorType.Layout;
public type: AccessorType = (atNode | atLayout) as AccessorType;

@@ -13,0 +12,0 @@ /** @internal */

@@ -1,6 +0,7 @@

import { AccessorType, IObserver } from '@aurelia/runtime';
import { IObserver } from '@aurelia/runtime';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { IAccessor, PropertyAccessor } from '@aurelia/runtime';
import type { AccessorType, IAccessor, PropertyAccessor } from '@aurelia/runtime';
import { mixinNoopSubscribable } from './observation-utils';
import { atLayout, atNode } from '../utilities';

@@ -17,3 +18,3 @@ /**

// but for simplicity, always treat as such
public type: AccessorType = AccessorType.Node | AccessorType.Layout;
public type: AccessorType = (atNode | atLayout) as AccessorType;

@@ -20,0 +21,0 @@ // the followings come from the noop mixing

import { emptyObject, IServiceLocator, resolve } from '@aurelia/kernel';
import {
AccessorType,
getObserverLookup,

@@ -20,7 +19,7 @@ IDirtyChecker,

import { ValueAttributeObserver } from './value-attribute-observer';
import { createLookup, isDataAttribute, isString, objectAssign } from '../utilities';
import { atLayout, atNode, createLookup, isDataAttribute, isString, objectAssign } from '../utilities';
import { aliasRegistration, singletonRegistration } from '../utilities-di';
import type { IIndexable, IContainer } from '@aurelia/kernel';
import type { IAccessor, IObserver, ICollectionObserver, CollectionKind } from '@aurelia/runtime';
import type { AccessorType, IAccessor, IObserver, ICollectionObserver, CollectionKind } from '@aurelia/runtime';
import type { INode } from '../dom';

@@ -56,3 +55,3 @@ import { createMappedError, ErrorNames } from '../errors';

const elementPropertyAccessor = new PropertyAccessor();
elementPropertyAccessor.type = AccessorType.Node | AccessorType.Layout;
elementPropertyAccessor.type = (atNode | atLayout) as AccessorType;

@@ -59,0 +58,0 @@ export interface INodeObserverConfigBase {

import {
type CollectionKind,
subscriberCollection,
AccessorType,
type AccessorType,
type ICollectionObserver,

@@ -11,3 +10,3 @@ type IObserverLocator,

import type { INode } from '../dom';
import { createError, hasOwnProperty, isArray } from '../utilities';
import { atLayout, atNode, atObserver, createError, hasOwnProperty, isArray } from '../utilities';
import { INodeObserver, INodeObserverConfigBase } from './observer-locator';

@@ -41,3 +40,3 @@ import { mixinNodeObserverUseConfig } from './observation-utils';

// but for simplicity, always treat as such
public type: AccessorType = AccessorType.Node | AccessorType.Observer | AccessorType.Layout;
public type: AccessorType = (atNode | atObserver | atLayout) as AccessorType;

@@ -56,3 +55,3 @@ /** @internal */

/** @internal */
private _arrayObserver?: ICollectionObserver<CollectionKind.array> = void 0;
private _arrayObserver?: ICollectionObserver<'array'> = void 0;
/** @internal */

@@ -59,0 +58,0 @@ private _nodeObserver?: MutationObserver = void 0;

@@ -1,5 +0,4 @@

import { AccessorType } from '@aurelia/runtime';
import { emptyArray, kebabCase } from '@aurelia/kernel';
import { hasOwnProperty, isFunction, isString } from '../utilities';
import type { IAccessor } from '@aurelia/runtime';
import { atLayout, atNode, hasOwnProperty, isFunction, isString } from '../utilities';
import type { AccessorType, IAccessor } from '@aurelia/runtime';
import { mixinNoopSubscribable } from './observation-utils';

@@ -10,3 +9,3 @@

export class StyleAttributeAccessor implements IAccessor {
public type: AccessorType = AccessorType.Node | AccessorType.Layout;
public type: AccessorType = (atNode | atLayout) as AccessorType;

@@ -13,0 +12,0 @@ /** @internal */

@@ -1,7 +0,7 @@

import { AccessorType, subscriberCollection } from '@aurelia/runtime';
import { subscriberCollection } from '@aurelia/runtime';
import { mixinNodeObserverUseConfig } from './observation-utils';
import { areEqual } from '../utilities';
import { areEqual, atLayout, atNode, atObserver } from '../utilities';
import type { IIndexable } from '@aurelia/kernel';
import type { ISubscriberCollection } from '@aurelia/runtime';
import type { AccessorType, ISubscriberCollection } from '@aurelia/runtime';
import type { INode } from '../dom';

@@ -17,3 +17,3 @@ import type { INodeObserver, INodeObserverConfigBase } from './observer-locator';

// but for simplicity, always treat as such
public type: AccessorType = AccessorType.Node | AccessorType.Observer | AccessorType.Layout;
public type: AccessorType = (atNode | atObserver | atLayout) as AccessorType;

@@ -20,0 +20,0 @@ /** @internal */

@@ -12,3 +12,3 @@ import {

import {
ExpressionType,
type ExpressionType,
IExpressionParser,

@@ -22,3 +22,3 @@ IObserverLocator,

} from '@aurelia/runtime';
import { BindingMode } from './binding/interfaces-bindings';
import { toView, type BindingMode } from './binding/interfaces-bindings';
import { AttributeBinding } from './binding/attribute';

@@ -39,3 +39,3 @@ import { InterpolationBinding } from './binding/interpolation-binding';

import type { AttrSyntax } from './resources/attribute-pattern';
import { objectKeys, isString, def } from './utilities';
import { objectKeys, isString, def, etIsProperty, etInterpolation, etIsIterator, etIsFunction, objectFreeze } from './utilities';
import { createInterface, registerResolver, singletonRegistration } from './utilities-di';

@@ -49,25 +49,47 @@ import { IAuSlotProjections, IAuSlotsInfo, AuSlotsInfo } from './templating/controller.projection';

export const enum InstructionType {
hydrateElement = 'ra',
hydrateAttribute = 'rb',
hydrateTemplateController = 'rc',
hydrateLetElement = 'rd',
setProperty = 're',
interpolation = 'rf',
propertyBinding = 'rg',
letBinding = 'ri',
refBinding = 'rj',
iteratorBinding = 'rk',
multiAttr = 'rl',
textBinding = 'ha',
listenerBinding = 'hb',
attributeBinding = 'hc',
stylePropertyBinding = 'hd',
setAttribute = 'he',
setClassAttribute = 'hf',
setStyleAttribute = 'hg',
spreadBinding = 'hs',
spreadElementProp = 'hp',
}
/** @internal */ export const hydrateElement = 'ra';
/** @internal */ export const hydrateAttribute = 'rb';
/** @internal */ export const hydrateTemplateController = 'rc';
/** @internal */ export const hydrateLetElement = 'rd';
/** @internal */ export const setProperty = 're';
/** @internal */ export const interpolation = 'rf';
/** @internal */ export const propertyBinding = 'rg';
/** @internal */ export const letBinding = 'ri';
/** @internal */ export const refBinding = 'rj';
/** @internal */ export const iteratorBinding = 'rk';
/** @internal */ export const multiAttr = 'rl';
/** @internal */ export const textBinding = 'ha';
/** @internal */ export const listenerBinding = 'hb';
/** @internal */ export const attributeBinding = 'hc';
/** @internal */ export const stylePropertyBinding = 'hd';
/** @internal */ export const setAttribute = 'he';
/** @internal */ export const setClassAttribute = 'hf';
/** @internal */ export const setStyleAttribute = 'hg';
/** @internal */ export const spreadBinding = 'hs';
/** @internal */ export const spreadElementProp = 'hp';
export const InstructionType = /*@__PURE__*/ objectFreeze({
hydrateElement,
hydrateAttribute,
hydrateTemplateController,
hydrateLetElement,
setProperty,
interpolation,
propertyBinding,
letBinding,
refBinding,
iteratorBinding,
multiAttr,
textBinding,
listenerBinding,
attributeBinding,
stylePropertyBinding,
setAttribute,
setClassAttribute,
setStyleAttribute,
spreadBinding,
spreadElementProp,
});
export type InstructionType = typeof InstructionType[keyof typeof InstructionType];
export type InstructionTypeName = string;

@@ -86,3 +108,3 @@

export class InterpolationInstruction {
public readonly type = InstructionType.interpolation;
public readonly type = interpolation;

@@ -96,3 +118,3 @@ public constructor(

export class PropertyBindingInstruction {
public readonly type = InstructionType.propertyBinding;
public readonly type = propertyBinding;

@@ -107,3 +129,3 @@ public constructor(

export class IteratorBindingInstruction {
public readonly type = InstructionType.iteratorBinding;
public readonly type = iteratorBinding;

@@ -118,3 +140,3 @@ public constructor(

export class RefBindingInstruction {
public readonly type = InstructionType.refBinding;
public readonly type = refBinding;

@@ -128,3 +150,3 @@ public constructor(

export class SetPropertyInstruction {
public readonly type = InstructionType.setProperty;
public readonly type = setProperty;

@@ -138,3 +160,3 @@ public constructor(

export class MultiAttrInstruction {
public readonly type = InstructionType.multiAttr;
public readonly type = multiAttr;

@@ -149,3 +171,3 @@ public constructor(

export class HydrateElementInstruction {
public readonly type = InstructionType.hydrateElement;
public readonly type = hydrateElement;

@@ -186,3 +208,3 @@ /**

export class HydrateAttributeInstruction {
public readonly type = InstructionType.hydrateAttribute;
public readonly type = hydrateAttribute;

@@ -202,3 +224,3 @@ public constructor(

export class HydrateTemplateController {
public readonly type = InstructionType.hydrateTemplateController;
public readonly type = hydrateTemplateController;

@@ -219,3 +241,3 @@ public constructor(

export class HydrateLetElementInstruction {
public readonly type = InstructionType.hydrateLetElement;
public readonly type = hydrateLetElement;

@@ -229,3 +251,3 @@ public constructor(

export class LetBindingInstruction {
public readonly type = InstructionType.letBinding;
public readonly type = letBinding;

@@ -239,3 +261,3 @@ public constructor(

export class TextBindingInstruction {
public readonly type = InstructionType.textBinding;
public readonly type = textBinding;

@@ -248,3 +270,3 @@ public constructor(

export class ListenerBindingInstruction {
public readonly type = InstructionType.listenerBinding;
public readonly type = listenerBinding;

@@ -259,3 +281,3 @@ public constructor(

export class StylePropertyBindingInstruction {
public readonly type = InstructionType.stylePropertyBinding;
public readonly type = stylePropertyBinding;

@@ -269,3 +291,3 @@ public constructor(

export class SetAttributeInstruction {
public readonly type = InstructionType.setAttribute;
public readonly type = setAttribute;

@@ -279,3 +301,3 @@ public constructor(

export class SetClassAttributeInstruction {
public readonly type: InstructionType.setClassAttribute = InstructionType.setClassAttribute;
public readonly type: typeof InstructionType.setClassAttribute = setClassAttribute;

@@ -288,3 +310,3 @@ public constructor(

export class SetStyleAttributeInstruction {
public readonly type: InstructionType.setStyleAttribute = InstructionType.setStyleAttribute;
public readonly type: typeof InstructionType.setStyleAttribute = setStyleAttribute;

@@ -297,3 +319,3 @@ public constructor(

export class AttributeBindingInstruction {
public readonly type = InstructionType.attributeBinding;
public readonly type = attributeBinding;

@@ -314,7 +336,7 @@ public constructor(

export class SpreadBindingInstruction {
public readonly type = InstructionType.spreadBinding;
public readonly type = spreadBinding;
}
export class SpreadElementPropBindingInstruction {
public readonly type = InstructionType.spreadElementProp;
public readonly type = spreadElementProp;
public constructor(

@@ -459,6 +481,6 @@ public readonly instructions: IInstruction,

@renderer(InstructionType.setProperty)
@renderer(setProperty)
/** @internal */
export class SetPropertyRenderer implements IRenderer {
public target!: InstructionType.setProperty;
public target!: typeof InstructionType.setProperty;

@@ -479,3 +501,3 @@ public render(

@renderer(InstructionType.hydrateElement)
@renderer(hydrateElement)
/** @internal */

@@ -485,3 +507,3 @@ export class CustomElementRenderer implements IRenderer {

public target!: InstructionType.hydrateElement;
public target!: typeof InstructionType.hydrateElement;

@@ -561,3 +583,3 @@ public render(

@renderer(InstructionType.hydrateAttribute)
@renderer(hydrateAttribute)
/** @internal */

@@ -567,3 +589,3 @@ export class CustomAttributeRenderer implements IRenderer {

public target!: InstructionType.hydrateAttribute;
public target!: typeof InstructionType.hydrateAttribute;

@@ -635,3 +657,3 @@ public render(

@renderer(InstructionType.hydrateTemplateController)
@renderer(hydrateTemplateController)
/** @internal */

@@ -641,3 +663,3 @@ export class TemplateControllerRenderer implements IRenderer {

public target!: InstructionType.hydrateTemplateController;
public target!: typeof InstructionType.hydrateTemplateController;

@@ -710,6 +732,6 @@ public render(

@renderer(InstructionType.hydrateLetElement)
@renderer(hydrateLetElement)
/** @internal */
export class LetElementRenderer implements IRenderer {
public target!: InstructionType.hydrateLetElement;
public target!: typeof InstructionType.hydrateLetElement;
public render(

@@ -734,3 +756,3 @@ renderingCtrl: IHydratableController,

childInstruction = childInstructions[i];
expr = ensureExpression(exprParser, childInstruction.from, ExpressionType.IsProperty);
expr = ensureExpression(exprParser, childInstruction.from, etIsProperty);
renderingCtrl.addBinding(new LetBinding(

@@ -748,6 +770,6 @@ container,

@renderer(InstructionType.refBinding)
@renderer(refBinding)
/** @internal */
export class RefBindingRenderer implements IRenderer {
public target!: InstructionType.refBinding;
public target!: typeof InstructionType.refBinding;
public render(

@@ -762,3 +784,3 @@ renderingCtrl: IHydratableController,

renderingCtrl.container,
ensureExpression(exprParser, instruction.from, ExpressionType.IsProperty),
ensureExpression(exprParser, instruction.from, etIsProperty),
getRefTarget(target, instruction.to)

@@ -769,6 +791,6 @@ ));

@renderer(InstructionType.interpolation)
@renderer(interpolation)
/** @internal */
export class InterpolationBindingRenderer implements IRenderer {
public target!: InstructionType.interpolation;
public target!: typeof InstructionType.interpolation;
public render(

@@ -787,6 +809,6 @@ renderingCtrl: IHydratableController,

platform.domWriteQueue,
ensureExpression(exprParser, instruction.from, ExpressionType.Interpolation),
ensureExpression(exprParser, instruction.from, etInterpolation),
getTarget(target),
instruction.to,
BindingMode.toView,
toView,
));

@@ -796,6 +818,6 @@ }

@renderer(InstructionType.propertyBinding)
@renderer(propertyBinding)
/** @internal */
export class PropertyBindingRenderer implements IRenderer {
public target!: InstructionType.propertyBinding;
public target!: typeof InstructionType.propertyBinding;
public render(

@@ -814,3 +836,3 @@ renderingCtrl: IHydratableController,

platform.domWriteQueue,
ensureExpression(exprParser, instruction.from, ExpressionType.IsProperty),
ensureExpression(exprParser, instruction.from, etIsProperty),
getTarget(target),

@@ -823,6 +845,6 @@ instruction.to,

@renderer(InstructionType.iteratorBinding)
@renderer(iteratorBinding)
/** @internal */
export class IteratorBindingRenderer implements IRenderer {
public target!: InstructionType.iteratorBinding;
public target!: typeof InstructionType.iteratorBinding;
public render(

@@ -841,6 +863,6 @@ renderingCtrl: IHydratableController,

platform.domWriteQueue,
ensureExpression(exprParser, instruction.forOf, ExpressionType.IsIterator),
ensureExpression(exprParser, instruction.forOf, etIsIterator),
getTarget(target),
instruction.to,
BindingMode.toView,
toView,
));

@@ -850,6 +872,6 @@ }

@renderer(InstructionType.textBinding)
@renderer(textBinding)
/** @internal */
export class TextBindingRenderer implements IRenderer {
public target!: InstructionType.textBinding;
public target!: typeof InstructionType.textBinding;
public render(

@@ -869,3 +891,3 @@ renderingCtrl: IHydratableController,

platform,
ensureExpression(exprParser, instruction.from, ExpressionType.IsProperty),
ensureExpression(exprParser, instruction.from, etIsProperty),
target as Text,

@@ -876,6 +898,6 @@ ));

@renderer(InstructionType.listenerBinding)
@renderer(listenerBinding)
/** @internal */
export class ListenerBindingRenderer implements IRenderer {
public target!: InstructionType.listenerBinding;
public target!: typeof InstructionType.listenerBinding;
public render(

@@ -890,3 +912,3 @@ renderingCtrl: IHydratableController,

renderingCtrl.container,
ensureExpression(exprParser, instruction.from, ExpressionType.IsFunction),
ensureExpression(exprParser, instruction.from, etIsFunction),
target,

@@ -899,6 +921,6 @@ instruction.to,

@renderer(InstructionType.setAttribute)
@renderer(setAttribute)
/** @internal */
export class SetAttributeRenderer implements IRenderer {
public target!: InstructionType.setAttribute;
public target!: typeof InstructionType.setAttribute;
public render(

@@ -913,5 +935,5 @@ _: IHydratableController,

@renderer(InstructionType.setClassAttribute)
@renderer(setClassAttribute)
export class SetClassAttributeRenderer implements IRenderer {
public target!: InstructionType.setClassAttribute;
public target!: typeof InstructionType.setClassAttribute;
public render(

@@ -926,5 +948,5 @@ _: IHydratableController,

@renderer(InstructionType.setStyleAttribute)
@renderer(setStyleAttribute)
export class SetStyleAttributeRenderer implements IRenderer {
public target!: InstructionType.setStyleAttribute;
public target!: typeof InstructionType.setStyleAttribute;
public render(

@@ -964,6 +986,6 @@ _: IHydratableController,

@renderer(InstructionType.stylePropertyBinding)
@renderer(stylePropertyBinding)
/** @internal */
export class StylePropertyBindingRenderer implements IRenderer {
public target!: InstructionType.stylePropertyBinding;
public target!: typeof InstructionType.stylePropertyBinding;
public render(

@@ -985,6 +1007,6 @@ renderingCtrl: IHydratableController,

platform.domWriteQueue,
ensureExpression(exprParser, instruction.from, ExpressionType.IsProperty),
ensureExpression(exprParser, instruction.from, etIsProperty),
target.style,
instruction.to,
BindingMode.toView,
toView,
));

@@ -999,6 +1021,6 @@ return;

platform.domWriteQueue,
ensureExpression(exprParser, instruction.from, ExpressionType.IsProperty),
ensureExpression(exprParser, instruction.from, etIsProperty),
target.style,
instruction.to,
BindingMode.toView,
toView,
));

@@ -1019,6 +1041,6 @@ }

@renderer(InstructionType.attributeBinding)
@renderer(attributeBinding)
/** @internal */
export class AttributeBindingRenderer implements IRenderer {
public target!: InstructionType.attributeBinding;
public target!: typeof InstructionType.attributeBinding;
public render(

@@ -1042,3 +1064,3 @@ renderingCtrl: IHydratableController,

platform.domWriteQueue,
ensureExpression(exprParser, instruction.from, ExpressionType.IsProperty),
ensureExpression(exprParser, instruction.from, etIsProperty),
target,

@@ -1049,3 +1071,3 @@ instruction.attr/* targetAttribute */,

: instruction.to.split(/\s/g).map(c => classMapping[c] ?? c).join(' '),
BindingMode.toView,
toView,
));

@@ -1055,3 +1077,3 @@ }

@renderer(InstructionType.spreadBinding)
@renderer(spreadBinding)
export class SpreadRenderer implements IRenderer {

@@ -1062,3 +1084,3 @@

public readonly target!: InstructionType.spreadBinding;
public readonly target!: typeof InstructionType.spreadBinding;

@@ -1065,0 +1087,0 @@ public render(

import { BindingBehaviorInstance, IBinding } from '@aurelia/runtime';
import { fromView, oneTime, toView, twoWay, type BindingMode } from '../../binding/interfaces-bindings';
import { bindingBehavior } from '../binding-behavior';
import { BindingMode } from '../../binding/interfaces-bindings';

@@ -24,15 +24,15 @@ import type { Scope } from '@aurelia/runtime';

export class OneTimeBindingBehavior extends BindingModeBehavior {
public get mode() { return BindingMode.oneTime; }
public get mode(): typeof BindingMode.oneTime { return oneTime; }
}
export class ToViewBindingBehavior extends BindingModeBehavior {
public get mode() { return BindingMode.toView; }
public get mode(): typeof BindingMode.toView { return toView; }
}
export class FromViewBindingBehavior extends BindingModeBehavior {
public get mode() { return BindingMode.fromView; }
public get mode(): typeof BindingMode.fromView { return fromView; }
}
export class TwoWayBindingBehavior extends BindingModeBehavior {
public get mode() { return BindingMode.twoWay; }
public get mode(): typeof BindingMode.twoWay { return twoWay; }
}

@@ -39,0 +39,0 @@

import { IBinding, INodeObserverLocator, IObserverLocator, type BindingBehaviorInstance, type Scope } from '@aurelia/runtime';
import { BindingMode } from '../../binding/interfaces-bindings';
import { fromView } from '../../binding/interfaces-bindings';
import { NodeObserverLocator } from '../../observation/observer-locator';

@@ -22,3 +22,3 @@ import { bindingBehavior } from '../binding-behavior';

if (!(binding instanceof PropertyBinding) || !(binding.mode & BindingMode.fromView)) {
if (!(binding instanceof PropertyBinding) || !(binding.mode & fromView)) {
throw createMappedError(ErrorNames.update_trigger_invalid_usage);

@@ -25,0 +25,0 @@ }

import { camelCase, mergeArrays, firstDefined, emptyArray } from '@aurelia/kernel';
import { ExpressionType, IExpressionParser } from '@aurelia/runtime';
import { BindingMode } from '../binding/interfaces-bindings';
import { IExpressionParser } from '@aurelia/runtime';
import { oneTime, toView, fromView, twoWay, defaultMode as $defaultMode, type BindingMode } from '../binding/interfaces-bindings';
import { IAttrMapper } from '../compiler/attribute-mapper';

@@ -14,5 +14,4 @@ import {

} from '../renderer';
import { DefinitionType } from './resources-shared';
import { appendResourceKey, defineMetadata, getAnnotationKeyFor, getOwnMetadata, getResourceKeyFor } from '../utilities-metadata';
import { isString, objectFreeze } from '../utilities';
import { etIsFunction, etIsIterator, etIsProperty, isString, objectFreeze } from '../utilities';
import { aliasRegistration, registerAliases, singletonRegistration } from '../utilities-di';

@@ -33,14 +32,13 @@

import type { CustomElementDefinition } from './custom-element';
import { dtElement } from './resources-shared';
export const ctNone = 'None' as const;
export const ctIgnoreAttr = 'IgnoreAttr' as const;
/**
* Characteristics of a binding command.
* - `None`: The normal process (check custom attribute -> check bindable -> command.build()) should take place.
* - `IgnoreAttr`: The binding command wants to take over the processing of an attribute. The template compiler keeps the attribute as is in compilation, instead of executing the normal process.
*/
export const enum CommandType {
None = 0b0_000,
// if a binding command is taking over the processing of an attribute
// then it should add this flag to its type
// which then should be considered by the template compiler to keep the attribute as is in compilation,
// instead of normal process: check custom attribute -> check bindable -> command.build()
IgnoreAttr = 0b0_001,
}
export type CommandType = typeof ctNone | typeof ctIgnoreAttr;

@@ -161,3 +159,3 @@ export type PartialBindingCommandDefinition = PartialResourceDefinition<{

export class OneTimeBindingCommand implements BindingCommandInstance {
public get type(): CommandType.None { return CommandType.None; }
public get type(): 'None' { return ctNone; }

@@ -176,3 +174,3 @@ public build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction {

// it means : <my-el value.bind="value">
if (value === '' && info.def.type === DefinitionType.Element) {
if (value === '' && info.def.type === dtElement) {
value = camelCase(target);

@@ -182,3 +180,3 @@ }

}
return new PropertyBindingInstruction(exprParser.parse(value, ExpressionType.IsProperty), target, BindingMode.oneTime);
return new PropertyBindingInstruction(exprParser.parse(value, etIsProperty), target, oneTime);
}

@@ -189,3 +187,3 @@ }

export class ToViewBindingCommand implements BindingCommandInstance {
public get type(): CommandType.None { return CommandType.None; }
public get type(): 'None' { return ctNone; }

@@ -204,3 +202,3 @@ public build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction {

// it means : <my-el value.bind="value">
if (value === '' && info.def.type === DefinitionType.Element) {
if (value === '' && info.def.type === dtElement) {
value = camelCase(target);

@@ -210,3 +208,3 @@ }

}
return new PropertyBindingInstruction(exprParser.parse(value, ExpressionType.IsProperty), target, BindingMode.toView);
return new PropertyBindingInstruction(exprParser.parse(value, etIsProperty), target, toView);
}

@@ -217,3 +215,3 @@ }

export class FromViewBindingCommand implements BindingCommandInstance {
public get type(): CommandType.None { return CommandType.None; }
public get type(): 'None' { return ctNone; }

@@ -232,3 +230,3 @@ public build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction {

// it means : <my-el value.bind="value">
if (value === '' && info.def.type === DefinitionType.Element) {
if (value === '' && info.def.type === dtElement) {
value = camelCase(target);

@@ -238,3 +236,3 @@ }

}
return new PropertyBindingInstruction(exprParser.parse(value, ExpressionType.IsProperty), target, BindingMode.fromView);
return new PropertyBindingInstruction(exprParser.parse(value, etIsProperty), target, fromView);
}

@@ -245,3 +243,3 @@ }

export class TwoWayBindingCommand implements BindingCommandInstance {
public get type(): CommandType.None { return CommandType.None; }
public get type(): 'None' { return ctNone; }

@@ -260,3 +258,3 @@ public build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction {

// it means : <my-el value.bind="value">
if (value === '' && info.def.type === DefinitionType.Element) {
if (value === '' && info.def.type === dtElement) {
value = camelCase(target);

@@ -266,3 +264,3 @@ }

}
return new PropertyBindingInstruction(exprParser.parse(value, ExpressionType.IsProperty), target, BindingMode.twoWay);
return new PropertyBindingInstruction(exprParser.parse(value, etIsProperty), target, twoWay);
}

@@ -273,3 +271,3 @@ }

export class DefaultBindingCommand implements BindingCommandInstance {
public get type(): CommandType.None { return CommandType.None; }
public get type(): 'None' { return ctNone; }

@@ -285,3 +283,3 @@ public build(info: ICommandBuildInfo, exprParser: IExpressionParser, attrMapper: IAttrMapper): PropertyBindingInstruction {

if (bindable == null) {
mode = attrMapper.isTwoWay(info.node, target) ? BindingMode.twoWay : BindingMode.toView;
mode = attrMapper.isTwoWay(info.node, target) ? twoWay : toView;
target = attrMapper.map(info.node, target)

@@ -294,9 +292,9 @@ // if the mapper doesn't know how to map it

// it means : <my-el value.bind="value">
if (value === '' && info.def.type === DefinitionType.Element) {
if (value === '' && info.def.type === dtElement) {
value = camelCase(target);
}
defaultMode = (info.def as CA).defaultBindingMode;
mode = bindable.mode === BindingMode.default || bindable.mode == null
? defaultMode == null || defaultMode === BindingMode.default
? BindingMode.toView
mode = bindable.mode === $defaultMode || bindable.mode == null
? defaultMode == null || defaultMode === $defaultMode
? toView
: defaultMode

@@ -306,3 +304,3 @@ : bindable.mode;

}
return new PropertyBindingInstruction(exprParser.parse(value, ExpressionType.IsProperty), target, mode);
return new PropertyBindingInstruction(exprParser.parse(value, etIsProperty), target, mode);
}

@@ -313,3 +311,3 @@ }

export class ForBindingCommand implements BindingCommandInstance {
public get type(): CommandType.None { return CommandType.None; }
public get type(): 'None' { return ctNone; }

@@ -329,3 +327,3 @@ public static get inject(): unknown[] { return [IAttributeParser]; }

: info.bindable.name;
const forOf = exprParser.parse(info.attr.rawValue, ExpressionType.IsIterator);
const forOf = exprParser.parse(info.attr.rawValue, etIsIterator);
let props: MultiAttrInstruction[] = emptyArray;

@@ -348,6 +346,6 @@ if (forOf.semiIdx > -1) {

export class TriggerBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }
public build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction {
return new ListenerBindingInstruction(exprParser.parse(info.attr.rawValue, ExpressionType.IsFunction), info.attr.target, true, false);
return new ListenerBindingInstruction(exprParser.parse(info.attr.rawValue, etIsFunction), info.attr.target, true, false);
}

@@ -358,6 +356,6 @@ }

export class CaptureBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }
public build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction {
return new ListenerBindingInstruction(exprParser.parse(info.attr.rawValue, ExpressionType.IsFunction), info.attr.target, false, true);
return new ListenerBindingInstruction(exprParser.parse(info.attr.rawValue, etIsFunction), info.attr.target, false, true);
}

@@ -371,6 +369,6 @@ }

export class AttrBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }
public build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction {
return new AttributeBindingInstruction(info.attr.target, exprParser.parse(info.attr.rawValue, ExpressionType.IsProperty), info.attr.target);
return new AttributeBindingInstruction(info.attr.target, exprParser.parse(info.attr.rawValue, etIsProperty), info.attr.target);
}

@@ -384,6 +382,6 @@ }

export class StyleBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }
public build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction {
return new AttributeBindingInstruction('style', exprParser.parse(info.attr.rawValue, ExpressionType.IsProperty), info.attr.target);
return new AttributeBindingInstruction('style', exprParser.parse(info.attr.rawValue, etIsProperty), info.attr.target);
}

@@ -397,6 +395,6 @@ }

export class ClassBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }
public build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction {
return new AttributeBindingInstruction('class', exprParser.parse(info.attr.rawValue, ExpressionType.IsProperty), info.attr.target);
return new AttributeBindingInstruction('class', exprParser.parse(info.attr.rawValue, etIsProperty), info.attr.target);
}

@@ -410,6 +408,6 @@ }

export class RefBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }
public build(info: ICommandBuildInfo, exprParser: IExpressionParser): IInstruction {
return new RefBindingInstruction(exprParser.parse(info.attr.rawValue, ExpressionType.IsProperty), info.attr.target);
return new RefBindingInstruction(exprParser.parse(info.attr.rawValue, etIsProperty), info.attr.target);
}

@@ -420,3 +418,3 @@ }

export class SpreadBindingCommand implements BindingCommandInstance {
public get type(): CommandType.IgnoreAttr { return CommandType.IgnoreAttr; }
public get type(): 'IgnoreAttr' { return ctIgnoreAttr; }

@@ -423,0 +421,0 @@ public build(_info: ICommandBuildInfo): IInstruction {

@@ -5,7 +5,6 @@ import { mergeArrays, firstDefined, Key } from '@aurelia/kernel';

import { getRef } from '../dom';
import { DefinitionType } from './resources-shared';
import { appendResourceKey, defineMetadata, getAnnotationKeyFor, getOwnMetadata, getResourceKeyFor, hasOwnMetadata } from '../utilities-metadata';
import { isFunction, isString, objectFreeze } from '../utilities';
import { aliasRegistration, registerAliases, transientRegistration } from '../utilities-di';
import { BindingMode } from '../binding/interfaces-bindings';
import { type BindingMode, toView } from '../binding/interfaces-bindings';

@@ -24,2 +23,3 @@ import type {

import { ErrorNames, createMappedError } from '../errors';
import { dtAttribute } from './resources-shared';

@@ -103,3 +103,3 @@ declare module '@aurelia/kernel' {

// a simple marker to distinguish between Custom Element definition & Custom attribute definition
public get type(): DefinitionType.Attribute { return DefinitionType.Attribute; }
public get type(): 'Attribute' { return dtAttribute; }

@@ -138,3 +138,3 @@ private constructor(

getAttributeKeyFrom(name),
firstDefined(getAttributeAnnotation(Type, 'defaultBindingMode'), def.defaultBindingMode, Type.defaultBindingMode, BindingMode.toView),
firstDefined(getAttributeAnnotation(Type, 'defaultBindingMode'), def.defaultBindingMode, Type.defaultBindingMode, toView),
firstDefined(getAttributeAnnotation(Type, 'isTemplateController'), def.isTemplateController, Type.isTemplateController, false),

@@ -141,0 +141,0 @@ Bindable.from(Type, ...Bindable.getAll(Type), getAttributeAnnotation(Type, 'bindables'), Type.bindables, def.bindables),

@@ -1,2 +0,2 @@

import { BindingMode } from '../../binding/interfaces-bindings';
import { twoWay } from '../../binding/interfaces-bindings';
import { INode } from '../../dom';

@@ -17,3 +17,3 @@ import { IPlatform } from '../../platform';

@bindable({ mode: BindingMode.twoWay })
@bindable({ mode: twoWay })
public value: unknown;

@@ -20,0 +20,0 @@

@@ -13,3 +13,2 @@ import {

import { Watch } from '../watch';
import { DefinitionType } from './resources-shared';
import { appendResourceKey, defineMetadata, getAnnotationKeyFor, getOwnMetadata, getResourceKeyFor, hasOwnMetadata } from '../utilities-metadata';

@@ -38,2 +37,3 @@ import { def, isFunction, isString, objectAssign, objectFreeze } from '../utilities';

import { ErrorNames, createMappedError } from '../errors';
import { dtElement } from './resources-shared';

@@ -202,3 +202,3 @@ declare module '@aurelia/kernel' {

export class CustomElementDefinition<C extends Constructable = Constructable> implements ResourceDefinition<C, ICustomElementViewModel, PartialCustomElementDefinition> {
public get type(): DefinitionType.Element { return DefinitionType.Element; }
public get type(): 'Element' { return dtElement; }
private constructor(

@@ -205,0 +205,0 @@ public readonly Type: CustomElementType<C>,

@@ -13,3 +13,3 @@ import { Constructable, IContainer, InstanceProvider, emptyArray, onResolve, resolve, transient } from '@aurelia/kernel';

import { ErrorNames, createMappedError } from '../../errors';
import { BindingMode } from '../../binding/interfaces-bindings';
import { fromView } from '../../binding/interfaces-bindings';
import { SpreadBinding } from '../../binding/spread-binding';

@@ -72,3 +72,3 @@ import { AttrSyntax } from '../attribute-pattern';

@bindable({
mode: BindingMode.fromView
mode: fromView
})

@@ -82,3 +82,3 @@ public get composing(): Promise<void> | void {

@bindable({
mode: BindingMode.fromView
mode: fromView
})

@@ -85,0 +85,0 @@ public get composition(): ICompositionController | undefined {

@@ -49,25 +49,55 @@ import { Scope } from '@aurelia/runtime';

public constructor() {
const hdrContext = resolve(IHydrationContext);
const location = resolve(IRenderLocation);
const instruction = resolve(IInstruction) as HydrateElementInstruction;
const hdrContext = resolve(IHydrationContext);
const rendering = resolve(IRendering);
const slotInfo = instruction.auSlot!;
const projection = hdrContext.instruction?.projections?.[slotInfo.name];
const contextController = hdrContext.controller;
const contextContainer = hdrContext.controller.container;
let factory: IViewFactory;
let container: IContainer;
this.name = slotInfo.name;
if (projection == null) {
factory = rendering.getViewFactory(slotInfo.fallback, contextController.container);
container = contextContainer.createChild({ inheritParentResources: true });
factory = rendering.getViewFactory(slotInfo.fallback, container);
this._hasProjection = false;
} else {
container = hdrContext.parent!.controller.container.createChild({ inheritParentResources: true });
registerResolver(
container,
contextController.definition.Type,
new InstanceProvider(void 0, contextController.viewModel)
);
// projection could happen within a projection, example:
// --my-app--
// <s-1>
// ---projection 1---
// <s-2>
// ---projection 2---
// <s-3>
// for the template above, if <s-3> is injecting <S1>,
// we won't find the information in the hydration context hierarchy <MyApp>/<S3>
// as it's a flat wysiwyg structure based on the template html
//
// since we are construction the projection (2) view based on the
// container of <my-app>, we need to pre-register all information stored
// in projection (1) into the container created for the projection (2) view
// =============================
// my-app template:
// my-app --- hydration context
// <el> --- owning element (this has this <au-slot> that uses ---projection)
// <s-1> --- projection
//
container = contextContainer.createChild();
// registering resources from the parent hydration context is necessary
// as that's where the projection is declared in the template
//
// if neccessary, we can do the same gymnastic of registering information related to
// a custom element registration like in renderer.ts from line 1088 to 1098
// so we don't accidentally get information related to owning element (host, controller, instruction etc...)
// although it may be more desirable to have owning element information available here
container.useResources(hdrContext.parent!.controller.container);
// doing this to shadow the owning element hydration context
// since we created a container out of the owning element container
// instead of the hydration context container
registerResolver(container, IHydrationContext, new InstanceProvider(void 0, hdrContext.parent));
factory = rendering.getViewFactory(projection, container);
this._hasProjection = true;
this._slotwatchers = contextController.container.getAll(IAuSlotWatcher, false)?.filter(w => w.slotName === '*' || w.slotName === slotInfo.name) ?? emptyArray;
this._slotwatchers = contextContainer.getAll(IAuSlotWatcher, false)?.filter(w => w.slotName === '*' || w.slotName === slotInfo.name) ?? emptyArray;
}

@@ -74,0 +104,0 @@ this._hasSlotWatcher = (this._slotwatchers ??= emptyArray).length > 0;

@@ -1,4 +0,3 @@

export const enum DefinitionType {
Element = 1,
Attribute = 2,
}
export const dtElement = 'Element' as const;
export const dtAttribute = 'Attribute' as const;
export type DefinitionType = typeof dtElement | typeof dtAttribute;

@@ -217,3 +217,6 @@ import { onResolve, resolve } from '@aurelia/kernel';

return deactivated?.call(callbackContext, target, view);
return onResolve(
deactivated?.call(callbackContext, target, view),
() => this._removeLocation()
);
}

@@ -262,2 +265,8 @@

/** @internal */
private _removeLocation(): void {
this._targetLocation.remove();
this._targetLocation.$start!.remove();
}
/** @internal */
private _moveLocation(target: Element, position: InsertPosition) {

@@ -264,0 +273,0 @@ const end = this._targetLocation;

@@ -1,2 +0,2 @@

import { Task, TaskAbortError, TaskStatus } from '@aurelia/platform';
import { Task, TaskAbortError } from '@aurelia/platform';
import { ILogger, onResolve, onResolveAll, resolve } from '@aurelia/kernel';

@@ -8,3 +8,3 @@ import { Scope } from '@aurelia/runtime';

import { IInstruction } from '../../renderer';
import { BindingMode } from '../../binding/interfaces-bindings';
import { fromView, toView } from '../../binding/interfaces-bindings';
import {

@@ -22,3 +22,3 @@ Controller,

import { templateController } from '../custom-attribute';
import { isPromise, safeString } from '../../utilities';
import { isPromise, safeString, tsPending, tsRunning } from '../../utilities';
import { ErrorNames, createMappedError } from '../../errors';

@@ -115,3 +115,3 @@

};
if (this.preSettledTask!.status === TaskStatus.running) {
if (this.preSettledTask!.status === tsRunning) {
void preSettlePromise.then(fulfill);

@@ -135,3 +135,3 @@ } else {

};
if (this.preSettledTask!.status === TaskStatus.running) {
if (this.preSettledTask!.status === tsRunning) {
void preSettlePromise.then(reject);

@@ -146,3 +146,3 @@ } else {

if (this.postSettledTask?.status === TaskStatus.running) {
if (this.postSettledTask?.status === tsRunning) {
void this.postSettlePromise.then($swap);

@@ -168,7 +168,7 @@ } else {

@templateController('pending')
@templateController(tsPending)
export class PendingTemplateController implements ICustomAttributeViewModel {
public readonly $controller!: ICustomAttributeController<this>; // This is set by the controller after this instance is constructed
@bindable({ mode: BindingMode.toView }) public value!: Promise<unknown>;
@bindable({ mode: toView }) public value!: Promise<unknown>;

@@ -218,3 +218,3 @@ public view: ISyntheticView | undefined = void 0;

@bindable({ mode: BindingMode.fromView }) public value!: unknown;
@bindable({ mode: fromView }) public value!: unknown;

@@ -265,3 +265,3 @@ public view: ISyntheticView | undefined = void 0;

@bindable({ mode: BindingMode.fromView }) public value!: unknown;
@bindable({ mode: fromView }) public value!: unknown;

@@ -268,0 +268,0 @@ public view: ISyntheticView | undefined = void 0;

@@ -8,3 +8,2 @@ import { type IDisposable, onResolve, IIndexable } from '@aurelia/kernel';

DestructuringAssignmentExpression,
ExpressionKind,
ForOfStatement,

@@ -21,3 +20,2 @@ getCollectionObserver,

IExpressionParser,
ExpressionType,
} from '@aurelia/runtime';

@@ -29,3 +27,3 @@ import { IRenderLocation } from '../../dom';

import { bindable } from '../../bindable';
import { areEqual, isArray, isPromise, baseObjectPrototype, rethrow } from '../../utilities';
import { areEqual, isArray, isPromise, baseObjectPrototype, rethrow, etIsProperty } from '../../utilities';
import { HydrateTemplateController, IInstruction, IteratorBindingInstruction } from '../../renderer';

@@ -44,4 +42,4 @@

const wrappedExprs = [
ExpressionKind.BindingBehavior,
ExpressionKind.ValueConverter,
'BindingBehavior',
'ValueConverter',
];

@@ -92,3 +90,3 @@

} else if (command === 'bind') {
this.key = parser.parse(value, ExpressionType.IsProperty);
this.key = parser.parse(value, etIsProperty);
} else {

@@ -134,3 +132,3 @@ throw createMappedError(ErrorNames.repeat_invalid_key_binding_command, command);

const dec = forOf.declaration;
if(!(this._hasDestructuredLocal = dec.$kind === ExpressionKind.ArrayDestructuring || dec.$kind === ExpressionKind.ObjectDestructuring)) {
if(!(this._hasDestructuredLocal = dec.$kind === 'ArrayDestructuring' || dec.$kind === 'ObjectDestructuring')) {
this.local = astEvaluate(dec, this.$controller.scope, binding, null) as string;

@@ -137,0 +135,0 @@ }

@@ -9,6 +9,5 @@ import {

import {
ICollectionObserver,
CollectionKind,
type ICollectionObserver,
IObserverLocator,
Scope,
type Scope,
} from '@aurelia/runtime';

@@ -19,3 +18,3 @@ import { IRenderLocation } from '../../dom';

import { bindable } from '../../bindable';
import { BindingMode } from '../../binding/interfaces-bindings';
import { oneTime } from '../../binding/interfaces-bindings';
import { isArray } from '../../utilities';

@@ -254,3 +253,3 @@

},
mode: BindingMode.oneTime
mode: oneTime
})

@@ -261,3 +260,3 @@ public fallThrough: boolean = false;

private $switch!: Switch;
/** @internal */ private _observer: ICollectionObserver<CollectionKind.array> | undefined;
/** @internal */ private _observer: ICollectionObserver<'array'> | undefined;

@@ -264,0 +263,0 @@ /** @internal */ private readonly _factory = resolve(IViewFactory);

@@ -5,3 +5,2 @@ import {

ConnectableSwitcher,
ExpressionKind,
ProxyObservable,

@@ -158,3 +157,3 @@ } from '@aurelia/runtime';

const oldValue = this._value;
const canOptimize = expr.$kind === ExpressionKind.AccessScope && this.obs.count === 1;
const canOptimize = expr.$kind === 'AccessScope' && this.obs.count === 1;
if (!canOptimize) {

@@ -161,0 +160,0 @@ this.obs.version++;

import {
DI,
Injectable,
Registration,

@@ -13,34 +12,19 @@ type IResolver,

IOptionalResolver,
createResolver,
} from '@aurelia/kernel';
import { defineMetadata, getAnnotationKeyFor, getOwnMetadata } from './utilities-metadata';
import { objectAssign } from './utilities';
export const resource = <T extends Key>(key: T) => {
function Resolver(target: Injectable, property?: string | number, descriptor?: PropertyDescriptor | number) {
DI.inject(Resolver)(target, property, descriptor);
}
Resolver.$isResolver = true;
Resolver.resolve = (handler: IContainer, requestor: IContainer) =>
export const resource = <T extends Key>(key: T) =>
createResolver((key, handler, requestor) =>
requestor.has(key, false)
? requestor.get(key)
: requestor.root.get(key);
: requestor.root.get(key))(key);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return Resolver as IResolver<T> & ((...args: unknown[]) => any);
};
export const optionalResource = <T extends Key>(key: T) => {
return objectAssign(function Resolver(target: Injectable, property?: string | number, descriptor?: PropertyDescriptor | number) {
DI.inject(Resolver)(target, property, descriptor);
}, {
$isResolver: true,
resolve: (handler: IContainer, requestor: IContainer) =>
requestor.has(key, false)
? requestor.get(key)
: requestor.root.has(key, false)
? requestor.root.get(key)
: void 0,
}) as IOptionalResolver<T>;
};
export const optionalResource = <T extends Key>(key: T) =>
createResolver((key, handler, requestor) =>
(requestor.has(key, false)
? requestor.get(key)
: requestor.root.has(key, false)
? requestor.root.get(key)
: void 0))(key) as IOptionalResolver<T>;
/**

@@ -50,8 +34,4 @@ * A resolver builder for resolving all registrations of a key

*/
export const allResources = <T extends Key>(key: T) => {
function Resolver(target: Constructable, property?: string | number, descriptor?: PropertyDescriptor | number) {
DI.inject(Resolver)(target, property, descriptor);
}
Resolver.$isResolver = true;
Resolver.resolve = function (handler: IContainer, requestor: IContainer) {
export const allResources = <T extends Key>(key: T) =>
createResolver((key, handler, requestor) => {
if (/* is root? */requestor.root === requestor) {

@@ -64,5 +44,3 @@ return requestor.getAll(key, false);

: requestor.root.getAll(key, false);
};
return Resolver as IAllResolver<T>;
};
})(key) as IAllResolver<T>;

@@ -69,0 +47,0 @@ /** @internal */

@@ -1,2 +0,2 @@

import type { ISignaler, ISubscriber } from '@aurelia/runtime';
import { AccessorType, type ISignaler, type ISubscriber } from '@aurelia/runtime';
import type { ISVGAnalyzer } from './observation/svg-analyzer';

@@ -71,1 +71,16 @@

export const removeSignalListener = (signaler: ISignaler, signal: string, listener: ISubscriber) => signaler.removeSignalListener(signal, listener);
/** ExpressionType */
/** @internal */ export const etInterpolation = 'Interpolation' as const;
/** @internal */ export const etIsIterator = 'IsIterator' as const;
/** @internal */ export const etIsFunction = 'IsFunction' as const;
/** @internal */ export const etIsProperty = 'IsProperty' as const;
/** TaskStatus */
/** @internal */ export const tsPending = 'pending' as const;
/** @internal */ export const tsRunning = 'running' as const;
/** AccessorType */
/** @internal */ export const atObserver: AccessorType = AccessorType.Observer;
/** @internal */ export const atNode: AccessorType = AccessorType.Node;
/** @internal */ export const atLayout: AccessorType = AccessorType.Layout;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc