formik
Advanced tools
Comparing version 2.3.2 to 2.3.3
@@ -15,7 +15,7 @@ import * as React from 'react'; | ||
} & SharedRenderProps<FieldArrayRenderProps>; | ||
export interface ArrayHelpers<T = unknown[]> { | ||
export interface ArrayHelpers<T extends any[] = any[]> { | ||
/** Imperatively add a value to the end of an array */ | ||
push: (obj: T) => void; | ||
push<X = T[number]>(obj: X): void; | ||
/** Curried fn to add a value to the end of an array */ | ||
handlePush: (obj: T) => () => void; | ||
handlePush<X = T[number]>(obj: X): () => void; | ||
/** Imperatively swap two values in an array */ | ||
@@ -30,13 +30,13 @@ swap: (indexA: number, indexB: number) => void; | ||
/** Imperatively insert an element at a given index into the array */ | ||
insert: (index: number, value: T) => void; | ||
insert<X = T[number]>(index: number, value: X): void; | ||
/** Curried fn to insert an element at a given index into the array */ | ||
handleInsert: (index: number, value: T) => () => void; | ||
handleInsert<X = T[number]>(index: number, value: X): () => void; | ||
/** Imperatively replace a value at an index of an array */ | ||
replace: (index: number, value: T) => void; | ||
replace<X = T[number]>(index: number, value: X): void; | ||
/** Curried fn to replace an element at a given index into the array */ | ||
handleReplace: (index: number, value: T) => () => void; | ||
handleReplace<X = T[number]>(index: number, value: X): () => void; | ||
/** Imperatively add an element to the beginning of an array and return its length */ | ||
unshift: (value: T) => number; | ||
unshift<X = T[number]>(value: X): number; | ||
/** Curried fn to add an element to the beginning of an array */ | ||
handleUnshift: (value: T) => () => void; | ||
handleUnshift<X = T[number]>(value: X): () => void; | ||
/** Curried fn to remove an element at an index of an array */ | ||
@@ -47,5 +47,5 @@ handleRemove: (index: number) => () => void; | ||
/** Imperatively remove and element at an index of an array */ | ||
remove<T>(index: number): T | undefined; | ||
remove<X = T[number]>(index: number): X | undefined; | ||
/** Imperatively remove and return value from the end of the array */ | ||
pop<T>(): T | undefined; | ||
pop<X = T[number]>(): X | undefined; | ||
} | ||
@@ -52,0 +52,0 @@ /** |
{ | ||
"name": "formik", | ||
"description": "Build forms in React, without the tears", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "author": "Jared Palmer <jared@palmer.net> (https://jaredpalmer.com)", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
589864