import { RuleValidatorFunc } from "./exampleRule"; interface BaseCache { get(modelName: string): CacheItem | undefined; set(modelName: string, example: CacheItem): void; has(modelName: string): boolean; } export declare class MockerCache implements BaseCache { private caches; get(modelName: string): CacheItem | undefined; set(modelName: string, example: CacheItem): void; has(modelName: string): boolean; checkAndCache(schema: any, example: CacheItem): void; } export declare class PayloadCache implements BaseCache { private requestCaches; private responseCaches; private mergedCaches; private hasByDirection; private setByDirection; private getByDirection; get(modelName: string): CacheItem | undefined; set(key: string, value: CacheItem): void; has(modelName: string): boolean; checkAndCache(schema: any, example: CacheItem | undefined, isRequest: boolean): void; /** * picking value priority : non-mocked value > mocked value , target value > source value * @param target The target item that to be merged into * @param source The source item that needs to merge */ mergeItem(target: CacheItem, source: CacheItem): CacheItem; /** * 1 for each request cache , if exists in response cache, merge it with response cache and put into merged cache . * 2 for each response cache, if not exists in merged cache, then put into merged cache. */ mergeCache(): void; } type CacheItemValue = string | number | object | boolean; interface CacheItemObject { [index: string]: CacheItem; } type CacheItemChild = CacheItemObject | CacheItem[]; interface CacheItemOptions { isReadonly?: boolean; isXmsSecret?: boolean; isRequired?: boolean; isWriteOnly?: boolean; } export interface CacheItem { value?: CacheItemValue; child?: CacheItemChild; options?: CacheItemOptions; isLeaf: boolean; required?: string[]; isMocked?: boolean; } export declare const buildItemOption: (schema: any) => CacheItemOptions | undefined; export declare const createLeafItem: (itemValue: CacheItemValue, option?: CacheItemOptions | undefined) => CacheItem; export declare const createTrunkItem: (itemValue: CacheItemChild, option: CacheItemOptions | undefined) => CacheItem; export declare const reBuildExample: (cache: CacheItem | undefined, isRequest: boolean, schema: any, validator: RuleValidatorFunc | undefined) => any; export {}; //# sourceMappingURL=exampleCache.d.ts.map