Skip to content

Commit

Permalink
add missing ts docs
Browse files Browse the repository at this point in the history
  • Loading branch information
illetid committed Aug 29, 2024
1 parent ea8a044 commit 1858abf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ export default [
{
name: 'ESM',
path: 'dist/lightweight-charts.production.mjs',
limit: '45.00 KB',
limit: '44.50 KB',
import: '*',
ignore: ['fancy-canvas'],
brotli: true,
},
{
name: 'ESM createChart',
path: 'dist/lightweight-charts.production.mjs',
limit: '45.00 KB',
limit: '41.30 KB',
import: '{ createChart }',
ignore: ['fancy-canvas'],
brotli: true,
},
{
name: 'ESM createChartEx',
path: 'dist/lightweight-charts.production.mjs',
limit: '45.00 KB',
limit: '40.00 KB',
import: '{ createChartEx }',
ignore: ['fancy-canvas'],
brotli: true,
},
{
name: 'ESM Standalone',
path: 'dist/lightweight-charts.standalone.production.mjs',
limit: '50.00 KB',
limit: '45.90 KB',
import: '*',
brotli: true,
},
Expand Down Expand Up @@ -63,7 +63,7 @@ export default [
path: 'dist/lightweight-charts.production.mjs',
import: '{ createSeriesMarkersPrimitive }',
ignore: ['fancy-canvas'],
limit: '3.00 KB',
limit: '3.90 KB',
brotli: true,
},
];
20 changes: 7 additions & 13 deletions src/plugins/series-markers/primitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,12 @@ import { Logical, TimePointIndex } from '../../model/time-data';
import { UpdateType } from '../../views/pane/iupdatable-pane-view';

import { SeriesMarkersPaneView } from './pane-view';
import { InternalSeriesMarker, SeriesMarkerPosition, SeriesMarkerShape } from './types';
import { InternalSeriesMarker, MarkerPositions, SeriesMarker } from './types';
import {
calculateAdjustedMargin,
calculateShapeHeight,
shapeMargin as calculateShapeMargin,
} from './utils';
interface SeriesMarker<TimeType> {
time: TimeType;
position: SeriesMarkerPosition;
shape: SeriesMarkerShape;
color: string;
id?: string;
text?: string;
size?: number;
originalTime?: TimeType;
}

type MarkerPositions = Record<SeriesMarkerPosition, boolean>;

class SeriesMarkersPrimitive<HorzScaleItem> implements ISeriesPrimitive<HorzScaleItem> {
private _attached: SeriesAttachedParameter<HorzScaleItem> | null = null;
Expand Down Expand Up @@ -206,6 +194,12 @@ class SeriesMarkersPrimitive<HorzScaleItem> implements ISeriesPrimitive<HorzScal
/**
* A function to create a series markers primitive.
*
* @param series - The series to which the primitive will be attached.
*
* @param chart - The chart instance.
*
* @param markers - An array of markers to be displayed on the series.
*
* @example
* ```js
* import { createSeriesMarkersPrimitive } from 'lightweight-charts';
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/series-markers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export interface SeriesMarker<TimeType = Time> {
originalTime: unknown;
}

export type MarkerPositions = Record<SeriesMarkerPosition, boolean>;

export interface InternalSeriesMarker<TimeType> extends SeriesMarker<TimeType> {
internalId: number;
}

0 comments on commit 1858abf

Please sign in to comment.