-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
136 lines (136 loc) · 5.8 KB
/
index.d.ts
File metadata and controls
136 lines (136 loc) · 5.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/// <reference types="react" />
declare module "src/components/Button/index" {
import * as React from 'react';
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
children?: React.ReactNode;
disabled?: boolean;
transparent?: boolean;
reset?: boolean;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
className?: string;
style?: object;
type?: 'submit' | 'reset' | 'button';
}
export function Button({ children, disabled, transparent, reset, className, style, onClick, type, ...props }: ButtonProps): JSX.Element;
}
declare module "src/commons/interfaces" {
export type BooleanChangeFnType = (event: boolean) => void;
export type InputChangeFnType = (event: React.ChangeEvent<HTMLInputElement>) => void;
type OnChangeFunction = BooleanChangeFnType | InputChangeFnType;
export interface InputPropsTypes {
children?: React.ReactNode;
className?: string;
inputClassName?: string;
style?: React.CSSProperties;
disabled?: boolean;
checked?: boolean;
onChange?: OnChangeFunction;
reset?: boolean;
}
export const InputDefaultProps: object;
type WeakenType<T, K extends keyof T> = {
[P in keyof T]: P extends K ? unknown : T[P];
};
export type ChangelessInputProps = WeakenType<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'>;
}
declare module "src/components/Checkbox/index" {
import * as React from 'react';
import { InputPropsTypes, BooleanChangeFnType, ChangelessInputProps } from "src/commons/interfaces";
interface SVGProps {
className?: string;
style?: React.CSSProperties;
}
export interface CheckBoxArguments extends InputPropsTypes, ChangelessInputProps {
propSvg?: React.SFC<SVGProps>;
onChange?: BooleanChangeFnType;
}
export function Checkbox({ children, propSvg, className, inputClassName, style, disabled, checked, onChange, reset, ...props }: CheckBoxArguments): JSX.Element;
}
declare module "src/components/FlexView/index" {
import * as React from 'react';
export interface FlexViewProps {
children?: React.ReactNode;
column?: boolean;
vAlign?: 'top' | 'center' | 'bottom' | 'between' | 'around' | 'baseline' | 'stretch';
hAlign?: 'left' | 'center' | 'right' | 'between' | 'around' | 'baseline' | 'stretch';
grow?: boolean | number;
shrink?: boolean | number;
basis?: string | number;
wrap?: boolean;
className?: string;
style?: object;
}
export function FlexView({ children, column, vAlign, hAlign, grow, shrink, basis, wrap, className, style, ...props }: FlexViewProps): JSX.Element;
}
declare module "src/components/Radio/index" {
import { InputPropsTypes, BooleanChangeFnType, ChangelessInputProps } from "src/commons/interfaces";
export interface RadioProps extends InputPropsTypes, ChangelessInputProps {
onChange?: BooleanChangeFnType;
}
export function Radio({ children, className, inputClassName, style, disabled, checked, onChange, reset, ...props }: RadioProps): JSX.Element;
}
declare module "src/components/Select/index" {
import * as React from 'react';
export interface DropDownParams {
style: object;
}
export interface SelectProps {
children?: React.ReactElement;
className?: string;
childrenClassName?: string;
style?: object;
label?: string;
scrollable?: boolean;
dark?: boolean;
open?: boolean;
disabled?: boolean;
autoclose?: boolean;
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
reset?: boolean;
}
export class Select extends React.Component<SelectProps> {
componentDidMount(): void;
componentWillUnmount(): void;
static defaultProps: {
autoclose: boolean;
};
state: {
open: boolean;
};
container: HTMLDivElement;
setClose: () => void;
setOpen: () => void;
toogleOpen: () => void;
handleClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
handleOutsideClick: (event: MouseEvent | TouchEvent) => void;
render(): JSX.Element;
}
}
declare module "src/components/TextInput/index" {
import * as React from 'react';
import { InputPropsTypes, InputChangeFnType } from "src/commons/interfaces";
export interface TextInputpropsType extends InputPropsTypes, React.InputHTMLAttributes<HTMLInputElement> {
onChange?: InputChangeFnType;
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'time' | 'date' | 'datetime-local';
value?: string | number;
defaultValue?: string;
checkValidity?: (cond: boolean) => void;
}
export function TextInput({ value, defaultValue, className, style, type, onChange, checkValidity, reset, disabled, ...props }: TextInputpropsType): JSX.Element;
}
declare module "src/components/Toggle/index" {
import { InputPropsTypes, BooleanChangeFnType, ChangelessInputProps } from "src/commons/interfaces";
interface ToggleProps extends InputPropsTypes, ChangelessInputProps {
onChange?: BooleanChangeFnType;
}
export function Toggle({ children, className, inputClassName, style, disabled, checked, onChange, reset, }: ToggleProps): JSX.Element;
}
declare module "src/index" {
export { Button } from "src/components/Button/index";
export { Checkbox } from "src/components/Checkbox/index";
export { FlexView } from "src/components/FlexView/index";
export { Radio } from "src/components/Radio/index";
export { Select } from "src/components/Select/index";
export { TextInput } from "src/components/TextInput/index";
export { Toggle } from "src/components/Toggle/index";
}