feat: 补充文档定义

This commit is contained in:
humphry.hy 2021-12-13 17:33:45 +08:00
parent 43a2a2ffbd
commit 1a2f82154b
3 changed files with 32 additions and 19 deletions

View File

@ -3,7 +3,7 @@ import { PropConfig } from './prop-config';
import { Snippet, ComponentMetadata } from './metadata'; import { Snippet, ComponentMetadata } from './metadata';
/** /**
* external资源的信息 * external资源的信息
*/ */
export interface Package { export interface Package {
/** /**
@ -27,11 +27,11 @@ export interface Package {
*/ */
library: string; library: string;
/** /**
* * todo
*/ */
async?: boolean; async?: boolean;
/** /**
* * window[exportName] Object
*/ */
exportName?: string; exportName?: string;
} }
@ -71,9 +71,21 @@ export interface ComponentItem {
*/ */
icon?: string; icon?: string;
/** /**
* *
*/ */
snippets?: Snippet[]; snippets?: Snippet[];
/**
*
*/
group?: string;
/**
*
*/
category?: string;
/**
*
*/
priority?: number;
} }
/** /**
@ -81,7 +93,7 @@ export interface ComponentItem {
*/ */
export interface ComponentDescription extends ComponentMetadata { export interface ComponentDescription extends ComponentMetadata {
/** /**
* * todo
*/ */
keywords: string[]; keywords: string[];
} }
@ -91,11 +103,17 @@ export interface ComponentDescription extends ComponentMetadata {
*/ */
export interface RemoteComponentDescription { export interface RemoteComponentDescription {
/** /**
* * window[exportName] Object
*/ */
exportName: string; exportName?: string;
/** /**
* *
*/ */
url: string; url?: string;
/**
* () npm
*/
package?: {
npm?: string;
};
} }

View File

@ -52,10 +52,6 @@ export interface FieldExtraProps {
display?: 'accordion' | 'inline' | 'block' | 'plain' | 'popup' | 'entry'; display?: 'accordion' | 'inline' | 'block' | 'plain' | 'popup' | 'entry';
// todo 这个 omit 是否合理? // todo 这个 omit 是否合理?
liveTextEditing?: Omit<LiveTextEditingConfig, 'propTarget'>; liveTextEditing?: Omit<LiveTextEditingConfig, 'propTarget'>;
/**
*
*/
onChange?: (value: any, field: SettingTarget) => void;
} }
export interface FieldConfig extends FieldExtraProps { export interface FieldConfig extends FieldExtraProps {
@ -82,11 +78,11 @@ export interface FieldConfig extends FieldExtraProps {
*/ */
extraProps?: FieldExtraProps; extraProps?: FieldExtraProps;
/** /**
* * todo
*/ */
description?: TitleContent; description?: TitleContent;
/** /**
* * todo
*/ */
isExtends?: boolean; isExtends?: boolean;
} }

View File

@ -120,15 +120,16 @@ export interface Experimental {
*/ */
export interface LiveTextEditingConfig { export interface LiveTextEditingConfig {
/** /**
* * todo
*/ */
propTarget: string; propTarget: string;
/** /**
* * todo
*/ */
selector?: string; selector?: string;
/** /**
* || * ||
* @default 'plaintext'
*/ */
mode?: 'plaintext' | 'paragraph' | 'article'; mode?: 'plaintext' | 'paragraph' | 'article';
/** /**
@ -247,8 +248,6 @@ export interface Callbacks {
/** /**
* hooks * hooks
*/ */
onMouseDownHook?: (e: MouseEvent, currentNode: any) => any; onMouseDownHook?: (e: MouseEvent, currentNode: any) => any;
onDblClickHook?: (e: MouseEvent, currentNode: any) => any; onDblClickHook?: (e: MouseEvent, currentNode: any) => any;
onClickHook?: (e: MouseEvent, currentNode: any) => any; onClickHook?: (e: MouseEvent, currentNode: any) => any;