Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Missing TypeScript types #8

Open
elektronik2k5 opened this issue Jun 26, 2020 · 1 comment
Open

Missing TypeScript types #8

elektronik2k5 opened this issue Jun 26, 2020 · 1 comment

Comments

@elektronik2k5
Copy link

Hi Brad,

I wanna make a PR to add these types:

declare module 'react-flex-columns' {
  // eslint-disable-next-line @typescript-eslint/ban-types
  type WithAsProp<P = {}> = {
    as?: React.ComponentType<P> | React.ElementType;
  };
  interface CommonProps extends WithAsProp {
    children?: React.ReactNode | React.ReactNode[];
    className?: string;
    split?: boolean;
    stack?: boolean;
  }
  export interface ColumnProps extends CommonProps {
    gutterUnit?: number;
    display?: boolean;
    size?: number;
    flex?: boolean;
    align?: 'left' | 'right' | 'center';
  }
  // https://github.com/bradwestfall/react-flex-columns/blob/master/src/lib/Column.js
  export const Column: React.FC<ColumnProps>;
  export interface ColumnsProps extends CommonProps {
    middle?: boolean;
    gutterSize?: number | null;
    gutters?: boolean | null;
    reverse?: boolean;
  }
  // https://github.com/bradwestfall/react-flex-columns/blob/master/src/lib/Columns.js
  export const Columns: React.FC<ColumnsProps>;
}

However, I also wanna make sure it actually works in a test, like I did here. But that'll take me more time than I currently have. So on the mean time we can at least have the type definitions here in the issue. :)

@bradwestfall
Copy link
Owner

Sure, can you make the PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants