Files
leaudit-platform-frontend/app/contexts/RuleContext.tsx
T

26 lines
546 B
TypeScript

import { createContext } from 'react';
/**
* 规则上下文类型
* 用于在抽取设置和评查设置之间共享数据
*/
export interface RuleContextType {
/**
* 抽取的字段列表
*/
extractionFields: string[];
/**
* 更新字段列表的函数
*/
updateFields: (fields: string[]) => void;
}
/**
* 创建规则上下文
* 用于在抽取设置和评查设置组件之间共享字段数据
*/
export const RuleContext = createContext<RuleContextType>({
extractionFields: [],
updateFields: () => {}
});