import { ExposedProp } from "./decorators"; export type ConsumeStrategy = { getExposedFunctions: (options: TMetaConsumeOptions) => Promise[]>; createFunction: (options: ExposedProp, meta: TMetaConsumeOptions) => Function; }; type PickOfType, TTarget> = { [key in keyof T as T[key] extends TTarget | undefined ? key : never]: T[key]; }; export type ApiClient> = { [key in keyof PickOfType]: (...args: Parameters) => ReturnType extends Promise ? ReturnType : Promise>; }; /** * Consumer for apis exposed with {@see ApiExposer}. * * A strategy that matches the strategy used to expose a target API must be provided. */ export declare class ApiConsumer { private strategy; constructor(strategy: ConsumeStrategy); /** * Consumes an api exposed using a given transport strategy, and generates a client * for easy, type safe consumption of that client. * @param options Strategy specific consumption options. * @returns An api client matching the given type. */ consume: >(options: TMetaConsumeOptions) => Promise>; } export {};