mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Clean up for typings-2.0
This commit is contained in:
92
react-flex/index.d.ts
vendored
Normal file
92
react-flex/index.d.ts
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
// 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
|
||||
|
||||
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, {}> {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/// <reference path="./react-flex.d.ts" />
|
||||
|
||||
import { Flex, Item } from "react-flex";
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
99
react-flex/react-flex.d.ts
vendored
99
react-flex/react-flex.d.ts
vendored
@@ -1,99 +0,0 @@
|
||||
// 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
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
|
||||
declare namespace __ReactFlex {
|
||||
export import React = __React;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
interface FlexProps extends React.Props<Flex>, CommonFlexProps {
|
||||
}
|
||||
|
||||
export class Flex extends React.Component<FlexProps, {}> {
|
||||
}
|
||||
|
||||
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, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "react-flex" {
|
||||
export = __ReactFlex;
|
||||
}
|
||||
20
react-flex/tsconfig.json
Normal file
20
react-flex/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-flex-tests.tsx"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user