2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-09 23:00:56 +00:00

Add API provider types to types package

This commit is contained in:
Vjacheslav Trushkin 2020-06-04 17:29:54 +03:00
parent 6c461f3b92
commit ce5fade7ae
2 changed files with 41 additions and 1 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@iconify/types", "name": "@iconify/types",
"description": "Types for Iconify data", "description": "Types for Iconify data",
"version": "1.0.2", "version": "1.0.3",
"author": "Vjacheslav Trushkin", "author": "Vjacheslav Trushkin",
"license": "(Apache-2.0 OR GPL-2.0)", "license": "(Apache-2.0 OR GPL-2.0)",
"main": "./index.js", "main": "./index.js",

View File

@ -0,0 +1,40 @@
/**
* Raw data sent by API
*/
// Links
export interface APIProviderRawDataLinks {
// Collections list
home?: string;
// Collection. Available variables: {prefix}
collection?: string;
// Icon. Available variables: {prefix}, {name}
icon?: string;
}
// NPM
export interface APIProviderRawDataNPM {
// Package name for installation. Available variables: {prefix}
package?: string;
// Icon import source. Available variables: {prefix}, {name}
icon?: string;
}
// Main type
export interface APIProviderRawData {
// Provider name (as used in icon names)
provider: string;
// Provider name (human readable version)
title?: string;
// API link(s), though they are usually redundant because API end point is used to retrieve data
api?: string | string[];
// Links to website
links?: APIProviderRawDataLinks;
// NPM packages for icons, used when showing code samples
npm?: APIProviderRawDataNPM;
}