diff --git a/flow-typed/mobx.js b/flow-typed/mobx.js index b5e658d22..67cd3ee3a 100644 --- a/flow-typed/mobx.js +++ b/flow-typed/mobx.js @@ -1,11 +1,5 @@ // @flow -export type CreateObservableOptions = { - name?: string, - deep?: boolean, - defaultDecorator?: any -} - export type IObservableMapInitialValues = IMapEntries | KeyValueMap | IMap export interface IMobxConfigurationOptions { @@ -239,6 +233,17 @@ export interface IObservableFactory { (value: T): T } +export type IObservableDecorator = { + (target: Object, property: string, descriptor?: PropertyDescriptor): void, + enhancer: IEnhancer +} + +export type CreateObservableOptions = { + name?: string, + deep?: boolean, + defaultDecorator?: IObservableDecorator +} + declare export class IObservableFactories { box(value?: T, options?: CreateObservableOptions): IObservableValue, array(initialValues?: T[], options?: CreateObservableOptions): IObservableArray, @@ -247,9 +252,13 @@ declare export class IObservableFactories { options?: CreateObservableOptions ): ObservableMap, object(props: T, options?: CreateObservableOptions): T & IObservableObject, - ref(target: Object, property?: string, descriptor?: PropertyDescriptor): any, - shallow(target: Object, property?: string, descriptor?: PropertyDescriptor): any, - deep(target: Object, property?: string, descriptor?: PropertyDescriptor): any + ref(target: Object, property?: string, descriptor?: PropertyDescriptor): IObservableDecorator, + shallow( + target: Object, + property?: string, + descriptor?: PropertyDescriptor + ): IObservableDecorator, + deep(target: Object, property?: string, descriptor?: PropertyDescriptor): IObservableDecorator } export interface Iterator {