Add types for simple-icons (#42541)

* Create types for [simple-icons]

* Add missing final newline

* Update CODEOWNERS

* Revert a53398139f1a05eba5acbc2c085ad8b5fce705f4

* Use `export =` instead of `export default`

as suggested by @PranavSenthilnathan

* fix lint errors
This commit is contained in:
Eric Cornelissen
2020-02-25 17:03:31 -08:00
committed by GitHub
parent 7b0f347124
commit 24f2f2e8cb
4 changed files with 49 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for simple-icons 2.5
// Project: https://www.simpleicons.org
// Definitions by: Eric Cornelissen <https://github.com/ericcornelissen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface SimpleIcon {
title: string;
slug: string;
svg: string;
path: string;
source: string;
hex: string;
}
export function get(name: string): SimpleIcon;
+9
View File
@@ -0,0 +1,9 @@
import simpleIcons from 'simple-icons';
const icon = simpleIcons.get('Simple Icons'); // $ExpectType SimpleIcon
icon.title; // $ExpectType string
icon.slug; // $ExpectType string
icon.hex; // $ExpectType string
icon.source; // $ExpectType string
icon.svg; // $ExpectType string
icon.path; // $ExpectType string
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"simple-icons-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }