lwc-plugin-rectangles
Version:
140 lines (136 loc) • 4.46 kB
text/typescript
// Generated by dts-bundle-generator v8.1.2
import { CanvasRenderingTarget2D } from 'fancy-canvas';
import { AutoscaleInfo, Coordinate, DataChangedScope, IChartApi, ISeriesApi, ISeriesPrimitive, ISeriesPrimitiveAxisView, ISeriesPrimitivePaneRenderer, ISeriesPrimitivePaneView, Logical, SeriesAttachedParameter, SeriesOptionsMap, SeriesPrimitivePaneViewZOrder, Time } from 'lightweight-charts';
declare class RectanglesAxisPaneRenderer implements ISeriesPrimitivePaneRenderer {
_p1: number | null;
_p2: number | null;
_fillColor: string;
_vertical: boolean;
constructor(p1: number | null, p2: number | null, fillColor: string, vertical: boolean);
draw(target: CanvasRenderingTarget2D): void;
}
export interface RectanglesOptions {
fillColor: string;
labelColor: string;
labelTextColor: string;
showLabels: boolean;
priceLabelFormatter: (price: number) => string;
timeLabelFormatter: (time: Time) => string;
borderType: "dashed" | "none";
}
export interface Point {
time: Time;
price: number;
}
export interface RectanglesDataSource {
chart: IChartApi;
series: ISeriesApi<keyof SeriesOptionsMap>;
options: RectanglesOptions;
p1: Point;
p2: Point;
}
declare abstract class RectanglesAxisPaneView implements ISeriesPrimitivePaneView {
_source: RectanglesDataSource;
_p1: number | null;
_p2: number | null;
_vertical: boolean;
constructor(source: RectanglesDataSource, vertical: boolean);
abstract getPoints(): [
Coordinate | null,
Coordinate | null
];
update(): void;
renderer(): RectanglesAxisPaneRenderer;
zOrder(): SeriesPrimitivePaneViewZOrder;
}
declare class RectanglesPriceAxisPaneView extends RectanglesAxisPaneView {
getPoints(): [
Coordinate | null,
Coordinate | null
];
}
declare class RectanglesTimeAxisPaneView extends RectanglesAxisPaneView {
getPoints(): [
Coordinate | null,
Coordinate | null
];
}
declare abstract class RectanglesAxisView implements ISeriesPrimitiveAxisView {
_source: RectanglesDataSource;
_p: Point;
_pos: Coordinate | null;
constructor(source: RectanglesDataSource, p: Point);
abstract update(): void;
abstract text(): string;
coordinate(): Coordinate | -1;
visible(): boolean;
tickVisible(): boolean;
textColor(): string;
backColor(): string;
movePoint(p: Point): void;
}
declare class RectanglesTimeAxisView extends RectanglesAxisView {
update(): void;
text(): string;
}
declare class RectanglesPriceAxisView extends RectanglesAxisView {
update(): void;
text(): string;
}
declare class RectanglesPaneRenderer implements ISeriesPrimitivePaneRenderer {
_p1: ViewPoint;
_p2: ViewPoint;
_fillColor: string;
_borderType: string;
constructor(p1: ViewPoint, p2: ViewPoint, fillColor: string, borderType: string);
draw(target: CanvasRenderingTarget2D): void;
}
export interface ViewPoint {
x: Coordinate | null;
y: Coordinate | null;
}
declare class RectanglesPaneView implements ISeriesPrimitivePaneView {
_source: RectanglesDataSource;
_p1: ViewPoint;
_p2: ViewPoint;
constructor(source: RectanglesDataSource);
update(): void;
renderer(): RectanglesPaneRenderer;
}
declare abstract class PluginBase implements ISeriesPrimitive<Time> {
private _chart;
private _series;
protected dataUpdated?(scope: DataChangedScope): void;
protected requestUpdate(): void;
private _requestUpdate?;
attached({ chart, series, requestUpdate, }: SeriesAttachedParameter<Time>): void;
detached(): void;
get chart(): IChartApi;
get series(): ISeriesApi<keyof SeriesOptionsMap>;
private _fireDataUpdated;
}
export declare class Rectangles extends PluginBase implements RectanglesDataSource {
_options: RectanglesOptions;
_p1: Point;
_p2: Point;
_paneViews: RectanglesPaneView[];
_timeAxisViews: RectanglesTimeAxisView[];
_priceAxisViews: RectanglesPriceAxisView[];
_priceAxisPaneViews: RectanglesPriceAxisPaneView[];
_timeAxisPaneViews: RectanglesTimeAxisPaneView[];
constructor(p1: Point, p2: Point, options?: Partial<RectanglesOptions>);
updateAllViews(): void;
priceAxisViews(): never[];
timeAxisViews(): never[];
paneViews(): RectanglesPaneView[];
priceAxisPaneViews(): never[];
timeAxisPaneViews(): never[];
autoscaleInfo(startTimePoint: Logical, endTimePoint: Logical): AutoscaleInfo | null;
dataUpdated(): void;
_timeCurrentlyVisible(time: Time, startTimePoint: Logical, endTimePoint: Logical): boolean;
get options(): RectanglesOptions;
applyOptions(options: Partial<RectanglesOptions>): void;
get p1(): Point;
get p2(): Point;
}
export {};