117 lines
1.5 KiB
TypeScript
117 lines
1.5 KiB
TypeScript
|
export interface ITocItem {
|
|||
|
/**
|
|||
|
* 锚点的 hash
|
|||
|
*/
|
|||
|
anchor: string;
|
|||
|
/**
|
|||
|
* mardkown h标签 innerHTML
|
|||
|
*/
|
|||
|
content: string;
|
|||
|
i: 0;
|
|||
|
lvl: 1;
|
|||
|
seen: 0;
|
|||
|
/**
|
|||
|
* 小写 innerHTML
|
|||
|
*/
|
|||
|
slug: "hi";
|
|||
|
/**
|
|||
|
* 高亮
|
|||
|
*/
|
|||
|
active?: boolean;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* props 注释元信息
|
|||
|
*/
|
|||
|
export interface IPropMeta {
|
|||
|
/**
|
|||
|
* 声明属性是否必须 对应 ts ?
|
|||
|
*/
|
|||
|
required?: boolean;
|
|||
|
/**
|
|||
|
* @name 参数名称
|
|||
|
*/
|
|||
|
name?: string;
|
|||
|
/**
|
|||
|
* @type 类型
|
|||
|
*/
|
|||
|
type?: string;
|
|||
|
/**
|
|||
|
* @description 说明
|
|||
|
*/
|
|||
|
description?: string;
|
|||
|
/**
|
|||
|
* @default 默认值
|
|||
|
*/
|
|||
|
default?: string;
|
|||
|
/**
|
|||
|
* @version 版本
|
|||
|
*/
|
|||
|
version?: string | number;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* 组件🎄
|
|||
|
*/
|
|||
|
export interface ICompoTree {
|
|||
|
[key: string]: ICompoMetadata;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* ICompoTree Item
|
|||
|
*/
|
|||
|
export interface ICompoMetadata {
|
|||
|
/**
|
|||
|
* 组件 props 信息
|
|||
|
*/
|
|||
|
props: IPropMeta[] | [];
|
|||
|
/**
|
|||
|
* markdown 文件目录 table of content
|
|||
|
*/
|
|||
|
toc: [];
|
|||
|
}
|
|||
|
|
|||
|
export interface ITree {
|
|||
|
/**
|
|||
|
* 组件🎄
|
|||
|
*/
|
|||
|
compoTree: ICompoTree;
|
|||
|
/**
|
|||
|
* 文件🎄,最小粒度更新
|
|||
|
*/
|
|||
|
fileTree?: {};
|
|||
|
/**
|
|||
|
* 路由🎄,根据 menuTree 生成
|
|||
|
*/
|
|||
|
routerList: IRoute[];
|
|||
|
/**
|
|||
|
* 插件配置
|
|||
|
*/
|
|||
|
config?: {
|
|||
|
title: string;
|
|||
|
subTitle: string;
|
|||
|
};
|
|||
|
}
|
|||
|
|
|||
|
export interface IRoute {
|
|||
|
name: string;
|
|||
|
path: string;
|
|||
|
active: boolean;
|
|||
|
}
|
|||
|
|
|||
|
export type TToc = {
|
|||
|
content: string;
|
|||
|
slug: string;
|
|||
|
lvl: 1 | 2;
|
|||
|
i?: number;
|
|||
|
seen?: number;
|
|||
|
active?: boolean;
|
|||
|
anchor: string;
|
|||
|
};
|
|||
|
|
|||
|
export interface ICustomPage {
|
|||
|
path: string;
|
|||
|
src: string;
|
|||
|
title: string;
|
|||
|
}
|