From 388918924f849896ff2e716f2ea740afae03ca8b Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sat, 19 Dec 2020 14:56:11 -0500 Subject: [PATCH] Split Element type to it's own definition file (#8206) --- types/element.d.ts | 30 ++++++++++++++++++++++++++++++ types/index.esm.d.ts | 32 ++------------------------------ 2 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 types/element.d.ts diff --git a/types/element.d.ts b/types/element.d.ts new file mode 100644 index 000000000..46ffa781e --- /dev/null +++ b/types/element.d.ts @@ -0,0 +1,30 @@ +import { Point } from './geometric'; + +export interface Element { + readonly x: number; + readonly y: number; + readonly active: boolean; + readonly options: O; + + tooltipPosition(useFinalPosition?: boolean): Point; + hasValue(): boolean; + getProps

(props: [P], final?: boolean): Pick; + getProps

(props: [P, P2], final?: boolean): Pick; + getProps

( + props: [P, P2, P3], + final?: boolean + ): Pick; + getProps

( + props: [P, P2, P3, P4], + final?: boolean + ): Pick; + getProps

( + props: [P, P2, P3, P4, P5], + final?: boolean + ): Pick; + getProps(props: (keyof T)[], final?: boolean): T; +} +export const Element: { + prototype: Element; + new (): Element; +}; diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index 56cbe4b0f..cfe43bb6a 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -13,9 +13,11 @@ */ import { TimeUnit } from "./adapters"; +import { Element }from './element'; import { ChartArea, Point } from './geometric'; export { DateAdapterBase, DateAdapter, TimeUnit, _adapters } from './adapters'; +export { Element } from './element'; export { ChartArea, Point } from './geometric'; export interface ParsingOptions { @@ -634,36 +636,6 @@ export interface Defaults extends CoreChartOptions, ElementChartOptions { } export const defaults: Defaults; - -export interface Element { - readonly x: number; - readonly y: number; - readonly active: boolean; - readonly options: O; - - tooltipPosition(useFinalPosition?: boolean): Point; - hasValue(): boolean; - getProps

(props: [P], final?: boolean): Pick; - getProps

(props: [P, P2], final?: boolean): Pick; - getProps

( - props: [P, P2, P3], - final?: boolean - ): Pick; - getProps

( - props: [P, P2, P3, P4], - final?: boolean - ): Pick; - getProps

( - props: [P, P2, P3, P4, P5], - final?: boolean - ): Pick; - getProps(props: (keyof T)[], final?: boolean): T; -} -export const Element: { - prototype: Element; - new (): Element; -}; - export interface InteractionOptions { axis?: string; intersect?: boolean;