2015-03-23 14:10:55 -07:00
|
|
|
import {AST} from 'angular2/change_detection';
|
2015-04-02 14:40:49 -07:00
|
|
|
import {SetterFn} from 'angular2/src/reflection/types';
|
2015-03-23 14:10:55 -07:00
|
|
|
import {List, ListWrapper} from 'angular2/src/facade/collection';
|
|
|
|
|
import * as protoViewModule from './proto_view';
|
|
|
|
|
|
|
|
|
|
export class ElementBinder {
|
|
|
|
|
contentTagSelector: string;
|
|
|
|
|
textNodeIndices: List<number>;
|
2015-05-06 11:22:28 -07:00
|
|
|
nestedProtoView: protoViewModule.DomProtoView;
|
2015-03-23 14:10:55 -07:00
|
|
|
eventLocals: AST;
|
2015-04-02 15:56:58 +02:00
|
|
|
localEvents: List<Event>;
|
|
|
|
|
globalEvents: List<Event>;
|
2015-03-23 14:10:55 -07:00
|
|
|
componentId: string;
|
2015-05-18 11:57:20 -07:00
|
|
|
parentIndex: number;
|
|
|
|
|
distanceToParent: number;
|
2015-04-02 14:40:49 -07:00
|
|
|
propertySetters: Map<string, SetterFn>;
|
2015-05-11 12:31:16 -07:00
|
|
|
hostActions: Map<string, AST>;
|
2015-03-23 14:10:55 -07:00
|
|
|
|
2015-05-27 11:52:35 -07:00
|
|
|
constructor({textNodeIndices, contentTagSelector, nestedProtoView, componentId, eventLocals,
|
|
|
|
|
localEvents, globalEvents, hostActions, parentIndex, distanceToParent,
|
|
|
|
|
propertySetters}: {
|
2015-05-18 11:57:20 -07:00
|
|
|
contentTagSelector?: string,
|
|
|
|
|
textNodeIndices?: List<number>,
|
|
|
|
|
nestedProtoView?: protoViewModule.DomProtoView,
|
|
|
|
|
eventLocals?: AST,
|
|
|
|
|
localEvents?: List<Event>,
|
|
|
|
|
globalEvents?: List<Event>,
|
|
|
|
|
componentId?: string,
|
2015-05-27 11:52:35 -07:00
|
|
|
parentIndex?: number,
|
|
|
|
|
distanceToParent?: number,
|
2015-05-18 11:57:20 -07:00
|
|
|
propertySetters?: Map<string, SetterFn>,
|
|
|
|
|
hostActions?: Map<string, AST>
|
2015-04-16 15:38:28 -07:00
|
|
|
} = {}) {
|
2015-03-23 14:10:55 -07:00
|
|
|
this.textNodeIndices = textNodeIndices;
|
|
|
|
|
this.contentTagSelector = contentTagSelector;
|
|
|
|
|
this.nestedProtoView = nestedProtoView;
|
|
|
|
|
this.componentId = componentId;
|
|
|
|
|
this.eventLocals = eventLocals;
|
2015-04-02 15:56:58 +02:00
|
|
|
this.localEvents = localEvents;
|
|
|
|
|
this.globalEvents = globalEvents;
|
2015-05-11 12:31:16 -07:00
|
|
|
this.hostActions = hostActions;
|
2015-03-23 14:10:55 -07:00
|
|
|
this.parentIndex = parentIndex;
|
|
|
|
|
this.distanceToParent = distanceToParent;
|
2015-04-02 14:40:49 -07:00
|
|
|
this.propertySetters = propertySetters;
|
2015-03-23 14:10:55 -07:00
|
|
|
}
|
|
|
|
|
}
|
2015-04-02 15:56:58 +02:00
|
|
|
|
|
|
|
|
export class Event {
|
|
|
|
|
name: string;
|
|
|
|
|
target: string;
|
|
|
|
|
fullName: string;
|
|
|
|
|
|
|
|
|
|
constructor(name: string, target: string, fullName: string) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.target = target;
|
|
|
|
|
this.fullName = fullName;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-05-11 12:31:16 -07:00
|
|
|
|
|
|
|
|
export class HostAction {
|
|
|
|
|
actionName: string;
|
|
|
|
|
actionExpression: string;
|
|
|
|
|
expression: AST;
|
|
|
|
|
|
|
|
|
|
constructor(actionName: string, actionExpression: string, expression: AST) {
|
|
|
|
|
this.actionName = actionName;
|
|
|
|
|
this.actionExpression = actionExpression;
|
|
|
|
|
this.expression = expression;
|
|
|
|
|
}
|
|
|
|
|
}
|