mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Support Partial<> on setState now that TS 2.1 is out * Update readme to reflect setState being typed correctly * Switch setState to Pick * Restore cloneELement portion of readme * Use Pick<> | S for setState due to cast issue * state and props should be readonly * Fix nit + document why we * Add typescript compiler header * Update to properly order headers * Update readme to reflect 2.1.5 fixing stPick * Update readme now that 2.1.5 is out * All that depend on react now require 2.1 * Fix definition that fails due to readonly state
94 lines
2.2 KiB
TypeScript
94 lines
2.2 KiB
TypeScript
// Type definitions for react-flex v2.2.7
|
|
// Project: https://github.com/zippyui/react-flex
|
|
// Definitions by: Jeffery Grajkowski <https://github.com/pushplay>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.1
|
|
|
|
import * as React from "react";
|
|
|
|
export interface CommonFlexProps {
|
|
/**
|
|
* For custom style
|
|
*/
|
|
style?: any;
|
|
|
|
/**
|
|
* For `display: inline-flex`.
|
|
*/
|
|
inline?: boolean;
|
|
|
|
/**
|
|
* For `flex-direction: row`. Defaults to `true`.
|
|
*/
|
|
row?: boolean;
|
|
|
|
/**
|
|
* For `flex-direction: column`.
|
|
*/
|
|
column?: boolean;
|
|
|
|
/**
|
|
* For reverse direction (eg. `flex-direction: column-reverse` or `row-reverse`).
|
|
*/
|
|
reverse?: boolean;
|
|
|
|
/**
|
|
* For `flex-wrap: wrap`. Defaults to `true`.
|
|
*/
|
|
wrap?: boolean;
|
|
|
|
/**
|
|
* A number/string from 0 to 24 for the `flex` css property. `false` for `'none'`.
|
|
*/
|
|
flex?: number | string | boolean;
|
|
|
|
/**
|
|
* A value for the `align-items` css property. Defaults to `'center'`.
|
|
*/
|
|
alignItems?: string;
|
|
|
|
/**
|
|
* A value for the `justify-content` css property.
|
|
*/
|
|
justifyContent?: string;
|
|
|
|
/**
|
|
* A value for the `align-content` css property.
|
|
*/
|
|
alignContent?: string;
|
|
|
|
/**
|
|
* Customize the display to be `'flex'` or `'inline-flex'`.
|
|
* Defaults to `'flex'`.
|
|
*/
|
|
display?: string;
|
|
}
|
|
|
|
export interface FlexProps extends React.Props<Flex>, CommonFlexProps {
|
|
}
|
|
|
|
export class Flex extends React.Component<FlexProps, {}> {
|
|
}
|
|
|
|
export interface ItemProps extends React.Props<Flex>, CommonFlexProps {
|
|
/**
|
|
* A number/string from 0 to 24 for `flex-grow`. Most of the times, using `flex` is just enough.
|
|
*/
|
|
flexGrow?: number | string | boolean;
|
|
|
|
/**
|
|
* A value for the `flex-shrink` css property. From `0` to `24`.
|
|
*/
|
|
flexShrink?: number | string;
|
|
|
|
/**
|
|
* A value for the flex-basis css property. Valid values are: `0` (and `'none'`, which is the same),
|
|
* `'auto'`, `'content'`, `'fit-content'`, `'min-content'`, `'max-content'`, `'fit'`.
|
|
*/
|
|
flexBasis?: number | "none" | "auto" | "content" | "fit-content" | "min-content" | "max-content" | "fit";
|
|
}
|
|
|
|
export class Item extends React.Component<ItemProps, {}> {
|
|
}
|
|
|