Skip to content

Commit fd0c2d8

Browse files
committed
design: added selector interface
1 parent 33af1d0 commit fd0c2d8

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {Type, FIELD} from 'facade/lang';
2+
import {Directive} from '../annotations/directive'
3+
4+
export class AnnotatedType {
5+
constructor(annotation:Directive, type:Type) {
6+
this.annotation = annotation;
7+
this.type = type;
8+
}
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {Type} from 'facade/lang';
2+
import {Directive} from '../annotations/directive'
3+
4+
/**
5+
* Interface representing a way of extracting [Directive] annotations from
6+
* [Type]. This interface has three native implementations:
7+
*
8+
* 1) JavaScript native implementation
9+
* 2) Dart reflective implementation
10+
* 3) Dart transformer generated implementation
11+
*/
12+
export class AnnotationsExtractor {
13+
extract(type:Type):Directive {
14+
return null;
15+
}
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {Set} from 'facade/lang';
2+
//import {AnnotatedType} from './annotated_type';
3+
4+
export class Selector {
5+
constructor(directives:Set<AnnotatedType>) {
6+
this.directives = directives;
7+
}
8+
9+
/**
10+
* When presented with an element description it will return the current set of
11+
* directives which are present on the element.
12+
*
13+
* @param elementName Name of the element
14+
* @param attributes Attributes on the Element.
15+
*/
16+
visitElement(elementName:String, attributes:Map<string, string>):List<AnnotatedType> {
17+
return null;
18+
}
19+
}

modules/facade/src/collection.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
library facade.collection;
22

33
import 'dart:collection' show HashMap;
4-
export 'dart:collection' show Map;
5-
export 'dart:core' show List;
4+
export 'dart:core' show Map, List, Set;
65

76
class MapWrapper {
87
static HashMap create() => new HashMap();

modules/facade/src/collection.es6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export var List = window.Array;
22
export var Map = window.Map;
3+
export var Set = window.Set;
4+
35
export class MapWrapper {
46
static create():HashMap { return new HashMap(); }
57
static get(m, k) { return m[k]; }

0 commit comments

Comments
 (0)