UNPKG

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