/** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ /** * A symbol used to access dispatch hooks on an event. */ const dispatchHooks = Symbol('dispatchHooks'); /** * An `Event` with additional symbols for dispatch hooks. */ interface EventWithDispatchHooks extends Event { [dispatchHooks]: EventTarget; } /** * Add a hook for an event that is called after the event is dispatched and * propagates to other event listeners. * * This is useful for behaviors that need to check if an event is canceled. * * The callback is invoked synchronously, which allows for better integration * with synchronous platform APIs (like `
` or `