mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[@catho/quantum] Added few missing attributes (#42287)
* simplecrawler modules type definition * required fixes in export * adjustments reference types of crawler.d.ts * added catho__quantum types definitions * Fix lint errors * Fix lint errors * Fix lint errors * fix components event handlers types * fix lint complains * fix few missing attributes
This commit is contained in:
@@ -100,4 +100,13 @@ Validations.Required({ value: 'abc' });
|
||||
<TextArea />;
|
||||
<Toggle />;
|
||||
<Tooltip text="this is a tooltip!">Tooltip example</Tooltip>;
|
||||
<Input />;
|
||||
<Input validate={Validations.Date} />;
|
||||
<Input validate={({ value }: { value?: string }) => `value: ${value}`} />;
|
||||
<Input validate={{ validate: Validations.Email, error: 'Error test' }} />;
|
||||
<Input
|
||||
validate={[
|
||||
Validations.Required,
|
||||
({ value }: { value?: string }) => `value: ${value}`,
|
||||
{ validate: Validations.Date, error: 'Error test' },
|
||||
]}
|
||||
/>;
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface ButtonProps<T> {
|
||||
button: object;
|
||||
};
|
||||
};
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export default class Button<T = HTMLButtonElement> extends React.Component<ButtonProps<T>> {
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
import React = require('react');
|
||||
|
||||
import { Validations } from '../Form';
|
||||
import { string } from 'prop-types';
|
||||
|
||||
export type MaskFunction = (rawValue: string) => string[];
|
||||
export type Mask = boolean | RegExp | string | MaskFunction;
|
||||
export type Validate =
|
||||
| typeof Validations.Required
|
||||
| typeof Validations.CPF
|
||||
| typeof Validations.CEP
|
||||
| typeof Validations.Date
|
||||
| typeof Validations.MinLength
|
||||
| typeof Validations.MaxLength
|
||||
| typeof Validations.Email;
|
||||
export type CustomValidate = ((param?: { value: string }) => string) | { validate: Validate; error: string };
|
||||
|
||||
export interface InputProps<T> {
|
||||
value?: string;
|
||||
@@ -13,6 +25,8 @@ export interface InputProps<T> {
|
||||
type?: 'email' | 'text' | 'tel' | 'number' | 'password' | 'search';
|
||||
error?: string;
|
||||
id?: string;
|
||||
name?: string;
|
||||
validate?: Validate | CustomValidate | Array<Validate | CustomValidate>;
|
||||
mask?: Mask | Mask[];
|
||||
onClean?: React.MouseEventHandler<T>;
|
||||
onChange?: React.ChangeEventHandler<T>;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React = require('react');
|
||||
|
||||
export interface ToggleProps {
|
||||
id?: string;
|
||||
checked?: boolean;
|
||||
theme?: {
|
||||
colors?: object;
|
||||
|
||||
Reference in New Issue
Block a user