UNPKG

702 BTypeScriptView Raw
1import { IComputedValueOptions } from "mobx";
2export declare type ITransformer<A, B> = (object: A) => B;
3export declare type ITransformerCleanup<A, B> = (resultObject: B | undefined, sourceObject?: A) => void;
4export declare type ITransformerParams<A, B> = {
5 onCleanup?: ITransformerCleanup<A, B>;
6 debugNameGenerator?: (sourceObject?: A) => string;
7 keepAlive?: boolean;
8} & Omit<IComputedValueOptions<B>, "name">;
9export declare function createTransformer<A, B>(transformer: ITransformer<A, B>, onCleanup?: ITransformerCleanup<A, B>): ITransformer<A, B>;
10export declare function createTransformer<A, B>(transformer: ITransformer<A, B>, arg2?: ITransformerParams<A, B>): ITransformer<A, B>;