@iconify/utils
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -43,4 +43,4 @@ interface RGBColor { | ||
} | ||
declare type Color = RGBColor | HSLColor | LABColor | LCHColor | FunctionColor | TransparentColor | NoColor | CurrentColor; | ||
type Color = RGBColor | HSLColor | LABColor | LCHColor | FunctionColor | TransparentColor | NoColor | CurrentColor; | ||
export { Color, CurrentColor, FunctionColor, HSLColor, LABColor, LCHColor, NoColor, RGBColor, TransparentColor }; |
@@ -6,3 +6,3 @@ import { IconifyTransformations } from '@iconify/types'; | ||
*/ | ||
declare type IconifyIconSize = null | string | number; | ||
type IconifyIconSize = null | string | number; | ||
/** | ||
@@ -20,3 +20,3 @@ * Dimensions | ||
} | ||
declare type FullIconCustomisations = Required<IconifyIconCustomisations>; | ||
type FullIconCustomisations = Required<IconifyIconCustomisations>; | ||
/** | ||
@@ -23,0 +23,0 @@ * Default icon customisations values |
@@ -8,3 +8,3 @@ import { ExtendedIconifyIcon, IconifyJSON } from '@iconify/types'; | ||
*/ | ||
declare type SplitIconSetCallback = (name: string, data: ExtendedIconifyIcon | null) => void; | ||
type SplitIconSetCallback = (name: string, data: ExtendedIconifyIcon | null) => void; | ||
/** | ||
@@ -11,0 +11,0 @@ * Extract icons from an icon set |
import { IconifyJSON } from '@iconify/types'; | ||
declare type ParentIconsList = string[]; | ||
declare type ParentIconsTree = Record<string, ParentIconsList | null>; | ||
type ParentIconsList = string[]; | ||
type ParentIconsTree = Record<string, ParentIconsList | null>; | ||
/** | ||
@@ -6,0 +6,0 @@ * Resolve icon set icons |
import { IconifyIcon, ExtendedIconifyIcon, IconifyDimenisons, IconifyTransformations, IconifyOptional } from '@iconify/types'; | ||
export { IconifyIcon } from '@iconify/types'; | ||
declare type FullIconifyIcon = Required<IconifyIcon>; | ||
declare type PartialExtendedIconifyIcon = Partial<ExtendedIconifyIcon>; | ||
declare type IconifyIconExtraProps = Omit<ExtendedIconifyIcon, keyof IconifyIcon>; | ||
declare type FullExtendedIconifyIcon = FullIconifyIcon & IconifyIconExtraProps; | ||
type FullIconifyIcon = Required<IconifyIcon>; | ||
type PartialExtendedIconifyIcon = Partial<ExtendedIconifyIcon>; | ||
type IconifyIconExtraProps = Omit<ExtendedIconifyIcon, keyof IconifyIcon>; | ||
type FullExtendedIconifyIcon = FullIconifyIcon & IconifyIconExtraProps; | ||
/** | ||
@@ -9,0 +9,0 @@ * Default values for dimensions |
@@ -12,3 +12,3 @@ /** | ||
*/ | ||
declare type IconifyIconSource = Omit<IconifyIconName, 'name'>; | ||
type IconifyIconSource = Omit<IconifyIconName, 'name'>; | ||
/** | ||
@@ -15,0 +15,0 @@ * Expression to test part of icon name. |
@@ -28,2 +28,4 @@ export { FullIconCustomisations, IconifyIconCustomisations, IconifyIconSize, IconifyIconSizeCustomisations, defaultIconCustomisations, defaultIconSizeCustomisations } from './customisations/defaults.js'; | ||
export { colorToString, compareColors, stringToColor } from './colors/index.js'; | ||
export { getIconCSS } from './css/icon.js'; | ||
export { getIconsCSS } from './css/icons.js'; | ||
export { CustomCollections, CustomIconLoader, IconCustomizations, IconCustomizer, IconifyLoaderOptions, InlineCollection, UniversalIconLoader } from './loader/types.js'; | ||
@@ -34,2 +36,8 @@ export { mergeIconProps } from './loader/utils.js'; | ||
export { loadIcon } from './loader/loader.js'; | ||
export { getEmojiSequenceFromString, joinEmojiSequences, mapEmojiSequences, removeEmojiTones, removeEmojiVariations, splitEmojiSequences } from './emoji/cleanup.js'; | ||
export { convertEmojiSequenceToUTF16, convertEmojiSequenceToUTF32, getEmojiCodePoint, getEmojiUnicode, isUTF32SplitNumber, mergeUTF32Numbers, splitUTF32Number } from './emoji/convert.js'; | ||
export { emojiSequenceToKeyword, getEmojiSequenceString, getEmojiUnicodeString } from './emoji/format.js'; | ||
export { parseEmojiTestFile } from './emoji/parse-test.js'; | ||
export { addOptionalEmojiVariations } from './emoji/variations.js'; | ||
export { createOptimisedRegex, createOptimisedRegexForEmojiSequences } from './emoji/regex/create.js'; | ||
export { camelToKebab, camelize, pascalize, snakelize } from './misc/strings.js'; | ||
@@ -39,2 +47,3 @@ export { commonObjectProps, compareObjects, unmergeObjects } from './misc/objects.js'; | ||
import './colors/types.js'; | ||
import './css/types.js'; | ||
import '@antfu/utils'; |
@@ -8,11 +8,11 @@ import { Awaitable } from '@antfu/utils'; | ||
*/ | ||
declare type UniversalIconLoader = (collection: string, icon: string, options?: IconifyLoaderOptions) => Promise<string | undefined>; | ||
type UniversalIconLoader = (collection: string, icon: string, options?: IconifyLoaderOptions) => Promise<string | undefined>; | ||
/** | ||
* Custom icon loader, used by `getCustomIcon`. | ||
*/ | ||
declare type CustomIconLoader = (name: string) => Awaitable<string | undefined>; | ||
type CustomIconLoader = (name: string) => Awaitable<string | undefined>; | ||
/** | ||
* Custom icon customizer, it will allow to customize all icons on a collection or individual icons. | ||
*/ | ||
declare type IconCustomizer = (collection: string, icon: string, props: Record<string, string>) => Awaitable<void>; | ||
type IconCustomizer = (collection: string, icon: string, props: Record<string, string>) => Awaitable<void>; | ||
/** | ||
@@ -28,3 +28,3 @@ * Icon customizations: will be applied to all resolved icons. | ||
*/ | ||
declare type IconCustomizations = { | ||
type IconCustomizations = { | ||
/** | ||
@@ -70,11 +70,11 @@ * Transform raw `svg`. | ||
*/ | ||
declare type InlineCollection = Record<string, string | (() => Awaitable<string | undefined>)>; | ||
type InlineCollection = Record<string, string | (() => Awaitable<string | undefined>)>; | ||
/** | ||
* Collection of custom icons. Key is the collection name, the value is the loader or InlineCollection object | ||
*/ | ||
declare type CustomCollections = Record<string, CustomIconLoader | InlineCollection>; | ||
type CustomCollections = Record<string, CustomIconLoader | InlineCollection>; | ||
/** | ||
* Options to use with the modern loader. | ||
*/ | ||
declare type IconifyLoaderOptions = { | ||
type IconifyLoaderOptions = { | ||
/** | ||
@@ -81,0 +81,0 @@ * Emit warning when missing icons are matched |
/** | ||
* Calculate second dimension when only 1 dimension is set | ||
*/ | ||
declare function calculateSize(size: string, ratio: number, precision?: number): string; | ||
declare function calculateSize(size: number, ratio: number, precision?: number): number; | ||
declare function calculateSize(size: string | number, ratio: number, precision?: number): string | number; | ||
export { calculateSize }; |
100
package.json
@@ -6,3 +6,3 @@ { | ||
"author": "Vjacheslav Trushkin", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"license": "MIT", | ||
@@ -47,2 +47,27 @@ "bugs": "https://github.com/iconify/iconify/issues", | ||
}, | ||
"./lib/css/common": { | ||
"require": "./lib/css/common.cjs", | ||
"import": "./lib/css/common.mjs", | ||
"types": "./lib/css/common.d.ts" | ||
}, | ||
"./lib/css/format": { | ||
"require": "./lib/css/format.cjs", | ||
"import": "./lib/css/format.mjs", | ||
"types": "./lib/css/format.d.ts" | ||
}, | ||
"./lib/css/icon": { | ||
"require": "./lib/css/icon.cjs", | ||
"import": "./lib/css/icon.mjs", | ||
"types": "./lib/css/icon.d.ts" | ||
}, | ||
"./lib/css/icons": { | ||
"require": "./lib/css/icons.cjs", | ||
"import": "./lib/css/icons.mjs", | ||
"types": "./lib/css/icons.d.ts" | ||
}, | ||
"./lib/css/types": { | ||
"require": "./lib/css/types.cjs", | ||
"import": "./lib/css/types.mjs", | ||
"types": "./lib/css/types.d.ts" | ||
}, | ||
"./lib/customisations/bool": { | ||
@@ -73,2 +98,57 @@ "require": "./lib/customisations/bool.cjs", | ||
}, | ||
"./lib/emoji/regex/base": { | ||
"require": "./lib/emoji/regex/base.cjs", | ||
"import": "./lib/emoji/regex/base.mjs", | ||
"types": "./lib/emoji/regex/base.d.ts" | ||
}, | ||
"./lib/emoji/regex/create": { | ||
"require": "./lib/emoji/regex/create.cjs", | ||
"import": "./lib/emoji/regex/create.mjs", | ||
"types": "./lib/emoji/regex/create.d.ts" | ||
}, | ||
"./lib/emoji/regex/numbers": { | ||
"require": "./lib/emoji/regex/numbers.cjs", | ||
"import": "./lib/emoji/regex/numbers.mjs", | ||
"types": "./lib/emoji/regex/numbers.d.ts" | ||
}, | ||
"./lib/emoji/regex/similar": { | ||
"require": "./lib/emoji/regex/similar.cjs", | ||
"import": "./lib/emoji/regex/similar.mjs", | ||
"types": "./lib/emoji/regex/similar.d.ts" | ||
}, | ||
"./lib/emoji/regex/tree": { | ||
"require": "./lib/emoji/regex/tree.cjs", | ||
"import": "./lib/emoji/regex/tree.mjs", | ||
"types": "./lib/emoji/regex/tree.d.ts" | ||
}, | ||
"./lib/emoji/cleanup": { | ||
"require": "./lib/emoji/cleanup.cjs", | ||
"import": "./lib/emoji/cleanup.mjs", | ||
"types": "./lib/emoji/cleanup.d.ts" | ||
}, | ||
"./lib/emoji/convert": { | ||
"require": "./lib/emoji/convert.cjs", | ||
"import": "./lib/emoji/convert.mjs", | ||
"types": "./lib/emoji/convert.d.ts" | ||
}, | ||
"./lib/emoji/data": { | ||
"require": "./lib/emoji/data.cjs", | ||
"import": "./lib/emoji/data.mjs", | ||
"types": "./lib/emoji/data.d.ts" | ||
}, | ||
"./lib/emoji/format": { | ||
"require": "./lib/emoji/format.cjs", | ||
"import": "./lib/emoji/format.mjs", | ||
"types": "./lib/emoji/format.d.ts" | ||
}, | ||
"./lib/emoji/parse-test": { | ||
"require": "./lib/emoji/parse-test.cjs", | ||
"import": "./lib/emoji/parse-test.mjs", | ||
"types": "./lib/emoji/parse-test.d.ts" | ||
}, | ||
"./lib/emoji/variations": { | ||
"require": "./lib/emoji/variations.cjs", | ||
"import": "./lib/emoji/variations.mjs", | ||
"types": "./lib/emoji/variations.d.ts" | ||
}, | ||
"./lib/icon-set/convert-info": { | ||
@@ -250,21 +330,21 @@ "require": "./lib/icon-set/convert-info.cjs", | ||
"dependencies": { | ||
"@antfu/install-pkg": "^0.1.0", | ||
"@antfu/install-pkg": "^0.1.1", | ||
"@antfu/utils": "^0.5.2", | ||
"@iconify/types": "^2.0.0", | ||
"debug": "^4.3.4", | ||
"kolorist": "^1.5.1", | ||
"kolorist": "^1.6.0", | ||
"local-pkg": "^0.4.2" | ||
}, | ||
"devDependencies": { | ||
"@iconify-json/flat-color-icons": "^1.1.2", | ||
"@iconify-json/flat-color-icons": "^1.1.3", | ||
"@types/debug": "^4.1.7", | ||
"@types/jest": "^29.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.36.2", | ||
"eslint": "^8.23.0", | ||
"@types/jest": "^29.2.4", | ||
"@typescript-eslint/eslint-plugin": "^5.46.0", | ||
"eslint": "^8.29.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.8.2", | ||
"unbuild": "^0.8.10", | ||
"vitest": "^0.23.1" | ||
"typescript": "^4.9.4", | ||
"unbuild": "^0.8.11", | ||
"vitest": "^0.23.4" | ||
}, | ||
@@ -271,0 +351,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
251072
174
7712
Updated@antfu/install-pkg@^0.1.1
Updatedkolorist@^1.6.0