@types/react-fa
TypeScript icon, indicating that this package has built-in type declarations

4.1.11 • Public • Published

Installation

npm install --save @types/react-fa

Summary

This package contains type definitions for react-fa (https://github.com/andreypopp/react-fa).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-fa.

index.d.ts

import { Component, ComponentClass, FunctionComponent, HTMLProps, ReactElement } from "react";

// fake intermediate interface to remove typing on size, as the typing
// is overrided by react-fa
interface SizeOverrideHTMLProps<T> extends HTMLProps<T> {
    size?: any;
}

export type IconSize = "lg" | "2x" | "3x" | "4x" | "5x";
export type IconRotation = "45" | "90" | "135" | "180" | "225" | "270" | "315";
export type IconFlip = "horizontal" | "vertical";
export type IconStackSize = "1x" | "2x";

type CustomComponent = string | ComponentClass<any> | FunctionComponent<any>;

export interface IconProps extends SizeOverrideHTMLProps<Icon> {
    name: string;
    size?: IconSize | undefined;
    spin?: boolean | undefined;
    rotate?: IconRotation | undefined;
    flip?: IconFlip | undefined;
    fixedWidth?: boolean | undefined;
    pulse?: boolean | undefined;
    stack?: IconStackSize | undefined;
    inverse?: boolean | undefined;
    Component?: CustomComponent | undefined;
}

export type Icon = Component<IconProps>;
export const Icon: ComponentClass<IconProps>;

export interface IconStackProps extends SizeOverrideHTMLProps<IconStack> {
    size?: IconSize | undefined;
    children?: ReactElement<IconProps> | Array<ReactElement<IconProps>> | undefined;
}

export type IconStack = Component<IconStackProps>;
export const IconStack: ComponentClass<IconStackProps>;

export default Icon;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Frank Laub, Pat Sissons, and Karol Janyst.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-fa

Weekly Downloads

502

Version

4.1.11

License

MIT

Unpacked Size

5.79 kB

Total Files

5

Last publish

Collaborators

  • types