@blueprintjs/icons
Version:
Components, fonts, icons, and css files for creating and displaying icons.
60 lines (59 loc) • 2.28 kB
TypeScript
import type { IconPaths } from "../iconTypes";
import { type IconNextName } from "./iconNextNames";
import { IconVariant } from "./iconVariant";
import { type NextIconPathsLoader } from "./pathsLoader";
export { IconVariant } from "./iconVariant";
/** @deprecated Use {@link IconVariant} instead. */
export type NextIconVariant = IconVariant;
export interface NextIconLoaderOptions {
/**
* Custom loader function, or use the default dynamic import loader.
*
* @default defaultNextIconPathsLoader
*/
loader?: NextIconPathsLoader;
}
/**
* Next-generation icon loader. Simplified from `Icons` — no size branching, single cache,
* with outlined/filled variant support.
*/
export declare class IconsNext {
/** Set of icon names that have filled variants. */
private static filledSet;
/** Cache keyed by "iconName:variant". */
private static cache;
/** Icons for which the missing-filled-variant warning has already been emitted. */
private static warnedAboutMissingFilledVariant;
/** Configurable loader function. */
private static loader;
/**
* Set global loader options for all subsequent `IconsNext.load()` calls.
*/
static setLoaderOptions(options: NextIconLoaderOptions): void;
/**
* Load one or more next icons for use in Blueprint components.
*/
static load(icons: IconNextName | IconNextName[], variant?: IconVariant): Promise<void>;
/**
* Load all next icons (outlined variant). Optionally also load filled variants.
*/
static loadAll(options?: {
includeFilled?: boolean;
}): Promise<void>;
/**
* Get the icon SVG paths. Returns `undefined` if the icon has not been loaded yet.
* If `variant="filled"` is requested but unavailable, falls back to outlined.
*/
static getPaths(icon: IconNextName, variant?: IconVariant): IconPaths | undefined;
/**
* Returns `true` if the given icon has a filled variant available.
*/
static hasFilled(icon: IconNextName): boolean;
/**
* Returns `true` if the given string is a valid next icon name.
*/
static isValidIconName(name: string): name is IconNextName;
private static loadImpl;
private static resolveVariant;
private static cacheKey;
}