Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DOM attributes to FontAwesomeIconProps to Typescript definitions #283

Merged
merged 1 commit into from
Oct 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="react" />
import { CSSProperties } from 'react'
import { CSSProperties, DOMAttributes } from 'react'
import {
Transform,
IconProp,
Expand All @@ -17,7 +17,10 @@ export function FontAwesomeIcon(props: FontAwesomeIconProps): JSX.Element
*/
export type Props = FontAwesomeIconProps

export interface FontAwesomeIconProps {
// This is identical to the version of Omit in Typescript 3.5. It is included for compatibility with older versions of Typescript.
type BackwardCompatibleOmit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;

export interface FontAwesomeIconProps extends BackwardCompatibleOmit<DOMAttributes<SVGSVGElement>, 'children' | 'mask'> {
icon: IconProp
mask?: IconProp
className?: string
Expand Down