@lanaqi/rsr
Version:
32 lines (31 loc) • 851 B
TypeScript
import { type PropsWithChildren } from 'react';
import type { AccessProvider } from '../access';
import { AccessGuarderBuilder } from '../builder';
/**
* 安全打包器
*/
export type SecurityBundler = (builder: AccessGuarderBuilder) => AccessProvider;
/**
* 安全安装器
*/
export type SecurityInstaller = PropsWithChildren<{
/**
* 打包器
*/
readonly bundler: SecurityBundler;
}>;
/**
* 安全上下文
*/
export declare const SecurityContext: import("react").Context<AccessProvider | null>;
/**
* 安全上下文钩子
*/
export declare const useSecurityContext: () => AccessProvider;
/**
* 安全提供者组件
* @param children 子组件
* @param bundler 打包器
* @constructor
*/
export declare function SecurityProvider({ children, bundler }: SecurityInstaller): import("react/jsx-runtime").JSX.Element;