import { LazyPromise } from '../lazy/promise.js'; import type { AnyObject, FunctionKeys, StringKeys } from '../types/index.js'; declare const PromiseGetter = "__promise"; type AllowedFnKeys = FunctionKeys; type PromiseProxy = StringKeys, TFnKeys = never, TWrap extends object = object> = { [K in TKeys]: T[K] extends (...args: any) => any ? (K extends TFnKeys ? T[K] : never) : T[K]; } & { readonly [PromiseGetter]: Promise; } & TWrap; type ForbiddenKeys = typeof PromiseGetter; type NoForbiddenKeys = { [K in keyof T]: K extends ForbiddenKeys ? never : T[K]; }; interface LazyPromiseCtor { new (loader: () => Promise): LazyPromise; } type Options> = { /** Function returning a promise that resolves to a proxied object */ loader: () => Promise; /** An array of keys that should be treated as functions so that they can be called before the object is resolved */ fnKeys?: TFnKeys[]; /** An object that will be used as a wrapper for the proxied object. Can contain any fields that will be copied to the resolved object */ wrap?: TWrap; /** A constructor that creates {@link {LazyPromise}} instance for handling loader */ lazy?: TLazy; }; /** * Creates a proxy object that will be resolved to the object returned by the loader function. * @param options - Options for creating the proxy, see {@link Options} * @returns a proxy object that will be resolved to the object returned by the loader function */ export declare function createPromiseProxy, TFnKeys extends AllowedFnKeys = never, TWrap extends object = object>(options: Options): PromiseProxy, TFnKeys, TWrap>; export {};