Update definitions for react-fa (#12119)

This commit is contained in:
Karol Janyst
2016-10-26 00:29:19 +09:00
committed by Masahiro Wakame
parent 4e310dbcc0
commit b6f6ba5f89
3 changed files with 70 additions and 23 deletions

28
react-fa/react-fa-4.0.0.d.ts vendored Normal file
View File

@@ -0,0 +1,28 @@
// Type definitions for react-fa v4.0.0
// Project: https://github.com/andreypopp/react-fa
// Definitions by: Frank Laub <https://github.com/flaub>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
declare module "react-fa" {
import { ComponentClass, Props } from 'react';
interface IconProps extends Props<Icon> {
name: string;
className?: string;
size?: string;
spin?: boolean;
rotate?: string;
flip?: string;
fixedWidth?: boolean;
pulse?: boolean;
stack?: string;
inverse?: boolean;
}
interface Icon extends ComponentClass<IconProps> { }
const Icon: Icon;
export = Icon;
}

View File

@@ -1,11 +1,23 @@
// React Fa Test
// ================================================================================
/// <reference path="react-fa.d.ts"/>
/// <reference path="../react/react-dom.d.ts"/>
import * as React from "react";
import { render } from 'react-dom';
import Icon = require('react-fa');
// Imports
// --------------------------------------------------------------------------------
import * as React from "react"
import { render } from "react-dom"
import { Icon, IconStack } from "react-fa"
render(
<Icon spin name="spinner" />,
document.getElementById('main')
<Icon spin name="spinner" rotate="90" size="2x" Component="span" />,
document.getElementById("main")
)
render(
<IconStack size="2x">
<Icon name="test" stack="2x" />
<Icon name="test" stack="1x" />
</IconStack>,
document.getElementById("main")
)

View File

@@ -1,28 +1,35 @@
// Type definitions for react-fa v4.0.0
// Type definitions for react-fa v4.1.2
// Project: https://github.com/andreypopp/react-fa
// Definitions by: Frank Laub <https://github.com/flaub>
// Definitions by: Frank Laub <https://github.com/flaub>, Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
declare module "react-fa" {
import { ComponentClass, Props } from 'react';
import { Component, ClassAttributes } from "react";
interface IconProps extends Props<Icon> {
name: string;
className?: string;
size?: string;
spin?: boolean;
rotate?: string;
flip?: string;
fixedWidth?: boolean;
pulse?: boolean;
stack?: string;
inverse?: boolean;
}
type IconSize = "lg" | "2x" | "3x" | "4x" | "5x"
interface Icon extends ComponentClass<IconProps> { }
const Icon: Icon;
interface IconProps extends ClassAttributes<Icon> {
name: string
className?: string
size?: IconSize
rotate?: "45" | "90" | "135" | "180" | "225" | "270" | "315"
flip?: "horizontal" | "vertical"
fixedWidth?: boolean
spin?: boolean
pulse?: boolean
stack?: "1x" | "2x"
inverse?: boolean
Component?: string | Function
}
export class Icon extends Component<IconProps, {}> {}
export = Icon;
interface IconStackProps extends ClassAttributes<IconStack> {
className?: string
size?: IconSize
}
export class IconStack extends Component<IconStackProps, {}> {}
export default Icon
}