Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webstorm): fix ts type prompt #563

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { tooltipProps } from '../tooltip';
import { TooltipProps } from '../tooltip';
import { TNode } from '../common';

export interface TdTextProps {
Expand Down Expand Up @@ -128,7 +128,7 @@ export interface TypographyEllipsis {
/**
* 光标在省略图标上出现的tooltip的配置
*/
tooltipProps?: tooltipProps;
tooltipProps?: TooltipProps;
/**
* 点击省略按钮的回调
*/
Expand All @@ -148,7 +148,7 @@ export interface TypographyCopyable {
/**
* 光标在复制图标上出现的tooltip的配置
*/
tooltipProps?: tooltipProps;
tooltipProps?: TooltipProps;
/**
* 点击复制按钮的回调
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ collapsible | Boolean | true | collapsible after expanding | N
expandable | Boolean | true | expandable | N
row | Number | 1 | default row number of ellipsis | N
suffix | TElement | - | custom element configuration for ellipsis and collapse icon。Typescript:`TNode<{ expanded: boolean }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
tooltipProps | Object | - | Configuration of the tooltip that appears on the ellipsis icon when the cursor is over it。Typescript:`tooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
tooltipProps | Object | - | Configuration of the tooltip that appears on the ellipsis icon when the cursor is over it。Typescript:`TooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
onExpand | Function | | Typescript:`(expanded:boolean) => void`<br/> | N

### TypographyCopyable
Expand All @@ -61,5 +61,5 @@ name | type | default | description | required
-- | -- | -- | -- | --
text | String | - | copied content | N
suffix | TElement | - | custom element configuration for copy icon。Typescript:`TNode<{ copied: boolean }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
tooltipProps | Object | - | Configuration of the tooltip that appears on the copy icon when the cursor is over it。Typescript:`tooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
tooltipProps | Object | - | Configuration of the tooltip that appears on the copy icon when the cursor is over it。Typescript:`TooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
onCopy | Function | | Typescript:`() => void`<br/> | N
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ collapsible | Boolean | true | 展开后是否可以重新收起 | N
expandable | Boolean | true | 是否可展开 | N
row | Number | 1 | 省略配置默认展示行数 | N
suffix | TElement | - | 自定义省略触发元素,一般用于自定义折叠图标。TS 类型:`TNode<{ expanded: boolean }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
tooltipProps | Object | - | 光标在省略图标上出现的tooltip的配置。TS 类型:`tooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
tooltipProps | Object | - | 光标在省略图标上出现的tooltip的配置。TS 类型:`TooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
onExpand | Function | | TS 类型:`(expanded:boolean) => void`<br/>点击省略按钮的回调 | N

### TypographyCopyable
Expand All @@ -61,5 +61,5 @@ onExpand | Function | | TS 类型:`(expanded:boolean) => void`<br/>点击省
-- | -- | -- | -- | --
text | String | - | 复制的文本内容,默认为全部文本 | N
suffix | TElement | - | 自定义复制触发元素,一般用于自定义复制图标。TS 类型:`TNode<{ copied: boolean }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
tooltipProps | Object | - | 光标在复制图标上出现的tooltip的配置。TS 类型:`tooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
tooltipProps | Object | - | 光标在复制图标上出现的tooltip的配置。TS 类型:`TooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/typography/type.ts) | N
onCopy | Function | | TS 类型:`() => void`<br/>点击复制按钮的回调 | N

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,60 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { tooltipProps } from '../tooltip';
import { TooltipProps } from '../tooltip';
import { TNode } from '../common';

export interface TdTextProps {
export interface TypographyEllipsis {
/**
* 展开后是否可以重新收起
* @default true
*/
collapsible?: boolean;
/**
* 是否可展开
* @default true
*/
expandable?: boolean;
/**
* 省略配置默认展示行数
* @default 1
*/
row?: number;
/**
* 自定义省略触发元素,一般用于自定义折叠图标
*/
suffix?: TNode<{ expanded: boolean }>;
/**
* 光标在省略图标上出现的tooltip的配置
*/
tooltipProps?: TooltipProps;
/**
* 点击省略按钮的回调
*/
onExpand?: (expanded: boolean) => void;
}

export interface TypographyCopyable {
/**
* 复制的文本内容,默认为全部文本
* @default ''
*/
text?: string;
/**
* 自定义复制触发元素,一般用于自定义复制图标
*/
suffix?: TNode<{ copied: boolean }>;
/**
* 光标在复制图标上出现的tooltip的配置
*/
tooltipProps?: TooltipProps;
/**
* 点击复制按钮的回调
*/
onCopy?: () => void;
}

export interface TdTypographyTextProps {
/**
* 是否添加代码样式
* @default false
Expand Down Expand Up @@ -72,7 +122,7 @@ export interface TdTextProps {
underline?: boolean;
}

export interface TdTitleProps {
export interface TdTypographyTitleProps {
/**
* 段落内容
*/
Expand All @@ -93,7 +143,7 @@ export interface TdTitleProps {
level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
}

export interface TdParagraphProps {
export interface TdTypographyParagraphProps {
/**
* 段落内容
*/
Expand All @@ -108,53 +158,3 @@ export interface TdParagraphProps {
*/
ellipsis?: boolean | TypographyEllipsis;
}

export interface TypographyEllipsis {
/**
* 展开后是否可以重新收起
* @default true
*/
collapsible?: boolean;
/**
* 是否可展开
* @default true
*/
expandable?: boolean;
/**
* 省略配置默认展示行数
* @default 1
*/
row?: number;
/**
* 自定义省略触发元素,一般用于自定义折叠图标
*/
suffix?: TNode<{ expanded: boolean }>;
/**
* 光标在省略图标上出现的tooltip的配置
*/
tooltipProps?: tooltipProps;
/**
* 点击省略按钮的回调
*/
onExpand?: (expanded: boolean) => void;
}

export interface TypographyCopyable {
/**
* 复制的文本内容,默认为全部文本
* @default ''
*/
text?: string;
/**
* 自定义复制触发元素,一般用于自定义复制图标
*/
suffix?: TNode<{ copied: boolean }>;
/**
* 光标在复制图标上出现的tooltip的配置
*/
tooltipProps?: tooltipProps;
/**
* 点击复制按钮的回调
*/
onCopy?: () => void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdParagraphProps } from '../typography/type';
import { TdTypographyParagraphProps } from '../typography/type';
import { PropType } from 'vue';

export default {
/** 段落内容 */
content: {
type: [String, Function] as PropType<TdParagraphProps['content']>,
type: [String, Function] as PropType<TdTypographyParagraphProps['content']>,
},
/** 段落内容 */
default: {
type: [String, Function] as PropType<TdParagraphProps['default']>,
type: [String, Function] as PropType<TdTypographyParagraphProps['default']>,
},
/** 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式 */
ellipsis: {
type: [Boolean, Object] as PropType<TdParagraphProps['ellipsis']>,
default: false as TdParagraphProps['ellipsis'],
type: [Boolean, Object] as PropType<TdTypographyParagraphProps['ellipsis']>,
default: false as TdTypographyParagraphProps['ellipsis'],
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdTextProps } from '../typography/type';
import { TdTypographyTextProps } from '../typography/type';
import { PropType } from 'vue';

export default {
/** 是否添加代码样式 */
code: Boolean,
/** 文本内容 */
content: {
type: [String, Function] as PropType<TdTextProps['content']>,
type: [String, Function] as PropType<TdTypographyTextProps['content']>,
},
/** 是否可复制,可通过配置参数自定义复制操作的具体功能和样式 */
copyable: {
type: [Boolean, Object] as PropType<TdTextProps['copyable']>,
default: false as TdTextProps['copyable'],
type: [Boolean, Object] as PropType<TdTypographyTextProps['copyable']>,
default: false as TdTypographyTextProps['copyable'],
},
/** 文本内容 */
default: {
type: [String, Function] as PropType<TdTextProps['default']>,
type: [String, Function] as PropType<TdTypographyTextProps['default']>,
},
/** 是否添加删除线样式 */
delete: Boolean,
/** 是否添加不可用样式 */
disabled: Boolean,
/** 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式 */
ellipsis: {
type: [Boolean, Object] as PropType<TdTextProps['ellipsis']>,
default: false as TdTextProps['ellipsis'],
type: [Boolean, Object] as PropType<TdTypographyTextProps['ellipsis']>,
default: false as TdTypographyTextProps['ellipsis'],
},
/** 文本是否为斜体 */
italic: Boolean,
/** 是否添加键盘样式 */
keyboard: Boolean,
/** 是否添加标记样式,默认为黄色,可通过配置颜色修改标记样式,如#0052D9 */
mark: {
type: [String, Boolean] as PropType<TdTextProps['mark']>,
default: false as TdTextProps['mark'],
type: [String, Boolean] as PropType<TdTypographyTextProps['mark']>,
default: false as TdTypographyTextProps['mark'],
},
/** 文本是否加粗 */
strong: Boolean,
/** 主题 */
theme: {
type: String as PropType<TdTextProps['theme']>,
validator(val: TdTextProps['theme']): boolean {
type: String as PropType<TdTypographyTextProps['theme']>,
validator(val: TdTypographyTextProps['theme']): boolean {
if (!val) return true;
return ['primary', 'secondary', 'success', 'warning', 'error'].includes(val);
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-disable */

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TdTypographyTitleProps } from '../typography/type';
import { PropType } from 'vue';

export default {
/** 段落内容 */
content: {
type: [String, Function] as PropType<TdTypographyTitleProps['content']>,
},
/** 标题内容 */
default: {
type: [String, Function] as PropType<TdTypographyTitleProps['default']>,
},
/** 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式 */
ellipsis: {
type: [Boolean, Object] as PropType<TdTypographyTitleProps['ellipsis']>,
default: false as TdTypographyTitleProps['ellipsis'],
},
/** 标题等级 */
level: {
type: String as PropType<TdTypographyTitleProps['level']>,
default: 'h1' as TdTypographyTitleProps['level'],
validator(val: TdTypographyTitleProps['level']): boolean {
if (!val) return true;
return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(val);
},
},
};
Loading