Skip to content

Commit 2308322

Browse files
committed
v2.0.1
1 parent a2d2e5f commit 2308322

13 files changed

+9695
-1444
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v2.0.0](https://github.com/formsy/formsy-react/compare/v2.0.0-beta.8...v2.0.0)
8+
9+
> 3 February 2020
10+
11+
- Rewrite API docs to match Formsy 2.x release [`#190`](https://github.com/formsy/formsy-react/pull/190)
12+
- Add coveralls library + Travis build step [`c5b8209`](https://github.com/formsy/formsy-react/commit/c5b8209f1a405d8c772ccf1cd810d5856f32b6c3)
13+
- Collect coverage with Jest [`6bed870`](https://github.com/formsy/formsy-react/commit/6bed870280c8b6bfb24de49b5393f36bded41a6c)
14+
- Track coverage with Coveralls [`3de2810`](https://github.com/formsy/formsy-react/commit/3de2810890d4039312d2f34880aa86c8fb1548db)
15+
716
#### [v2.0.0-beta.8](https://github.com/formsy/formsy-react/compare/v2.0.0-beta.7...v2.0.0-beta.8)
817

918
> 30 January 2020

dist/Wrapper.d.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import { RequiredValidation, Validations } from './interfaces';
3+
import { RequiredValidation, ValidationError, Validations } from './interfaces';
44
declare const propTypes: {
55
innerRef: PropTypes.Requireable<(...args: any[]) => any>;
66
name: PropTypes.Validator<string>;
@@ -9,46 +9,50 @@ declare const propTypes: {
99
value: PropTypes.Requireable<any>;
1010
};
1111
export interface WrapperProps<V> {
12-
innerRef?: (ref: any) => void;
12+
innerRef?: (ref: React.Ref<any>) => void;
1313
name: string;
1414
required?: RequiredValidation<V>;
15-
validationError?: any;
16-
validationErrors?: any;
15+
validationError?: ValidationError;
16+
validationErrors?: {
17+
[key: string]: ValidationError;
18+
};
1719
validations?: Validations<V>;
1820
value?: V;
1921
}
2022
export interface WrapperState<V> {
2123
[key: string]: unknown;
22-
externalError: null;
2324
formSubmitted: boolean;
2425
isPristine: boolean;
2526
isRequired: boolean;
2627
isValid: boolean;
27-
pristineValue: any;
28-
validationError: any[];
28+
pristineValue: V;
29+
validationError: ValidationError[];
2930
value: V;
3031
}
3132
export interface InjectedProps<V> {
32-
errorMessage: any;
33-
errorMessages: any;
33+
errorMessage: ValidationError;
34+
errorMessages: ValidationError[];
3435
hasValue: boolean;
3536
isFormDisabled: boolean;
3637
isFormSubmitted: boolean;
3738
isPristine: boolean;
3839
isRequired: boolean;
3940
isValid: boolean;
4041
isValidValue: (value: V) => boolean;
41-
ref?: any;
42+
ref?: React.Ref<any>;
4243
resetValue: () => void;
4344
setValidations: (validations: Validations<V>, required: RequiredValidation<V>) => void;
4445
setValue: (value: V) => void;
4546
showError: boolean;
4647
showRequired: boolean;
4748
}
48-
export interface WrapperInstanceMethods {
49+
export interface WrapperInstanceMethods<V> {
50+
getErrorMessage: () => null | ValidationError;
51+
getErrorMessages: () => ValidationError[];
52+
getValue: () => V;
53+
isFormDisabled: () => boolean;
4954
isValid: () => boolean;
50-
getValue: () => any;
51-
getErrorMessage: () => any;
55+
setValue: (value: V) => void;
5256
}
5357
export declare type PassDownProps<V> = WrapperProps<V> & InjectedProps<V>;
5458
export { propTypes };

0 commit comments

Comments
 (0)