export declare type UndefinedDeepReturnTypes = { [P in keyof T]: T[P] extends (...args: any[]) => any ? ReturnType | undefined : UndefinedDeepReturnTypes; }; interface SpecialData { key: string; value: string; } declare type Store = Partial>>; interface DataLoaders { [key: string]: Promise; } declare type ContextContructor = new (subStore: Store, dataLoaders: DataLoaders, specialData: SpecialData[], specialKeyPrefix: string) => Context; /** * This class can be used to build and use a context containing all type-safe required data. */ export default class Context { protected readonly store: Store; private dataLoaders; private readonly specialData; private readonly specialKeyPrefix; constructor(); constructor(store: Store, dataLoaders: DataLoaders, specialData: SpecialData[], specialKeyPrefix: string); /** * Create a `variable=value` with value containing all the context. * * @param variable - The variable in which to render context. * @returns The created string. */ stringify(variable: string): string; /** * Read the loading data promise. The promise array will be cleaned once resolved or rejected. * * @returns A promise which, if resolved, indicate if a new rendering is needed. If rejected, will probably indicate * the HTTP error code. */ get loadingData(): Promise; protected readLoadedData, U extends any[]>(data: D, dataLoader: ((...params: U) => Promise>[D]>) | undefined, defaultValue: Required>[D], ...params: U): Required>[D]; protected addSpecialData(key: string, value: string): void; protected getSubElement[K]>>(key: K, constructor: ContextContructor[K]>): S; } export {};