Skip to content

Commit 006f196

Browse files
authored
refactor: transform overlay types from interface to type (#2675)
Previously, these types were defined as `interface`. The changes suggests moving them to `type` aliases, aligning with TypeScript's philosophy. This change does not affect the API contract and is aimed at providing a better match to the intended usage of the structures, and a consistent declaration with the `StyleUpdate` type.
1 parent be1c17a commit 006f196

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/component/registry/types.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,27 @@ export type OverlayPosition = OverlayShapePosition | OverlayEdgePosition;
7474
/**
7575
* @category Overlays
7676
*/
77-
export interface OverlayStyle {
77+
export type OverlayStyle = {
7878
font?: OverlayFont;
7979
fill?: OverlayFill;
8080
stroke?: OverlayStroke;
81-
}
81+
};
8282

8383
/**
8484
* The font family is {@link StyleDefault.DEFAULT_FONT_FAMILY}.
8585
* @category Overlays
8686
*/
87-
export interface OverlayFont {
87+
export type OverlayFont = {
8888
/** @default {@link StyleDefault.DEFAULT_OVERLAY_FONT_COLOR} */
8989
color?: string;
9090
/** @default {@link StyleDefault.DEFAULT_OVERLAY_FONT_SIZE} */
9191
size?: number;
92-
}
92+
};
9393

9494
/**
9595
* @category Overlays
9696
*/
97-
export interface OverlayFill {
97+
export type OverlayFill = {
9898
/** @default {@link StyleDefault.DEFAULT_OVERLAY_FILL_COLOR} */
9999
color?: string;
100100
/**
@@ -104,12 +104,12 @@ export interface OverlayFill {
104104
* @default {@link StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY}
105105
*/
106106
opacity?: number;
107-
}
107+
};
108108

109109
/**
110110
* @category Overlays
111111
*/
112-
export interface OverlayStroke {
112+
export type OverlayStroke = {
113113
/**
114114
* If you don't want to display a stroke, you can set the color to
115115
* * `transparent`
@@ -123,16 +123,16 @@ export interface OverlayStroke {
123123
* @default {@link StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH}
124124
*/
125125
width?: number;
126-
}
126+
};
127127

128128
/**
129129
* @category Overlays
130130
*/
131-
export interface Overlay {
131+
export type Overlay = {
132132
position: OverlayPosition;
133133
label?: string;
134134
style?: OverlayStyle;
135-
}
135+
};
136136

137137
/**
138138
* @category Element Style

0 commit comments

Comments
 (0)