diff --git a/src/deprecated.js b/src/deprecated.js index 46ab119..7d6a479 100644 --- a/src/deprecated.js +++ b/src/deprecated.js @@ -16,7 +16,7 @@ interface DeprecatedOptions { * Decorator: Enables marking methods as deprecated. * @param optionsOrTarget Options for how the deprected decorator should function at runtime. */ -export function deprecated(optionsOrTarget?: DeprecatedOptions, maybeKey?: string, maybeDescriptor?: Object) { +export function deprecated(optionsOrTarget?: DeprecatedOptions, maybeKey?: string, maybeDescriptor?: Object): any { function decorator(target, key, descriptor) { const methodSignature = `${target.constructor.name}#${key}`; let options = maybeKey ? {} : optionsOrTarget || {}; diff --git a/src/mixin.js b/src/mixin.js index 30d2bcf..e8e5b50 100644 --- a/src/mixin.js +++ b/src/mixin.js @@ -2,7 +2,7 @@ * Decorator: Enables mixing behaior into a class. * @param behavior An object with keys for each method to mix into the target class. */ -export function mixin(behavior: Object) { +export function mixin(behavior: Object): any { const instanceKeys = Object.keys(behavior); function _mixin(possible) { diff --git a/src/protocol.js b/src/protocol.js index 1017bbd..5f2d927 100644 --- a/src/protocol.js +++ b/src/protocol.js @@ -57,7 +57,7 @@ interface ProtocolOptions { * @param name The name of the protocol. * @param options The validation function or options object used in configuring the protocol. */ -export function protocol(name: string, options?: ((target: any) => string | boolean) | ProtocolOptions) { +export function protocol(name: string, options?: ((target: any) => string | boolean) | ProtocolOptions): any { options = ensureProtocolOptions(options); let result = function(target) { @@ -86,8 +86,9 @@ export function protocol(name: string, options?: ((target: any) => string | bool * Creates a protocol decorator. * @param name The name of the protocol. * @param options The validation function or options object used in configuring the protocol. +* @return The protocol decorator; */ -protocol.create = function(name: string, options?: ((target: any) => string | boolean) | ProtocolOptions) { +protocol.create = function(name: string, options?: ((target: any) => string | boolean) | ProtocolOptions): Function { options = ensureProtocolOptions(options); let hidden = 'protocol:' + name; let result = function(target) {