From 9970c50daf58064f54e7ad4fc1e9efd5c371cef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Wed, 28 Aug 2019 19:49:29 -0700 Subject: [PATCH] gylphs Summary: Adding type declaration for glyphs Reviewed By: passy Differential Revision: D17096295 fbshipit-source-id: e8994e0c81c3668fa909479dbaea613ec2b86dc4 --- src/ui/components/Glyph.tsx | 2 +- src/utils/icons.d.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/utils/icons.d.ts diff --git a/src/ui/components/Glyph.tsx b/src/ui/components/Glyph.tsx index 04c2193f8..f6f99ec05 100644 --- a/src/ui/components/Glyph.tsx +++ b/src/ui/components/Glyph.tsx @@ -20,7 +20,7 @@ const ColoredIconBlack = styled('img')(({size}: {size: number}) => ({ })); const ColoredIconCustom = styled('div')( - (props: {size: number; color: string; src: string}) => ({ + (props: {size: number; color?: string; src: string}) => ({ height: props.size, verticalAlign: 'middle', width: props.size, diff --git a/src/utils/icons.d.ts b/src/utils/icons.d.ts new file mode 100644 index 000000000..4b8a1fd1c --- /dev/null +++ b/src/utils/icons.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright 2018-present Facebook. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * @format + */ + +import {IconSize} from 'src/ui/components/Glyph'; + +declare function getIconURL( + name: string, + size?: IconSize, + density?: number, +): string; + +declare const ICONS: { + [key: string]: Array; +};