Skip to content

Commit

Permalink
fix: solve some problems of type
Browse files Browse the repository at this point in the history
  • Loading branch information
zixiCat committed Dec 28, 2020
1 parent 1462c75 commit b86c5a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/core/verify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const initRuleFn = <T extends unknown>(
temp[i.key] = {
value: defaultValue[i.key] || null,
error: i.error || '',
trigger: i.trigger,
verify: i?.verify,
result: 'unverified',
required: !!i?.required,
Expand Down
5 changes: 2 additions & 3 deletions src/form-bunch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ export interface IFormBunchProps<T> {
setting?: IFormSetting;
/** form data */
value?: IFormValue;
className?: string;
style?: React.CSSProperties;
}

export interface IFormRuleItem {
value?: string;
error: string;
trigger?: TTrigger;
verify?: RegExp | ((value?: unknown, form?: IFormValue) => void);
result?: boolean | 'unverified';
required: boolean;
Expand All @@ -87,8 +88,6 @@ export interface IFormRule {
[x: string]: IFormRuleItem;
}

type TTrigger = 'blur' | 'change';

type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<
T,
Exclude<keyof T, Keys>
Expand Down

0 comments on commit b86c5a4

Please sign in to comment.