@empathyco/x-components
Version:
Empathy X Components
28 lines • 1.24 kB
TypeScript
import type { Dictionary } from '@empathyco/x-utils';
import type { RootXStoreState, StoreModuleStateAndGetters } from '../store/store.types';
import type { XModuleName } from '../x-modules/x-modules.types';
import type { Wiring } from './wiring.types';
/**
* Util function to generate type-safe wiring.
* If TypeScript ever accepts the PR about generic type inference this function can be removed.
*
* @param wiring - The wiring to create.
* @returns Type-safe wiring.
*
* @public
*/
export declare function createWiring<T extends Partial<Wiring>>(wiring: T): T;
/**
* Returns an object with the getters and state of a module of store defined by the moduleName
* parameter.
*
* @param state - The Vuex store State.
* @param getters - The Vuex store Getters.
* @param moduleName - The {@link XModuleName} of the module.
* @returns The {@link StoreModuleStateAndGetters} with the Getters and the State of the
* {@link XStoreModule | Store Module} defined by moduleName.
*
* @public
*/
export declare function getStateAndGettersFromModule<ModuleName extends XModuleName>(state: RootXStoreState, getters: Dictionary, moduleName: ModuleName): StoreModuleStateAndGetters<ModuleName>;
//# sourceMappingURL=wiring.utils.d.ts.map