2
0
mirror of https://github.com/iconify/iconify.git synced 2024-12-12 21:57:50 +00:00

Add IconifyJSONPackageExports type for @iconify-json/* packages

This commit is contained in:
Vjacheslav Trushkin 2021-09-25 13:44:26 +03:00
parent cb8b5333be
commit 9216c1b576
3 changed files with 28 additions and 7 deletions

View File

@ -1,12 +1,12 @@
{ {
"name": "@iconify/types", "name": "@iconify/types",
"version": "1.0.7", "version": "1.0.8",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@iconify/types", "name": "@iconify/types",
"version": "1.0.7", "version": "1.0.8",
"license": "(Apache-2.0 OR GPL-2.0)", "license": "(Apache-2.0 OR GPL-2.0)",
"devDependencies": { "devDependencies": {
"typescript": "^4.1.2" "typescript": "^4.1.2"

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.7", "version": "1.0.8",
"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

@ -218,11 +218,9 @@ export interface IconifyMetaData {
} }
/** /**
* JSON structure. * JSON structure, contains only icon data
*
* All optional values can exist in root of JSON file, used as defaults.
*/ */
export interface IconifyJSON extends IconifyOptional, IconifyMetaData { export interface IconifyJSONIconsData {
// Prefix for icons in JSON file, required. // Prefix for icons in JSON file, required.
prefix: string; prefix: string;
@ -234,7 +232,17 @@ export interface IconifyJSON extends IconifyOptional, IconifyMetaData {
// Optional aliases. // Optional aliases.
aliases?: IconifyAliases; aliases?: IconifyAliases;
}
/**
* JSON structure.
*
* All optional values can exist in root of JSON file, used as defaults.
*/
export interface IconifyJSON
extends IconifyJSONIconsData,
IconifyOptional,
IconifyMetaData {
// Optional list of missing icons. Returned by Iconify API when querying for icons that do not exist. // Optional list of missing icons. Returned by Iconify API when querying for icons that do not exist.
not_found?: string[]; not_found?: string[];
@ -242,3 +250,16 @@ export interface IconifyJSON extends IconifyOptional, IconifyMetaData {
// If property exists in both icon and root, use value from icon. // If property exists in both icon and root, use value from icon.
// This is used to reduce duplication. // This is used to reduce duplication.
} }
/**
* Structure of exports '@iconify-json/*' packages.
*
* These are small packages, one per icon set, that split JSON structure into multiple files to reduce
* amount of data imported from package.
*/
export interface IconifyJSONPackageExports {
info: IconifyInfo;
icons: IconifyJSON;
metadata: IconifyMetaData;
chars: IconifyChars;
}