import { type IContainer, type IWithContainer } from "../container"; import { type UndefinableOptional } from "../interface"; import { type IPromiseMapper } from "../mapper"; import { type IMutationSource } from "./IMutationSource"; import { type IWithIdentity } from "./interface"; import { type IQuery } from "./IQuery"; import { type IQuerySource } from "./IQuerySource"; import { type IResolveSource } from "./IResolveSource"; export interface ISource, TItem extends Record, TQuery extends IQuery = IQuery, TCreate extends Record = any> extends IWithContainer, IMutationSource, IQuerySource, IResolveSource { /** * Name of the source. */ readonly name: string; readonly mapper: { toItem: IPromiseMapper; }; /** * Generates hash string for the given query; it's useful for generating cache key for example. */ hashOf(query: TQuery, type?: string): string; /** * Clear cache, if any. */ clearCache(): Promise; } export declare namespace InferSource { type Container = T extends ISource ? U : T; type Entity = T extends ISource ? U : T; type Item = T extends ISource ? U : T; type Query = T extends ISource ? U : T; type Create = T extends ISource ? U : T; type Patch = T extends ISource ? UndefinableOptional & IWithIdentity : T; } //# sourceMappingURL=ISource.d.ts.map