UNPKG

react-checker-maker

Version:

React checker maker is a lightweight package that can be used to manage privileges in [React Js](https://reactjs.org). This package utilizes [React Router Dom](https://reactrouter.com) and allows for the addition of specific privileges to routes and eleme

17 lines (16 loc) 692 B
import React, { Dispatch, FC, PropsWithChildren, SetStateAction } from 'react'; import { IUseCheckerMaker, RoutesWithPrivileges } from '../contracts'; type PrivilegeContextType = { pathname: string; store: Partial<IUseCheckerMaker>; setStore: Dispatch<SetStateAction<Record<any, any>>>; reRenderELPrivilege: () => void; fRoutes: RoutesWithPrivileges; setFRoutes: React.Dispatch<React.SetStateAction<RoutesWithPrivileges>>; reFilterRoutes: (routes: RoutesWithPrivileges) => void; }; export declare const usePrivileges: () => PrivilegeContextType; declare const PrivilegeProvider: FC<PropsWithChildren & { pathname: string; }>; export default PrivilegeProvider;