overmind
Version:
Frictionless state management
30 lines (29 loc) • 946 B
TypeScript
import { IAction } from "../types.js";
import { SubType } from "../internalTypes.js";
//#region src/config/lazy.d.ts
interface LazyConfiguration {
[namespace: string]: () => Promise<{
state?: {};
effects?: {};
actions?: {};
reactions?: {};
}>;
}
declare function lazy<T extends LazyConfiguration>(configurations: T): {
state: SubType<{ [P in keyof T]?: ReturnType<T[P]> extends Promise<infer U> ? U extends {
state: any;
} ? U['state'] : never : never }, object>;
effects: SubType<{ [P in keyof T]?: ReturnType<T[P]> extends Promise<infer U> ? U extends {
effects: any;
} ? U['effects'] : never : never }, object>;
actions: SubType<{ [P in keyof T]?: ReturnType<T[P]> extends Promise<infer U> ? U extends {
actions: any;
} ? U['actions'] : never : never }, object> & {
lazy: {
loadConfig: IAction<keyof T, any>;
};
};
};
//#endregion
export { lazy };
//# sourceMappingURL=lazy.d.ts.map