diff --git a/packages/form-render-react/src/typings/index.d.ts b/packages/form-render-react/src/typings/index.d.ts index 06a86f5..ff21a02 100644 --- a/packages/form-render-react/src/typings/index.d.ts +++ b/packages/form-render-react/src/typings/index.d.ts @@ -78,7 +78,7 @@ export type IFormRenderProps = IPartPartial< /** * 表单描述协议,带内置渲染器类型提示 */ - schema: IFormRenderRootSchema + schema: IFormRenderRootSchema /** * FormRender 根节点样式名 diff --git a/packages/search-react/src/utils/createDisplayedSchema.ts b/packages/search-react/src/utils/createDisplayedSchema.ts index a6d5b4b..c3e1279 100644 --- a/packages/search-react/src/utils/createDisplayedSchema.ts +++ b/packages/search-react/src/utils/createDisplayedSchema.ts @@ -1,5 +1,7 @@ import type { IFormRenderRootSchema } from '@schema-render/form-render-react' +type IRootSchema = IFormRenderRootSchema + /** * 创建折叠的 Schema * @param rawSchema 原始 Schema @@ -7,10 +9,10 @@ import type { IFormRenderRootSchema } from '@schema-render/form-render-react' * @returns 折叠的 Schema */ function createCollapsedSchema( - rawSchema: IFormRenderRootSchema, + rawSchema: IRootSchema, collapsedNumber: number -): IFormRenderRootSchema { - const collapsedProps: IFormRenderRootSchema['properties'] = {} +): IRootSchema { + const collapsedProps: IRootSchema['properties'] = {} const displayedKeys = Object.keys(rawSchema.properties).slice(0, collapsedNumber) for (const key of displayedKeys) { @@ -31,7 +33,7 @@ interface ICreateSearchSchema { /** * 原始 Schema */ - rawSchema: IFormRenderRootSchema + rawSchema: IRootSchema /** * 折叠的个数 */