first chunk of interfaces that are valid via dart analyzer

This commit is contained in:
Misko Hevery
2014-09-19 16:38:37 -07:00
committed by Tobias Bosch
parent 29c20f7a50
commit 8afa421d75
40 changed files with 462 additions and 9 deletions

1
modules/di/src/di.js Normal file
View File

@ -0,0 +1 @@
export * from './module';

24
modules/di/src/module.js Normal file
View File

@ -0,0 +1,24 @@
import {Type} from 'facade/lang';
import {Map, MapWrapper wraps Map} from 'facade/collection';
/// becouse we need to know when toValue was not set.
/// (it could be that toValue is set to null or undefined in js)
var _UNDEFINED = {}
export class Module {
@FIELD('final bindings:Map<Key, Binding>')
constructor(){
this.bindings = new MapWrapper();
}
bind(type:Type,
{toValue=_UNDEFINED, toFactory, toImplementation, inject, toInstanceOf, withAnnotation}/*:
{toFactory:Function, toImplementation: Type, inject: Array, toInstanceOf:Type}*/) {}
bindByKey(key:Key,
{toValue=_UNDEFINED, toFactory, toImplementation, inject, toInstanceOf}/*:
{toFactory:Function, toImplementation: Type, inject: Array, toInstanceOf:Type}*/) {}
install(module:Module) {}
}