Skip to content

BlockSuite API Documentation / @blocksuite/blocks / on

Function: on()

on(element, event, handler, options)

on<T, K, M>(element, event, handler, options?): () => void

Type parameters

T extends HTMLElement

K extends string | number | symbol

M = HTMLElementEventMap

Parameters

element: T

event: K

handler: (ev) => void

options?: boolean | AddEventListenerOptions

Returns

Function

Returns

void

Source

packages/blocks/src/_common/utils/event.ts:34

on(element, event, handler, options)

on<T>(element, event, handler, options?): () => void

Type parameters

T extends HTMLElement

Parameters

element: T

event: string

handler: (ev) => void

options?: boolean | AddEventListenerOptions

Returns

Function

Returns

void

Source

packages/blocks/src/_common/utils/event.ts:44

on(element, event, handler, options)

on<T, K, M>(element, event, handler, options?): () => void

Type parameters

T extends Document

K extends string | number | symbol

M = DocumentEventMap

Parameters

element: T

event: K

handler: (ev) => void

options?: boolean | AddEventListenerOptions

Returns

Function

Returns

void

Source

packages/blocks/src/_common/utils/event.ts:50


Generated using TypeDoc and typedoc-plugin-markdown.