Skip to content

Commit

Permalink
chore(LayerManager): add comments to code (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov authored Mar 22, 2024
1 parent fdbb052 commit 1fbbd37
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/components/utils/layer-manager/LayerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,37 @@ import {eventBroker} from '../event-broker';
export type LayerCloseReason = 'outsideClick' | 'escapeKeyDown';

export interface LayerExtendableProps {
/**
* Do not handle click outside
*/
disableOutsideClick?: boolean;
/**
* Do not handle Escape key press on keyboard
*/
disableEscapeKeyDown?: boolean;
/**
* This callback will be called when Escape key pressed on keyboard
* This behaviour could be disabled with `disableEscapeKeyDown` option
*/
onEscapeKeyDown?: (event: KeyboardEvent) => void;
/**
* This callback will be called when Enter key is pressed on keyboard
*/
onEnterKeyDown?: (event: KeyboardEvent) => void;
/**
* This callback will be called when click is outside of elements of "top layer"
* This behaviour could be disabled with `disableOutsideClick` option
*/
onOutsideClick?: (event: MouseEvent) => void;
/**
* This callback will be called when Escape key pressed on keyboard, or click outside was made
* This behaviour could be disabled with `disableEscapeKeyDown`
* and `disableOutsideClick` options
*/
onClose?: (event: MouseEvent | KeyboardEvent, reason: LayerCloseReason) => void;
/**
* Type of layer, returns from `getLayers`
*/
type?: string;
}

Expand Down

0 comments on commit 1fbbd37

Please sign in to comment.