Skip to content

Commit

Permalink
fix(types): incompatibility from React-Form and Project
Browse files Browse the repository at this point in the history
Changed signature onChange and onFocus in return type
  • Loading branch information
jcspader authored and renato-bohler committed Feb 17, 2022
1 parent 9f4b143 commit 894045a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { ChangeEvent, FocusEvent } from "react";
import { EventHandler, EventWithDataHandler } from "redux-form";

declare namespace reduxFormInputMasks {
interface numberMaskOptions {
prefix?: string;
Expand Down Expand Up @@ -37,17 +40,17 @@ declare namespace reduxFormInputMasks {
interface numberMaskReturn {
format: (storeValue: number | string) => string;
normalize: (updatedValue: string, previousValue: number | string) => number | string;
onChange: (event: Event) => void,
onFocus: (event: Event) => void,
onChange: EventWithDataHandler<ChangeEvent<any>>;
onFocus: EventHandler<FocusEvent<any>>;
autoComplete: string,
}

interface textMaskReturn {
format: (storeValue: string) => string;
normalize: (updatedValue: string, previousValue: string) => string;
onKeyDown: (event: Event) => void,
onChange: (event: Event) => void,
onFocus: (event: Event) => void,
onChange: EventWithDataHandler<ChangeEvent<any>>;
onFocus: EventHandler<FocusEvent<any>>;
onClick: (event: Event) => void,
autoComplete: string,
}
Expand All @@ -56,4 +59,4 @@ declare namespace reduxFormInputMasks {
function createTextMask(options?: textMaskOptions): textMaskReturn;
}

export = reduxFormInputMasks;
export = reduxFormInputMasks;

0 comments on commit 894045a

Please sign in to comment.