fix/svg-argument-type (#37327)

This commit is contained in:
Gábor Balogh 2019-08-05 21:47:22 +01:00 committed by Nathan Shively-Sanders
parent 9a962ba5ec
commit 0458df12b4
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import { sparkline } from '@fnando/sparkline';
import * as sparkline2 from '@fnando/sparkline';
import sparkline3 from '@fnando/sparkline';
const svg = document.createElement('svg') as any as SVGElement;
const svg = document.createElement('svg') as any as SVGSVGElement;
// number entries
sparkline(svg, [1, 2, 3]);

View File

@ -49,7 +49,7 @@ type SparklineNonNativeOptions<TEntry> = SparklineOptions | SparklineOptionsFetc
* @param entries You can either provide an array of numbers or an array of objects that respond to .value. If you have a different data structure, see options.fetch.
* @param options This optional argument allows you to further customize the sparkline.
*/
export function sparkline<TEntry extends SparklineNativeEntry>(svg: SVGElement, entries: TEntry[], options?: SparklineNativeOptions<TEntry>): string;
export function sparkline<TEntry>(svg: SVGElement, entries: TEntry[], options: SparklineNonNativeOptions<TEntry>): string;
export function sparkline<TEntry extends SparklineNativeEntry>(svg: SVGSVGElement, entries: TEntry[], options?: SparklineNativeOptions<TEntry>): string;
export function sparkline<TEntry>(svg: SVGSVGElement, entries: TEntry[], options: SparklineNonNativeOptions<TEntry>): string;
export default sparkline;