@lomray/react-mobx-manager
Version:
This package provides Mobx stores manager for react.
44 lines (43 loc) • 1.02 kB
TypeScript
type ICache = Map<string, {
storeId: string;
classname: string;
}>;
/**
* Load cached store id's by file name
*/
declare const loadCache: (isProd?: boolean) => ICache;
/**
* Save store id's cache
*/
declare const saveCache: (cache: ICache) => void;
/**
* Get next letter
*/
declare const getNextLetter: (str?: string) => string;
/**
* Store is generator
*/
declare class Generator {
cache: ICache;
protected root: string;
protected lastId: string;
// keep last generated production store id (letter)
constructor(root: string, isProd?: boolean);
/**
* Inject store id
*/
injectId: (code: string, fileId: string) => string;
/**
* Get development id
*/
getDevId: (id: string, classname: string) => string;
/**
* Get production store id
*/
getProdId: () => string;
/**
* Try to find mobx store
*/
matchMobxStore: (code: string) => string | undefined;
}
export { saveCache, loadCache, getNextLetter, Generator };