mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
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:
Vendored
+15
@@ -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;
|
||||
@@ -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
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user