Open Nokel81 opened 1 year ago
As the types for observable.array, observable.map, observable.set, and observable.object all imply:
observable.array
observable.map
observable.set
observable.object
export declare type CreateObservableOptions = { name?: string; equals?: IEqualsComparer<any>; deep?: boolean; defaultDecorator?: Annotation; proxy?: boolean; autoBind?: boolean; }; export declare const defaultCreateObservableOptions: CreateObservableOptions; export declare function asCreateObservableOptions(thing: any): CreateObservableOptions; export declare function getEnhancerFromOptions(options: CreateObservableOptions): IEnhancer<any>; export declare function getAnnotationFromOptions(options?: CreateObservableOptions): Annotation | undefined; export declare function getEnhancerFromAnnotation(annotation?: Annotation): IEnhancer<any>; export interface IObservableValueFactory { <T>(value: T, options?: CreateObservableOptions): IObservableValue<T>; <T>(value?: T, options?: CreateObservableOptions): IObservableValue<T | undefined>; } export interface IObservableFactory extends Annotation, PropertyDecorator { <T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>; <T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>; <K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>; <T extends object>(value: T, decorators?: AnnotationsMap<T, never>, options?: CreateObservableOptions): T; box: IObservableValueFactory; array: <T = any>(initialValues?: T[], options?: CreateObservableOptions) => IObservableArray<T>; set: <T = any>(initialValues?: IObservableSetInitialValues<T>, options?: CreateObservableOptions) => ObservableSet<T>; map: <K = any, V = any>(initialValues?: IObservableMapInitialValues<K, V>, options?: CreateObservableOptions) => ObservableMap<K, V>; object: <T = any>(props: T, decorators?: AnnotationsMap<T, never>, options?: CreateObservableOptions) => T; /** * Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts. */ ref: Annotation & PropertyDecorator; /** * Decorator that creates an observable converts its value (objects, maps or arrays) into a shallow observable structure */ shallow: Annotation & PropertyDecorator; deep: Annotation & PropertyDecorator; struct: Annotation & PropertyDecorator; }
all of the fields within CreateObservableOptions should apply to all the methods there, or else they should replay on different types.
CreateObservableOptions
equals should only be at box and observable(primitive | function). autoBind, deep, defaultDecorator are probably irrelevant for some of these as well. PR welcome.
equals
box
observable(primitive | function)
autoBind
deep
defaultDecorator
As the types for
observable.array
,observable.map
,observable.set
, andobservable.object
all imply:all of the fields within
CreateObservableOptions
should apply to all the methods there, or else they should replay on different types.