From 2a55a7f8b88400f280ba20d6b17290d27720af3a Mon Sep 17 00:00:00 2001 From: Mingze Xiao Date: Thu, 26 Mar 2020 16:37:34 -0700 Subject: [PATCH] feat(annotations): Address comments --- src/lib/AnnotationControls.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/AnnotationControls.ts b/src/lib/AnnotationControls.ts index f97d9fa95..c625dc027 100644 --- a/src/lib/AnnotationControls.ts +++ b/src/lib/AnnotationControls.ts @@ -6,9 +6,9 @@ export const CLASS_ANNOTATIONS_GROUP = 'bp-AnnotationControls-group'; export const CLASS_REGION_BUTTON = 'bp-AnnotationControls-regionBtn'; export const CLASS_BUTTON_ACTIVE = 'is-active'; -export type RegionHandlerType = ({ isRegionActive, event }: { isRegionActive: boolean; event: MouseEvent }) => void; +export type RegionHandler = ({ isRegionActive, event }: { isRegionActive: boolean; event: MouseEvent }) => void; export type Options = { - onRegionClick?: RegionHandlerType; + onRegionClick?: RegionHandler; }; declare const __: (key: string) => string; @@ -37,11 +37,11 @@ export default class AnnotationControls { /** * Region comment button click handler * - * @param {RegionHandlerType} onRegionClick - region click handler in options + * @param {RegionHandler} onRegionClick - region click handler in options * @param {MouseEvent} event - mouse event * @return {void} */ - private handleRegionClick = (onRegionClick: RegionHandlerType) => (event: MouseEvent): void => { + private handleRegionClick = (onRegionClick: RegionHandler) => (event: MouseEvent): void => { const regionButtonElement = event.target as HTMLButtonElement; this.isRegionActive = !this.isRegionActive; @@ -57,7 +57,7 @@ export default class AnnotationControls { /** * Initialize the annotation controls with options. * - * @param {RegionHandlerType} [options.onRegionClick] - Callback when region comment button is clicked + * @param {RegionHandler} [options.onRegionClick] - Callback when region comment button is clicked * @return {void} */ public init({ onRegionClick = noop }: Options = {}): void {