@devexperts/dxcharts-lite
Version:
34 lines (33 loc) • 1.46 kB
TypeScript
/*
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { Point } from '../../inputlisteners/canvas-input-listener.component';
export interface CustomIcon {
normal: string;
hover: string;
}
export interface CustomIconImage {
img: HTMLImageElement;
svgHeight: number;
}
export declare const getIconHash: (type: string, state: keyof CustomIcon) => string;
/**
* Creates a custom icon for a given event type.
* @param {string} type - The type of the event.
* @param {CustomIcon} [icon] - The custom icon object containing the normal and hover images.
* @returns {void}
*/
export declare const createCustomIcon: (type: string, icon?: CustomIcon) => {
type: string;
normal: CustomIconImage;
hover: CustomIconImage;
} | undefined;
/**
* Creates an icon image from a string containing SVG data.
* @param {string} iconString - The string containing SVG data.
* @returns {CustomIconImage} An object containing an Image object and the height of the SVG element.
*/
export declare const createIconImage: (iconString: string) => CustomIconImage;
export declare const drawCustomSvgIcon: (ctx: CanvasRenderingContext2D, icons: Record<string, CustomIconImage>, point: Point, type: string, isHovered: boolean) => void;