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

Missing TypeScript types #8

Description

@elektronik2k5

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. :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions