Skip to content

Commit

Permalink
fix(typescript definitions): fix ts defs for checkbox, BackgroundImag…
Browse files Browse the repository at this point in the history
…e, and Form (patternfly#800)

770
  • Loading branch information
priley86 authored and dgutride committed Oct 17, 2018
1 parent 8c0cd77 commit d39f596
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
import { SFC, HTMLProps, ReactNode } from 'react';
import { OneOf } from '../../typeUtils';
import { Omit, OneOf } from '../../typeUtils';

export const BackgroundImageSrc: {
lg: 'lg',
md: 'md',
md2x: 'md2x',
sm: 'sm',
sm2x: 'sm2x',
xl: 'xl',
xs: 'xs',
xs2x: 'xs2x',
filter: 'filter'
lg: 'lg';
md: 'md';
md2x: 'md2x';
sm: 'sm';
sm2x: 'sm2x';
xl: 'xl';
xs: 'xs';
xs2x: 'xs2x';
filter: 'filter';
};

export interface BackgroundImageProps extends HTMLProps<HTMLDivElement> {
src: string | {
lg?: string;
md?: string;
md2x?: string;
sm?: string;
sm2x?: string;
xl?: string;
xs?: string;
xs2x?: string;
filter?: string;
};
export type BackgroundImageSrcMap = { [K in keyof typeof BackgroundImageSrc]: string };

export interface BackgroundImageProps extends Omit<HTMLProps<HTMLDivElement>, 'src'> {
src: string | BackgroundImageSrcMap;
}

declare const BackgroundImage: SFC<BackgroundImageProps>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as BackgroundImage, BackgroundImageSrc } from './BackgroundImage';
export { default as BackgroundImage, BackgroundImageSrc, BackgroundImageSrcMap } from './BackgroundImage';
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import PropTypes from 'prop-types';
import { HTMLProps, FormEvent, ReactNode } from 'react';
import { Omit } from '../../typeUtils';

export interface CheckboxProps
extends Omit<HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled'> {
export interface CheckboxProps extends Omit<HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'label'> {
isDisabled?: boolean;
isValid?: boolean;
onChange?(checked: boolean, event: FormEvent<HTMLInputElement>): void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import PropTypes from 'prop-types';
import { SFC, HTMLProps, ReactNode } from 'react';

export interface FormGroupProps extends React.Component<HTMLDivElement> {
children?: ReactNode;
className?: string;
isValid?: boolean;
isRequired?: boolean;
label?: ReactNode;
helperText?: ReactNode;
helperTextInvalid?: ReactNode;
fieldId: string;
isInline?: boolean;
children?: ReactNode;
className?: string;
isValid?: boolean;
isRequired?: boolean;
label?: ReactNode;
helperText?: ReactNode;
helperTextInvalid?: ReactNode;
fieldId: string;
isInline?: boolean;
}

declare const FormGroup: SFC<FormGroupProps>;
Expand Down

0 comments on commit d39f596

Please sign in to comment.