export declare type DeepPartial = Obj extends object ? { [K in keyof Obj]?: DeepPartial; } : Obj; export interface IGrammarDepend { /** * 类型 */ type: string; /** * 表述 */ intro: string; /** * 颜色 */ color: string; } export interface IGrammarEntity { word: string; type: string; } export interface IGrammarSeries { /** * 实体 */ entities: IGrammarEntity[]; /** * 关系 */ relations: { type: string; collections: number[][]; }[]; /** * 完整段落 */ sentence: string; /** * 其它配置项 */ options?: DeepPartial; } export interface IGrammarEntitiesRelation { from: number; to: number; type: string; } export interface IGrammarContext extends IGrammarSeries { entities: (IGrammarEntity & { index?: number; })[]; /** * 实体间相互关系 */ entitiesRelations?: IGrammarEntitiesRelation[]; /** * 每个实体去往其他实体的下标集合 */ relationReflect?: { from: number[]; to: number[]; all: number[]; }[]; /** * 实体间相距的最大距离 */ maxDistance?: number; distanceList?: number[]; options: Required; } export interface IGrammarStyle { /** * 线条宽度 */ lineWidth: number; /** * 线条默认颜色 */ lineDefaultColor: string; /** * 矩形边框颜色 */ borderColor: string; /** * 字体尺寸 */ fontSize: number; /** * 字体 */ fontFamily: string; /** * 文本颜色 */ color: string; /** * 渲染起始点 x */ startX: number; /** * 渲染起始点 y */ startY: number; /** * 内边距 */ padding: number; /** * 外边距 */ margin: number; /** * 最大线高度 */ maxLineHeight: number; /** * 三角标志宽度 */ triangleWidth: number; /** * tooltip 相关样式 */ tip: { color: string; lineColor: string; triangleColor: string; }; /** * 文本框内部详细样式 */ word: { color: string; borderWidth: number; borderColor: string; padding: number; margin: number; tipColor: string; backgroundColor: string; }; } export interface IGrammarOptions { /** * 自定义样式 */ style: IGrammarStyle; /** * 依赖关系 */ depends: IGrammarDepend[]; }