@iconify/types
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@iconify/types", | ||
"description": "Types for Iconify icons", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Vjacheslav Trushkin", | ||
@@ -6,0 +6,0 @@ "license": "(Apache-2.0 OR GPL-2.0)", |
45
types.ts
@@ -10,3 +10,16 @@ /** | ||
export interface IconifyDimenisons { | ||
// Left position of viewBox. | ||
// Defaults to 0. | ||
left?: number; | ||
// Top position of viewBox. | ||
// Defaults to 0. | ||
top?: number; | ||
// Width of viewBox. | ||
// Defaults to 16. | ||
width?: number; | ||
// Height of viewBox. | ||
// Defaults to 16. | ||
height?: number; | ||
@@ -24,4 +37,14 @@ } | ||
export interface IconifyTransformations { | ||
// Number of 90 degrees rotations. | ||
// 0 = 0, 1 = 90deg and so on. | ||
// Defaults to 0. | ||
// When merged (such as alias + icon), result is icon.rotation + alias.rotation. | ||
rotate?: number; | ||
// Horizontal flip. | ||
// Defaults to false. | ||
// When merged, result is icon.hFlip !== alias.hFlip | ||
hFlip?: boolean; | ||
// Vertical flip. (see hFlip comments) | ||
vFlip?: boolean; | ||
@@ -41,3 +64,8 @@ } | ||
export interface IconifyAlias extends IconifyOptional { | ||
// Parent icon index without prefix, required. | ||
parent: string; | ||
// IconifyOptional properties. | ||
// Alias should have only properties that it overrides. | ||
// Transformations are merged, not overridden. See IconifyTransformations comments. | ||
} | ||
@@ -49,3 +77,7 @@ | ||
export interface IconifyIcon extends IconifyOptional { | ||
// Icon body: <path d="..." />, required. | ||
body: string; | ||
// IconifyOptional properties. | ||
// If property is missing in JSON file, look in root object for default value. | ||
} | ||
@@ -57,2 +89,3 @@ | ||
export interface IconifyIcons { | ||
// Index is name of icon, without prefix. Value is IconifyIcon object. | ||
[index: string]: IconifyIcon; | ||
@@ -65,2 +98,3 @@ } | ||
export interface IconifyAliases { | ||
// Index is name of icon, without prefix. Value is IconifyAlias object. | ||
[index: string]: IconifyAlias; | ||
@@ -75,5 +109,14 @@ } | ||
export interface IconifyJSON extends IconifyOptional { | ||
prefix?: string; | ||
// Prefix for icons in JSON file, required. | ||
prefix: string; | ||
// List of icons, required. | ||
icons: IconifyIcons; | ||
// Optional aliases. | ||
aliases?: IconifyAliases; | ||
// IconifyOptional properties that are used as default values for icons when icon is missing value. | ||
// If property exists in both icon and root, use value from icon. | ||
// This is used to reduce duplication. | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29148
98