| 82 | } |
| 83 | |
| 84 | export class BoundAttribute implements Node { |
| 85 | constructor( |
| 86 | public name: string, |
| 87 | public type: BindingType, |
| 88 | public securityContext: SecurityContext, |
| 89 | public value: AST, |
| 90 | public unit: string | null, |
| 91 | public sourceSpan: ParseSourceSpan, |
| 92 | readonly keySpan: ParseSourceSpan, |
| 93 | public valueSpan: ParseSourceSpan | undefined, |
| 94 | public i18n: I18nMeta | undefined, |
| 95 | ) {} |
| 96 | |
| 97 | static fromBoundElementProperty(prop: BoundElementProperty, i18n?: I18nMeta): BoundAttribute { |
| 98 | if (prop.keySpan === undefined) { |
| 99 | throw new Error( |
| 100 | `Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`, |
| 101 | ); |
| 102 | } |
| 103 | return new BoundAttribute( |
| 104 | prop.name, |
| 105 | prop.type, |
| 106 | prop.securityContext, |
| 107 | prop.value, |
| 108 | prop.unit, |
| 109 | prop.sourceSpan, |
| 110 | prop.keySpan, |
| 111 | prop.valueSpan, |
| 112 | i18n, |
| 113 | ); |
| 114 | } |
| 115 | |
| 116 | visit<Result>(visitor: Visitor<Result>): Result { |
| 117 | return visitor.visitBoundAttribute(this); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | export class BoundEvent implements Node { |
| 122 | constructor( |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…