Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions src/cdk/platform/features/backwards-compatibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Renderer2, VERSION, ListenerOptions} from '@angular/core';
import {Renderer2, VERSION} from '@angular/core';

// TODO(crisbeto): replace interface with the one from core when making breaking changes for v20.
/** Options when binding events manually. */
export interface _ListenerOptions {
capture?: boolean;
once?: boolean;
passive?: boolean;
}

// TODO(crisbeto): remove this function when making breaking changes for v20.
/**
Expand All @@ -20,7 +28,7 @@ export function _bindEventWithOptions(
target: EventTarget,
eventName: string,
callback: (event: any) => boolean | void,
options: ListenerOptions,
options: _ListenerOptions,
): () => void {
const major = parseInt(VERSION.major);
const minor = parseInt(VERSION.minor);
Expand Down
13 changes: 11 additions & 2 deletions tools/public_api_guard/cdk/platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
```ts

import * as i0 from '@angular/core';
import { ListenerOptions } from '@angular/core';
import { Renderer2 } from '@angular/core';

// @public
export function _bindEventWithOptions(renderer: Renderer2, target: EventTarget, eventName: string, callback: (event: any) => boolean | void, options: ListenerOptions): () => void;
export function _bindEventWithOptions(renderer: Renderer2, target: EventTarget, eventName: string, callback: (event: any) => boolean | void, options: _ListenerOptions): () => void;

// @public
export function _getEventTarget<T extends EventTarget>(event: Event): T | null;
Expand All @@ -29,6 +28,16 @@ export function getSupportedInputTypes(): Set<string>;
// @public
export function _isTestEnvironment(): boolean;

// @public
export interface _ListenerOptions {
// (undocumented)
capture?: boolean;
// (undocumented)
once?: boolean;
// (undocumented)
passive?: boolean;
}

// @public
export function normalizePassiveListenerOptions(options: AddEventListenerOptions): AddEventListenerOptions | boolean;

Expand Down
Loading