2.1.4 • Published 6 months ago

@types/react-material-ui-form-validator v2.1.4

Weekly downloads
7,618
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-material-ui-form-validator

Summary

This package contains type definitions for react-material-ui-form-validator (https://github.com/NewOldMax/react-material-ui-form-validator).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-material-ui-form-validator.

index.d.ts

// Type definitions for react-material-ui-form-validator 2.1
// Project: https://github.com/NewOldMax/react-material-ui-form-validator
// Definitions by: Frank Brullo <https://github.com/FrankBrullo>
//                 Ivan Siacho <https://github.com/Ivansiach0>
//                 J.R <https://github.com/jrguenin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5

import * as React from 'react';
import { SelectFieldProps, TextFieldProps } from 'material-ui';

export interface ValidatorFormProps {
    className?: string | undefined;
    onSubmit: (event: React.FormEvent) => void;
    instantValidate?: boolean | undefined;
    onError?: ((errors: any[]) => void) | undefined;
    debounceTime?: number | undefined;
    [key: string]: any;
}
export class ValidatorForm extends React.Component<ValidatorFormProps> {
    static addValidationRule(name: string, callback: (value: any) => boolean | Promise<boolean>): void;
    static removeValidationRule(name: string): void;
    isFormValid(dryRun: boolean): Promise<boolean>;
    resetValidations(): void;
}

export interface ValidatorComponentProps {
    errorMessages?: any[] | string | undefined;
    validators?: any[] | undefined;
    name: string;
    value: any;
    validatorListener?: ((isValid: boolean) => void) | undefined;
    withRequiredValidator?: boolean | undefined;
    [key: string]: any;
}

export class ValidatorComponent extends React.Component<ValidatorComponentProps> {
    getErrorMessage(): string | boolean;
    isValid(): boolean;
    makeInvalid(): void;
    makeValid(): void;
    validate(value: string, includeRequired?: boolean, dryRun?: boolean): void;
}
export class TextValidator extends React.Component<ValidatorComponentProps & TextFieldProps> {
    getErrorMessage(): string | boolean;
    isValid(): boolean;
    makeInvalid(): void;
    makeValid(): void;
    validate(value: string, includeRequired?: boolean, dryRun?: boolean): void;
}
export class SelectValidator extends React.Component<ValidatorComponentProps & SelectFieldProps> {
    getErrorMessage(): string | boolean;
    isValid(): boolean;
    makeInvalid(): void;
    makeValid(): void;
    validate(value: string, includeRequired?: boolean, dryRun?: boolean): void;
}

Additional Details

Credits

These definitions were written by Frank Brullo, Ivan Siacho, and J.R.

2.1.2

7 months ago

2.1.4

6 months ago

2.1.3

7 months ago

2.1.1

3 years ago

2.1.0

4 years ago

2.0.6

4 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago