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

fix: jsdocs for IconCustomizations + some typo

This commit is contained in:
Joaquín Sánchez Jiménez 2022-01-10 13:57:22 +01:00 committed by Vjacheslav Trushkin
parent 9ebf18df94
commit 3553153baf
2 changed files with 7 additions and 5 deletions

View File

@ -55,10 +55,10 @@ export async function searchForIcon(
iconSet: IconifyJSON, iconSet: IconifyJSON,
collection: string, collection: string,
ids: string[], ids: string[],
iconCustomizactions?: IconCustomizations, iconCustomizations?: IconCustomizations,
): Promise<string | undefined> { ): Promise<string | undefined> {
let iconData: FullIconifyIcon | null; let iconData: FullIconifyIcon | null;
const { customize, additionalProps = {}, iconCustomizer } = iconCustomizactions || {} const { customize, additionalProps = {}, iconCustomizer } = iconCustomizations || {}
for (const id of ids) { for (const id of ids) {
iconData = getIconData(iconSet, id, true); iconData = getIconData(iconSet, id, true);
if (iconData) { if (iconData) {

View File

@ -15,7 +15,7 @@ export type IconCustomizer = (collection: string, icon: string, props: Record<st
* Icon customizations: will be applied to all resolved icons. * Icon customizations: will be applied to all resolved icons.
* *
* For each loaded icon, the customizations will be applied in this order: * For each loaded icon, the customizations will be applied in this order:
* - apply `transform` to raw `svg`, if provided * - apply `transform` to raw `svg`, if provided and using custom icon collection
* - apply `customize` with default customizations, if provided * - apply `customize` with default customizations, if provided
* - apply `iconCustomizer` with `customize` customizations, if provided * - apply `iconCustomizer` with `customize` customizations, if provided
* - apply `additionalProps` with `iconCustomizer` customizations, if provided * - apply `additionalProps` with `iconCustomizer` customizations, if provided
@ -24,6 +24,8 @@ export type IconCustomizations = {
/** /**
* Transform raw `svg`. * Transform raw `svg`.
* *
* **WARNING**: `transform` will be only applied when using `custom` icon collection: it will be applied only when using `getCustomIcon` and excluded when using `searchForIcon`.
*
* @param svg The loaded `svg` * @param svg The loaded `svg`
* @return The transformed `svg`. * @return The transformed `svg`.
*/ */
@ -31,8 +33,8 @@ export type IconCustomizations = {
/** /**
* Change default icon customizations values. * Change default icon customizations values.
* *
* @param defaultCustomizations Default icon customisations values. * @param defaultCustomizations Default icon's customizations values.
* @return The modified icon customisations values. * @return The modified icon's customizations values.
*/ */
customize?: (defaultCustomizations: FullIconCustomisations) => FullIconCustomisations customize?: (defaultCustomizations: FullIconCustomisations) => FullIconCustomisations
/** /**