first chunk of interfaces that are valid via dart analyzer
This commit is contained in:

committed by
Tobias Bosch

parent
29c20f7a50
commit
8afa421d75
1
modules/di/src/di.js
Normal file
1
modules/di/src/di.js
Normal file
@ -0,0 +1 @@
|
||||
export * from './module';
|
24
modules/di/src/module.js
Normal file
24
modules/di/src/module.js
Normal 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) {}
|
||||
}
|
Reference in New Issue
Block a user