Skip to content

Commit

Permalink
Improved typings.
Browse files Browse the repository at this point in the history
  • Loading branch information
radekmie authored May 7, 2021
1 parent af399da commit 06f0aa6
Show file tree
Hide file tree
Showing 118 changed files with 777 additions and 733 deletions.
1,089 changes: 521 additions & 568 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"stylelint-config-prettier": "8.0.2",
"stylelint-prettier": "1.1.2",
"ts-jest": "26.4.4",
"tslib": "^1.10.0",
"typescript": "4.1.3",
"tslib": "^2.2.0",
"typescript": "4.2.4",
"universal-fetch": "1.0.0",
"warning": "^4.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/uniforms-antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"invariant": "^2.0.0",
"lodash": "^4.0.0",
"tslib": "^1.10.0",
"tslib": "^2.2.0",
"uniforms": "^3.4.0",
"warning": "^4.0.0"
}
Expand Down
3 changes: 1 addition & 2 deletions packages/uniforms-antd/src/AutoField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import invariant from 'invariant';
import { createAutoField } from 'uniforms';
export { AutoFieldProps } from 'uniforms';

import BoolField from './BoolField';
import DateField from './DateField';
Expand All @@ -10,8 +11,6 @@ import RadioField from './RadioField';
import SelectField from './SelectField';
import TextField from './TextField';

export type AutoFieldProps = Parameters<typeof AutoField>[0];

const AutoField = createAutoField(props => {
if (props.allowedValues) {
return props.checkboxes && props.fieldType !== Array
Expand Down
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/BoolField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ function Bool({
);
}

export default connectField(Bool, { kind: 'leaf' });
export default connectField<BoolFieldProps>(Bool, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ function Date({
);
}

export default connectField(Date, { kind: 'leaf' });
export default connectField<DateFieldProps>(Date, { kind: 'leaf' });
5 changes: 4 additions & 1 deletion packages/uniforms-antd/src/ErrorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ function Error({
);
}

export default connectField(Error, { initialValue: false, kind: 'leaf' });
export default connectField<ErrorFieldProps>(Error, {
initialValue: false,
kind: 'leaf',
});
5 changes: 4 additions & 1 deletion packages/uniforms-antd/src/ListAddField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ function ListAdd({
);
}

export default connectField(ListAdd, { initialValue: false, kind: 'leaf' });
export default connectField<ListAddFieldProps>(ListAdd, {
initialValue: false,
kind: 'leaf',
});
5 changes: 4 additions & 1 deletion packages/uniforms-antd/src/ListDelField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ function ListDel({
);
}

export default connectField(ListDel, { initialValue: false, kind: 'leaf' });
export default connectField<ListDelFieldProps>(ListDel, {
initialValue: false,
kind: 'leaf',
});
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/ListField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ function List({
);
}

export default connectField(List);
export default connectField<ListFieldProps>(List);
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/ListItemField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ function ListItem({
);
}

export default connectField(ListItem);
export default connectField<ListItemFieldProps>(ListItem);
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/LongTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ function LongText({ rows = 5, ...props }: LongTextFieldProps) {
);
}

export default connectField(LongText, { kind: 'leaf' });
export default connectField<LongTextFieldProps>(LongText, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/NestField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function Nest({
);
}

export default connectField(Nest);
export default connectField<NestFieldProps>(Nest);
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/NumField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function Num(props: NumFieldProps) {
);
}

export default connectField(Num, { kind: 'leaf' });
export default connectField<NumFieldProps>(Num, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/RadioField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function Radio(props: RadioFieldProps) {
);
}

export default connectField(Radio, { kind: 'leaf' });
export default connectField<RadioFieldProps>(Radio, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/SelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ function Select(props: SelectFieldProps) {
);
}

export default connectField(Select, { kind: 'leaf' });
export default connectField<SelectFieldProps>(Select, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-antd/src/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ function Text(props: TextFieldProps) {
);
}

export default connectField(Text, { kind: 'leaf' });
export default connectField<TextFieldProps>(Text, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"classnames": "^2.0.0",
"invariant": "^2.0.0",
"lodash": "^4.0.0",
"tslib": "^1.10.0",
"tslib": "^2.2.0",
"uniforms": "^3.4.0",
"warning": "^4.0.0"
}
Expand Down
3 changes: 1 addition & 2 deletions packages/uniforms-bootstrap3/src/AutoField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import invariant from 'invariant';
import { createAutoField } from 'uniforms';
export { AutoFieldProps } from 'uniforms';

import BoolField from './BoolField';
import DateField from './DateField';
Expand All @@ -10,8 +11,6 @@ import RadioField from './RadioField';
import SelectField from './SelectField';
import TextField from './TextField';

export type AutoFieldProps = Parameters<typeof AutoField>[0];

const AutoField = createAutoField(props => {
if (props.allowedValues) {
return props.checkboxes && props.fieldType !== Array
Expand Down
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/BoolField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ function Bool(props: BoolFieldProps) {
);
}

export default connectField(Bool, { kind: 'leaf' });
export default connectField<BoolFieldProps>(Bool, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ function Date({
);
}

export default connectField(Date, { kind: 'leaf' });
export default connectField<DateFieldProps>(Date, { kind: 'leaf' });
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap3/src/ErrorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ function Error({
);
}

export default connectField(Error, { initialValue: false, kind: 'leaf' });
export default connectField<ErrorFieldProps>(Error, {
initialValue: false,
kind: 'leaf',
});
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap3/src/ListAddField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ ListAdd.defaultProps = {
addIcon: <i className="glyphicon glyphicon-plus" />,
};

export default connectField(ListAdd, { initialValue: false, kind: 'leaf' });
export default connectField<ListAddFieldProps>(ListAdd, {
initialValue: false,
kind: 'leaf',
});
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap3/src/ListDelField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ ListDel.defaultProps = {
removeIcon: <i className="glyphicon glyphicon-minus" />,
};

export default connectField(ListDel, { initialValue: false, kind: 'leaf' });
export default connectField<ListDelFieldProps>(ListDel, {
initialValue: false,
kind: 'leaf',
});
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/ListField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ function List({
);
}

export default connectField(List);
export default connectField<ListFieldProps>(List);
4 changes: 3 additions & 1 deletion packages/uniforms-bootstrap3/src/ListItemField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ function ListItem({
);
}

export default connectField(ListItem, { initialValue: false });
export default connectField<ListItemFieldProps>(ListItem, {
initialValue: false,
});
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/LongTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ function LongText(props: LongTextFieldProps) {
/>,
);
}
export default connectField(LongText, { kind: 'leaf' });
export default connectField<LongTextFieldProps>(LongText, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/NestField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ const Nest = ({
</div>
);

export default connectField(Nest);
export default connectField<NestFieldProps>(Nest);
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/NumField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ function Num(props: NumFieldProps) {
);
}

export default connectField(Num, { kind: 'leaf' });
export default connectField<NumFieldProps>(Num, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/RadioField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ function Radio(props: RadioFieldProps) {
);
}

export default connectField(Radio, { kind: 'leaf' });
export default connectField<RadioFieldProps>(Radio, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/SelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ function Select({
);
}

export default connectField(Select, { kind: 'leaf' });
export default connectField<SelectFieldProps>(Select, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap3/src/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ function Text(props: TextFieldProps) {
);
}

export default connectField(Text, { kind: 'leaf' });
export default connectField<TextFieldProps>(Text, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"classnames": "^2.0.0",
"invariant": "^2.0.0",
"lodash": "^4.0.0",
"tslib": "^1.10.0",
"tslib": "^2.2.0",
"uniforms": "^3.4.0",
"warning": "^4.0.0"
}
Expand Down
3 changes: 1 addition & 2 deletions packages/uniforms-bootstrap4/src/AutoField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import invariant from 'invariant';
import { createAutoField } from 'uniforms';
export { AutoFieldProps } from 'uniforms';

import BoolField from './BoolField';
import DateField from './DateField';
Expand All @@ -10,8 +11,6 @@ import RadioField from './RadioField';
import SelectField from './SelectField';
import TextField from './TextField';

export type AutoFieldProps = Parameters<typeof AutoField>[0];

const AutoField = createAutoField(props => {
if (props.allowedValues) {
return props.checkboxes && props.fieldType !== Array
Expand Down
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/BoolField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ function Bool({ onChange, ...props }: BoolFieldProps) {
);
}

export default connectField(Bool, { kind: 'leaf' });
export default connectField<BoolFieldProps>(Bool, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ function Date({
);
}

export default connectField(Date, { kind: 'leaf' });
export default connectField<DateFieldProps>(Date, { kind: 'leaf' });
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap4/src/ErrorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ function Error({
);
}

export default connectField(Error, { initialValue: false, kind: 'leaf' });
export default connectField<ErrorFieldProps>(Error, {
initialValue: false,
kind: 'leaf',
});
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap4/src/ListAddField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ function ListAdd({

ListAdd.defaultProps = { addIcon: <i className="octicon octicon-plus" /> };

export default connectField(ListAdd, { initialValue: false, kind: 'leaf' });
export default connectField<ListAddFieldProps>(ListAdd, {
initialValue: false,
kind: 'leaf',
});
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap4/src/ListDelField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ ListDel.defaultProps = {
removeIcon: <i className="octicon octicon-dash" />,
};

export default connectField(ListDel, { initialValue: false, kind: 'leaf' });
export default connectField<ListDelFieldProps>(ListDel, {
initialValue: false,
kind: 'leaf',
});
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/ListField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ function List({
);
}

export default connectField(List);
export default connectField<ListFieldProps>(List);
4 changes: 3 additions & 1 deletion packages/uniforms-bootstrap4/src/ListItemField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ function ListItem({
);
}

export default connectField(ListItem, { initialValue: false });
export default connectField<ListItemFieldProps>(ListItem, {
initialValue: false,
});
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/LongTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ function LongText(props: LongTextFieldProps) {
);
}

export default connectField(LongText, { kind: 'leaf' });
export default connectField<LongTextFieldProps>(LongText, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/NestField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ function Nest({
);
}

export default connectField(Nest);
export default connectField<NestFieldProps>(Nest);
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/NumField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ function Num(props: NumFieldProps) {
);
}

export default connectField(Num, { kind: 'leaf' });
export default connectField<NumFieldProps>(Num, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/RadioField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ function Radio(props: RadioFieldProps) {
);
}

export default connectField(Radio, { kind: 'leaf' });
export default connectField<RadioFieldProps>(Radio, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/SelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ function Select({
);
}

export default connectField(Select, { kind: 'leaf' });
export default connectField<SelectFieldProps>(Select, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap4/src/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function Text(props: TextFieldProps) {
);
}

export default connectField(Text, { kind: 'leaf' });
export default connectField<TextFieldProps>(Text, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"classnames": "^2.0.0",
"invariant": "^2.0.0",
"lodash": "^4.0.0",
"tslib": "^1.10.0",
"tslib": "^2.2.0",
"uniforms": "^3.4.0",
"warning": "^4.0.0"
}
Expand Down
3 changes: 1 addition & 2 deletions packages/uniforms-bootstrap5/src/AutoField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import invariant from 'invariant';
import { createAutoField } from 'uniforms';
export { AutoFieldProps } from 'uniforms';

import BoolField from './BoolField';
import DateField from './DateField';
Expand All @@ -10,8 +11,6 @@ import RadioField from './RadioField';
import SelectField from './SelectField';
import TextField from './TextField';

export type AutoFieldProps = Parameters<typeof AutoField>[0];

const AutoField = createAutoField(props => {
if (props.allowedValues) {
return props.checkboxes && props.fieldType !== Array
Expand Down
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap5/src/BoolField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ function Bool({ onChange, ...props }: BoolFieldProps) {
);
}

export default connectField(Bool, { kind: 'leaf' });
export default connectField<BoolFieldProps>(Bool, { kind: 'leaf' });
2 changes: 1 addition & 1 deletion packages/uniforms-bootstrap5/src/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ function Date({
);
}

export default connectField(Date, { kind: 'leaf' });
export default connectField<DateFieldProps>(Date, { kind: 'leaf' });
5 changes: 4 additions & 1 deletion packages/uniforms-bootstrap5/src/ErrorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ function Error({
);
}

export default connectField(Error, { initialValue: false, kind: 'leaf' });
export default connectField<ErrorFieldProps>(Error, {
initialValue: false,
kind: 'leaf',
});
Loading

0 comments on commit 06f0aa6

Please sign in to comment.