Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: transform overlay types from interface to type #2675

Merged
merged 1 commit into from
May 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/component/registry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ export type OverlayPosition = OverlayShapePosition | OverlayEdgePosition;
/**
* @category Overlays
*/
export interface OverlayStyle {
export type OverlayStyle = {
font?: OverlayFont;
fill?: OverlayFill;
stroke?: OverlayStroke;
}
};

/**
* The font family is {@link StyleDefault.DEFAULT_FONT_FAMILY}.
* @category Overlays
*/
export interface OverlayFont {
export type OverlayFont = {
/** @default {@link StyleDefault.DEFAULT_OVERLAY_FONT_COLOR} */
color?: string;
/** @default {@link StyleDefault.DEFAULT_OVERLAY_FONT_SIZE} */
size?: number;
}
};

/**
* @category Overlays
*/
export interface OverlayFill {
export type OverlayFill = {
/** @default {@link StyleDefault.DEFAULT_OVERLAY_FILL_COLOR} */
color?: string;
/**
Expand All @@ -104,12 +104,12 @@ export interface OverlayFill {
* @default {@link StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY}
*/
opacity?: number;
}
};

/**
* @category Overlays
*/
export interface OverlayStroke {
export type OverlayStroke = {
/**
* If you don't want to display a stroke, you can set the color to
* * `transparent`
Expand All @@ -123,16 +123,16 @@ export interface OverlayStroke {
* @default {@link StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH}
*/
width?: number;
}
};

/**
* @category Overlays
*/
export interface Overlay {
export type Overlay = {
position: OverlayPosition;
label?: string;
style?: OverlayStyle;
}
};

/**
* @category Element Style
Expand Down