diff --git a/types/simple-icons/index.d.ts b/types/simple-icons/index.d.ts new file mode 100644 index 0000000000..37422aca67 --- /dev/null +++ b/types/simple-icons/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for simple-icons 2.5 +// Project: https://www.simpleicons.org +// Definitions by: Eric Cornelissen +// 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; diff --git a/types/simple-icons/simple-icons-tests.ts b/types/simple-icons/simple-icons-tests.ts new file mode 100644 index 0000000000..c0d1efbfe4 --- /dev/null +++ b/types/simple-icons/simple-icons-tests.ts @@ -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 diff --git a/types/simple-icons/tsconfig.json b/types/simple-icons/tsconfig.json new file mode 100644 index 0000000000..5ac5a5518f --- /dev/null +++ b/types/simple-icons/tsconfig.json @@ -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" + ] +} diff --git a/types/simple-icons/tslint.json b/types/simple-icons/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/simple-icons/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }