Skip to content

Commit

Permalink
feat(Core): add IPartPartial instead of IOptional
Browse files Browse the repository at this point in the history
  • Loading branch information
Barrior committed Jan 22, 2024
1 parent 4ea3cbb commit 6b3cbbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/core-react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type {
IMaybePromise,
IObjectAny,
IOptional,
IPartPartial,
IPartRequired,
IPath,
IWriteable,
Expand Down
8 changes: 7 additions & 1 deletion packages/core-react/src/typings/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ export type IPartRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T,
/**
* 让对象属性部分可选
*/
export type IOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
export type IPartPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>

/**
* 让对象属性部分可选
* @deprecated please use IPartPartial
*/
export type IOptional<T, K extends keyof T> = IPartPartial<T, K>

/**
* 让对象属性去掉只读限制
Expand Down
4 changes: 2 additions & 2 deletions packages/form-render-react/src/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
IMaybePromise,
IObjectAny,
IOpenItemLayoutParams,
IOptional,
IPartPartial,
IPartRequired,
IRootSchema,
} from '@schema-render/core-react'
Expand Down Expand Up @@ -71,7 +71,7 @@ export type ILabelRender = (
/**
* FormRender 参数配置
*/
export type IFormRenderProps = IOptional<
export type IFormRenderProps = IPartPartial<
Omit<ICore, 'itemLayout' | 'locale'>,
'renderers'
> & {
Expand Down

0 comments on commit 6b3cbbf

Please sign in to comment.