diff --git a/src/types.ts b/src/types.ts index 8abef042..3d162e7e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -62,8 +62,8 @@ type NumberFormatBase = { displayType?: 'input' | 'text'; inputMode?: InputAttributes['inputMode']; renderText?: (formattedValue: string, otherProps: Partial) => React.ReactNode; - format: FormatInputValueFunction; - removeFormatting: RemoveFormattingFunction; + format?: FormatInputValueFunction; + removeFormatting?: RemoveFormattingFunction; getInputRef?: ((el: HTMLInputElement) => void) | React.Ref; value?: number | string | null; defaultValue?: number | string | null; @@ -75,7 +75,7 @@ type NumberFormatBase = { onChange?: InputAttributes['onChange']; onFocus?: InputAttributes['onFocus']; onBlur?: InputAttributes['onBlur']; - getCaretBoundary: (formattedValue: string) => boolean[]; + getCaretBoundary?: (formattedValue: string) => boolean[]; isValidInputCharacter?: (character: string) => boolean; }; diff --git a/test/types/number_format.spec.tsx b/test/types/number_format.spec.tsx index 52e347e0..80b61fd9 100755 --- a/test/types/number_format.spec.tsx +++ b/test/types/number_format.spec.tsx @@ -38,6 +38,7 @@ function NumberFormatBaseTest() { size="small" style={{ color: '#222' }} /> + value} /> ); }