diff --git a/src/decorators/index.ts b/src/decorators/index.ts deleted file mode 100644 index 5e722737..00000000 --- a/src/decorators/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./resolve"; -export * from "./resolveData"; -export * from "./state"; diff --git a/src/decorators/resolve.ts b/src/decorators/resolve.ts deleted file mode 100644 index da2c60cd..00000000 --- a/src/decorators/resolve.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { StateDeclaration } from '../state/interface'; -import { isArray } from '../common/predicates'; - -export function Resolve(resolveConfig: { token?: string, deps?: any[] }): PropertyDecorator { - resolveConfig = resolveConfig || {}; - - return function(target: StateDeclaration, property) { - const resolve = target.resolve = target.resolve || []; - const token = resolveConfig.token || property; - const deps = resolveConfig.deps || []; - - if (!isArray(resolve)) { - throw new Error(`@ResolveData() only supports array style resolve: state: '${target.name}', resolve: ${property}, token: ${token}.`) - } - - resolve.push({ token, deps, resolveFn: target[property] }); - }; -} diff --git a/src/decorators/resolveData.ts b/src/decorators/resolveData.ts deleted file mode 100644 index b638e975..00000000 --- a/src/decorators/resolveData.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * An ES7 decorator which maps resolve data to a component. - * - * Add this decorator to a property of your component. - * The decorator marks the component's property to receive resolve data. - * - * When resolve data of the same name (token) is found, - * the resolve data will be assigned to the component's property. - * - * #### Example: - * - * The component's properties receive resolve data from the state definition. - * ```js - * @Component({ selector: 'foo' }) - * export class FooComponent { - * @Resolve() resolveToken1; - * @Resolve('resolveToken2') prop2; - * @Input() @Resolve() resolveToken3; - * } - * - * const fooState = { - * name: 'foo', - * component: FooComponent, - * resolve: [ - * { token: 'resolveToken1', deps: [], resolveFn: resolve1Fn }, - * { token: 'resolveToken2', deps: [], resolveFn: resolve2Fn }, - * { token: 'resolveToken3', deps: [], resolveFn: resolve3Fn }, - * ] - * } - * ``` - * - * @param token The resolve token to bind to this property - * (if omitted, the property name is used as the token) - */ -export function ResolveData(token?: string): PropertyDecorator { - return function(target, property: string) { - const inputs = target['__inputs'] = target['__inputs'] || {}; - token = token || property; - inputs[token] = property; - }; -} \ No newline at end of file diff --git a/src/decorators/state.ts b/src/decorators/state.ts deleted file mode 100644 index c9d441c9..00000000 --- a/src/decorators/state.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { isString } from '../common/predicates'; - -export function State(stateName?: string): ClassDecorator { - return function(targetClass: { new(...args: any[]): T }) { - if (isString(stateName)) targetClass.prototype.name = stateName; - targetClass['__uiRouterState'] = true; - }; -} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 1c962282..634f9861 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,6 @@ export * from "./state/index"; export * from "./transition/index"; export * from "./url/index"; export * from "./view/index"; -export * from "./decorators/index"; export * from "./globals"; export * from "./router";