mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Fixed lint errors.
This commit is contained in:
+8
-8
@@ -1,8 +1,8 @@
|
||||
// Type definitions for react-material-ui-form-validator v2.0.3
|
||||
// Type definitions for react-material-ui-form-validator 2.0
|
||||
// Project: https://github.com/NewOldMax/react-material-ui-form-validator
|
||||
// Definitions by: Frank Brullo <https://github.com/FrankBrullo/>
|
||||
// Definitions by: Frank Brullo <https://github.com/FrankBrullo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.1.3
|
||||
// TypeScript Version: 3.1
|
||||
|
||||
import * as React from "react";
|
||||
import { TextFieldProps } from "material-ui";
|
||||
@@ -11,13 +11,13 @@ export interface ValidatorFormProps {
|
||||
className?: string;
|
||||
onSubmit: (event: React.FormEventHandler) => void;
|
||||
instantValidate?: boolean;
|
||||
onError?: (errors: any[]) => {};
|
||||
onError?: (errors: any[]) => void;
|
||||
debounceTime?: number;
|
||||
}
|
||||
export class ValidatorForm extends React.Component<ValidatorFormProps> {
|
||||
public static addValidationRule(name: string, callback: (value: any) => boolean): void;
|
||||
public isFormValid(dryRun: boolean): boolean;
|
||||
public resetValidations(): void;
|
||||
static addValidationRule(name: string, callback: (value: any) => boolean): void;
|
||||
isFormValid(dryRun: boolean): boolean;
|
||||
resetValidations(): void;
|
||||
}
|
||||
|
||||
export interface ValidatorComponentProps {
|
||||
@@ -29,4 +29,4 @@ export interface ValidatorComponentProps {
|
||||
withRequiredValidator?: boolean;
|
||||
}
|
||||
export class ValidatorComponent extends React.Component<ValidatorComponentProps & TextFieldProps> {}
|
||||
export class TextValidator extends ValidatorComponent {}
|
||||
export class TextValidator extends ValidatorComponent {}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@material-ui/core": "3.9.0"
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ class Test extends React.Component {
|
||||
onSubmitted = (event: React.FormEventHandler) => {};
|
||||
onError = (errors: any[]) => {};
|
||||
onValidate = (isValid: boolean) => {};
|
||||
onTextFieldChanged = (event: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ValidatorForm
|
||||
@@ -27,19 +27,12 @@ class Test extends React.Component {
|
||||
withRequiredValidator={true}
|
||||
/>
|
||||
<TextValidator
|
||||
id="email"
|
||||
label="Email Address"
|
||||
type="email"
|
||||
name="email"
|
||||
autoComplete="email"
|
||||
placeholder="email"
|
||||
margin="normal"
|
||||
variant="outlined"
|
||||
name="textValidator"
|
||||
value="value"
|
||||
onChange={this.onTextFieldChanged}
|
||||
validatorListener={this.onValidate}
|
||||
validators={['required', 'isEmail']}
|
||||
errorMessages={['Email is required', 'Enter a valid email address']}
|
||||
validators={['required']}
|
||||
errorMessages={['Field is required']}
|
||||
withRequiredValidator={true}
|
||||
/>
|
||||
</ValidatorForm>
|
||||
);
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"./react-material-ui-form-validator-tests.tsx"
|
||||
"react-material-ui-form-validator-tests.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user