chore: removed angular2.api.ts

BREACKING CHANGE:

We export InjectMetadata instead of InjectAnnotation
This commit is contained in:
vsavkin
2015-07-08 12:04:24 -07:00
parent d6dadc6efc
commit b54e7214f0
25 changed files with 254 additions and 208 deletions

View File

@ -1,20 +1,102 @@
import {
InjectAnnotation,
OptionalAnnotation,
InjectableAnnotation,
VisibilityAnnotation,
SelfAnnotation,
ParentAnnotation,
AncestorAnnotation,
UnboundedAnnotation
} from './annotations';
import {makeDecorator, makeParamDecorator} from '../util/decorators';
InjectMetadata,
OptionalMetadata,
InjectableMetadata,
SelfMetadata,
VisibilityMetadata,
ParentMetadata,
AncestorMetadata,
UnboundedMetadata
} from './metadata';
import {makeDecorator, makeParamDecorator, TypeDecorator} from '../util/decorators';
export var Inject = makeParamDecorator(InjectAnnotation);
export var Optional = makeParamDecorator(OptionalAnnotation);
export var Injectable = makeDecorator(InjectableAnnotation);
export var Visibility = makeParamDecorator(VisibilityAnnotation);
export var Self = makeParamDecorator(SelfAnnotation);
export var Parent = makeParamDecorator(ParentAnnotation);
export var Ancestor = makeParamDecorator(AncestorAnnotation);
export var Unbounded = makeParamDecorator(UnboundedAnnotation);
/**
* Factory for creating {@link InjectMetadata}.
*/
export interface InjectFactory {
(token: any): any;
new (token: any): InjectMetadata;
}
/**
* Factory for creating {@link OptionalMetadata}.
*/
export interface OptionalFactory {
(): any;
new (): OptionalMetadata;
}
/**
* Factory for creating {@link InjectableMetadata}.
*/
export interface InjectableFactory {
(visibility?: VisibilityMetadata): any;
new (visibility?: VisibilityMetadata): InjectableMetadata;
}
/**
* Factory for creating {@link SelfMetadata}.
*/
export interface SelfFactory {
(): any;
new (): SelfMetadata;
}
/**
* Factory for creating {@link ParentMetadata}.
*/
export interface ParentFactory {
({self: boolean}?): any;
new ({self: boolean}?): ParentMetadata;
}
/**
* Factory for creating {@link AncestorMetadata}.
*/
export interface AncestorFactory {
({self: boolean}?): any;
new ({self: boolean}?): AncestorMetadata;
}
/**
* Factory for creating {@link UnboundedMetadata}.
*/
export interface UnboundedFactory {
({self: boolean}?): any;
new ({self: boolean}?): UnboundedMetadata;
}
/**
* Factory for creating {@link InjectMetadata}.
*/
export var Inject: InjectFactory = makeParamDecorator(InjectMetadata);
/**
* Factory for creating {@link OptionalMetadata}.
*/
export var Optional: OptionalFactory = makeParamDecorator(OptionalMetadata);
/**
* Factory for creating {@link InjectableMetadata}.
*/
export var Injectable: InjectableFactory = <InjectableFactory>makeDecorator(InjectableMetadata);
/**
* Factory for creating {@link SelfMetadata}.
*/
export var Self: SelfFactory = makeParamDecorator(SelfMetadata);
/**
* Factory for creating {@link ParentMetadata}.
*/
export var Parent: ParentFactory = makeParamDecorator(ParentMetadata);
/**
* Factory for creating {@link AncestorMetadata}.
*/
export var Ancestor: AncestorFactory = makeParamDecorator(AncestorMetadata);
/**
* Factory for creating {@link UnboundedMetadata}.
*/
export var Unbounded: UnboundedFactory = makeParamDecorator(UnboundedMetadata);