Skip to content

Commit d9a2f84

Browse files
authored
Types: Update LayotPosition (#8555)
1 parent 33ff1fe commit d9a2f84

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

types/layout.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ChartArea } from './geometric';
22

3-
export type LayoutPosition = 'left' | 'top' | 'right' | 'bottom' | 'chartArea';
3+
export type LayoutPosition = 'left' | 'top' | 'right' | 'bottom' | 'center' | 'chartArea' | {[scaleId: string]: number};
44

55
export interface LayoutItem {
66
/**

types/tests/layout/position.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { LayoutPosition } from '../../index.esm';
2+
3+
export const left: LayoutPosition = 'left';
4+
export const right: LayoutPosition = 'right';
5+
export const top: LayoutPosition = 'top';
6+
export const bottom: LayoutPosition = 'bottom';
7+
export const center: LayoutPosition = 'center';
8+
export const axis: LayoutPosition = { x: 10 };
9+
10+
// @ts-expect-error invalid position
11+
export const invalid: LayoutPosition = 'none';

0 commit comments

Comments
 (0)