Skip to content

Commit ce4c2c0

Browse files
authored
fix(multiple): remove empty constructors (#33048)
When we made the transition to `inject`, we added some constructors for backwards compatibility. These changes remove them since they weren't used for anything. BREAKING CHANGE: * A bunch of constructors that with rest arguments have been removed. If you were extending Material/CDK components, you may have to update your `super` calls accordingly.
1 parent f96dc4d commit ce4c2c0

File tree

218 files changed

+114
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+114
-757
lines changed

goldens/cdk/a11y/index.api.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function addAriaReferencedId(el: Element, attr: `aria-${string}`, id: str
4646

4747
// @public
4848
export class AriaDescriber implements OnDestroy {
49-
constructor(...args: unknown[]);
49+
constructor();
5050
describe(hostElement: Element, message: string, role?: string): void;
5151
describe(hostElement: Element, message: HTMLElement): void;
5252
ngOnDestroy(): void;
@@ -69,7 +69,7 @@ export const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message";
6969

7070
// @public
7171
export class CdkAriaLive implements OnDestroy {
72-
constructor(...args: unknown[]);
72+
constructor();
7373
duration: number;
7474
// (undocumented)
7575
ngOnDestroy(): void;
@@ -83,7 +83,6 @@ export class CdkAriaLive implements OnDestroy {
8383

8484
// @public
8585
export class CdkMonitorFocus implements AfterViewInit, OnDestroy {
86-
constructor(...args: unknown[]);
8786
// (undocumented)
8887
readonly cdkFocusChange: EventEmitter<FocusOrigin>;
8988
// (undocumented)
@@ -100,7 +99,7 @@ export class CdkMonitorFocus implements AfterViewInit, OnDestroy {
10099

101100
// @public
102101
export class CdkTrapFocus implements OnDestroy, AfterContentInit, OnChanges, DoCheck {
103-
constructor(...args: unknown[]);
102+
constructor();
104103
autoCapture: boolean;
105104
get enabled(): boolean;
106105
set enabled(value: boolean);
@@ -140,7 +139,7 @@ export interface ConfigurableFocusTrapConfig {
140139

141140
// @public
142141
export class ConfigurableFocusTrapFactory {
143-
constructor(...args: unknown[]);
142+
constructor();
144143
create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap;
145144
// @deprecated (undocumented)
146145
create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap;
@@ -177,7 +176,7 @@ export class FocusKeyManager<T> extends ListKeyManager<FocusableOption & T> {
177176

178177
// @public
179178
export class FocusMonitor implements OnDestroy {
180-
constructor(...args: unknown[]);
179+
constructor();
181180
protected _document: Document;
182181
focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions_2): void;
183182
focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions_2): void;
@@ -248,7 +247,7 @@ export class FocusTrap {
248247

249248
// @public
250249
export class FocusTrapFactory {
251-
constructor(...args: unknown[]);
250+
constructor();
252251
create(element: HTMLElement, deferCaptureElements?: boolean): FocusTrap;
253252
// (undocumented)
254253
static ɵfac: i0.ɵɵFactoryDeclaration<FocusTrapFactory, never>;
@@ -277,7 +276,7 @@ export enum HighContrastMode {
277276

278277
// @public
279278
export class HighContrastModeDetector implements OnDestroy {
280-
constructor(...args: unknown[]);
279+
constructor();
281280
_applyBodyHighContrastModeCssClasses(): void;
282281
getHighContrastMode(): HighContrastMode;
283282
// (undocumented)
@@ -314,7 +313,7 @@ export type InputModality = 'keyboard' | 'mouse' | 'touch' | null;
314313

315314
// @public
316315
export class InputModalityDetector implements OnDestroy {
317-
constructor(...args: unknown[]);
316+
constructor();
318317
readonly modalityChanged: Observable<InputModality>;
319318
readonly modalityDetected: Observable<InputModality>;
320319
get mostRecentModality(): InputModality;
@@ -334,7 +333,6 @@ export interface InputModalityDetectorOptions {
334333

335334
// @public
336335
export class InteractivityChecker {
337-
constructor(...args: unknown[]);
338336
isDisabled(element: HTMLElement): boolean;
339337
isFocusable(element: HTMLElement, config?: IsFocusableConfig): boolean;
340338
isTabbable(element: HTMLElement): boolean;
@@ -404,7 +402,7 @@ export const LIVE_ANNOUNCER_ELEMENT_TOKEN: InjectionToken<HTMLElement | null>;
404402

405403
// @public (undocumented)
406404
export class LiveAnnouncer implements OnDestroy {
407-
constructor(...args: unknown[]);
405+
constructor();
408406
announce(message: LiveAnnouncerMessage): Promise<void>;
409407
announce(message: LiveAnnouncerMessage, politeness?: AriaLivePoliteness): Promise<void>;
410408
announce(message: LiveAnnouncerMessage, duration?: number): Promise<void>;

goldens/cdk/accordion/index.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export class CdkAccordion implements OnDestroy, OnChanges {
3838

3939
// @public
4040
export class CdkAccordionItem implements OnInit, OnDestroy {
41-
constructor(...args: unknown[]);
4241
// (undocumented)
4342
accordion: CdkAccordion;
4443
close(): void;

goldens/cdk/bidi/index.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export type Direction = 'ltr' | 'rtl';
4646

4747
// @public
4848
export class Directionality implements OnDestroy {
49-
constructor(...args: unknown[]);
49+
constructor();
5050
readonly change: EventEmitter<Direction>;
5151
// (undocumented)
5252
ngOnDestroy(): void;

goldens/cdk/clipboard/index.api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const CDK_COPY_TO_CLIPBOARD_CONFIG: InjectionToken<CdkCopyToClipboardConf
1414

1515
// @public
1616
export class CdkCopyToClipboard implements OnDestroy {
17-
constructor(...args: unknown[]);
17+
constructor();
1818
attempts: number;
1919
readonly copied: EventEmitter<boolean>;
2020
copy(attempts?: number): void;
@@ -34,7 +34,6 @@ export interface CdkCopyToClipboardConfig {
3434

3535
// @public
3636
class Clipboard_2 {
37-
constructor(...args: unknown[]);
3837
beginCopy(text: string): PendingCopy;
3938
copy(text: string): boolean;
4039
// (undocumented)

goldens/cdk/dialog/index.api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading';
4040

4141
// @public
4242
export class CdkDialogContainer<C extends DialogConfig = DialogConfig> extends BasePortalOutlet implements DialogContainer, OnDestroy {
43-
constructor(...args: unknown[]);
43+
constructor();
4444
// (undocumented)
4545
_addAriaLabelledBy(id: string): void;
4646
_ariaLabelledByQueue: string[];
@@ -84,7 +84,6 @@ export const DEFAULT_DIALOG_CONFIG: InjectionToken<DialogConfig<unknown, unknown
8484

8585
// @public (undocumented)
8686
export class Dialog implements OnDestroy {
87-
constructor(...args: unknown[]);
8887
readonly afterAllClosed: Observable<void>;
8988
get afterOpened(): Subject<DialogRef<any, any>>;
9089
closeAll(): void;

goldens/cdk/drag-drop/index.api.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const CDK_DROP_LIST_GROUP: InjectionToken<CdkDropListGroup<CdkDropList<an
4545

4646
// @public
4747
export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
48-
constructor(...args: unknown[]);
48+
constructor();
4949
// (undocumented)
5050
_addHandle(handle: CdkDragHandle): void;
5151
boundaryElement: string | ElementRef<HTMLElement> | HTMLElement;
@@ -152,7 +152,7 @@ export interface CdkDragExit<T = any, I = T> {
152152

153153
// @public
154154
export class CdkDragHandle implements AfterViewInit, OnDestroy {
155-
constructor(...args: unknown[]);
155+
constructor();
156156
get disabled(): boolean;
157157
set disabled(value: boolean);
158158
// (undocumented)
@@ -190,7 +190,7 @@ export interface CdkDragMove<T = any> {
190190

191191
// @public
192192
export class CdkDragPlaceholder<T = any> implements OnDestroy {
193-
constructor(...args: unknown[]);
193+
constructor();
194194
data: T;
195195
// (undocumented)
196196
ngOnDestroy(): void;
@@ -204,7 +204,7 @@ export class CdkDragPlaceholder<T = any> implements OnDestroy {
204204

205205
// @public
206206
export class CdkDragPreview<T = any> implements OnDestroy {
207-
constructor(...args: unknown[]);
207+
constructor();
208208
data: T;
209209
matchSize: boolean;
210210
// (undocumented)
@@ -241,7 +241,7 @@ export interface CdkDragStart<T = any> {
241241

242242
// @public
243243
export class CdkDropList<T = any> implements OnDestroy {
244-
constructor(...args: unknown[]);
244+
constructor();
245245
addItem(item: CdkDrag): void;
246246
autoScrollDisabled: boolean;
247247
autoScrollStep: NumberInput;
@@ -313,7 +313,6 @@ export type DragConstrainPosition = (userPointerPosition: Point, dragRef: DragRe
313313

314314
// @public @deprecated
315315
export class DragDrop {
316-
constructor(...args: unknown[]);
317316
// @deprecated
318317
createDrag<T = any>(element: ElementRef<HTMLElement> | HTMLElement, config?: DragRefConfig): DragRef<T>;
319318
// @deprecated
@@ -364,7 +363,6 @@ export class DragDropModule {
364363

365364
// @public
366365
export class DragDropRegistry implements OnDestroy {
367-
constructor(...args: unknown[]);
368366
getDragDirectiveForNode(node: Node): CdkDrag | null;
369367
isDragging(drag: DragRef): boolean;
370368
// (undocumented)

goldens/cdk/layout/index.api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { OnDestroy } from '@angular/core';
1010

1111
// @public
1212
export class BreakpointObserver implements OnDestroy {
13-
constructor(...args: unknown[]);
1413
isMatched(value: string | readonly string[]): boolean;
1514
ngOnDestroy(): void;
1615
observe(value: string | readonly string[]): Observable<BreakpointState>;
@@ -58,7 +57,7 @@ export class LayoutModule {
5857

5958
// @public
6059
export class MediaMatcher {
61-
constructor(...args: unknown[]);
60+
constructor();
6261
matchMedia(query: string): MediaQueryList;
6362
// (undocumented)
6463
static ɵfac: i0.ɵɵFactoryDeclaration<MediaMatcher, never>;

goldens/cdk/observers/index.api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { OnDestroy } from '@angular/core';
1313

1414
// @public
1515
export class CdkObserveContent implements AfterContentInit, OnDestroy {
16-
constructor(...args: unknown[]);
1716
get debounce(): number;
1817
set debounce(value: NumberInput);
1918
get disabled(): boolean;
@@ -33,7 +32,6 @@ export class CdkObserveContent implements AfterContentInit, OnDestroy {
3332

3433
// @public
3534
export class ContentObserver implements OnDestroy {
36-
constructor(...args: unknown[]);
3735
// (undocumented)
3836
ngOnDestroy(): void;
3937
observe(element: Element): Observable<MutationRecord[]>;

goldens/cdk/overlay/index.api.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG: InjectionToken<CdkConnectedOv
4444

4545
// @public
4646
export class CdkConnectedOverlay implements OnDestroy, OnChanges {
47-
constructor(...args: unknown[]);
47+
constructor();
4848
readonly attach: EventEmitter<void>;
4949
attachOverlay(): void;
5050
backdropClass: string | string[];
@@ -158,7 +158,6 @@ export interface CdkConnectedOverlayConfig {
158158

159159
// @public
160160
export class CdkOverlayOrigin {
161-
constructor(...args: unknown[]);
162161
// (undocumented)
163162
elementRef: ElementRef<any>;
164163
// (undocumented)
@@ -169,7 +168,6 @@ export class CdkOverlayOrigin {
169168

170169
// @public
171170
export class CdkScrollable implements OnInit, OnDestroy {
172-
constructor(...args: unknown[]);
173171
// (undocumented)
174172
protected readonly _destroyed: Subject<void>;
175173
// (undocumented)
@@ -322,7 +320,6 @@ export type FlexibleOverlayPopoverLocation = 'global' | 'inline' | {
322320

323321
// @public
324322
export class FullscreenOverlayContainer extends OverlayContainer implements OnDestroy {
325-
constructor(...args: unknown[]);
326323
// (undocumented)
327324
protected _createContainer(): void;
328325
getFullscreenElement(): Element;
@@ -374,7 +371,6 @@ export interface OriginConnectionPosition {
374371

375372
// @public
376373
export class Overlay {
377-
constructor(...args: unknown[]);
378374
create(config?: OverlayConfig): OverlayRef;
379375
position(): OverlayPositionBuilder;
380376
// (undocumented)
@@ -419,7 +415,6 @@ export interface OverlayConnectionPosition {
419415

420416
// @public
421417
export class OverlayContainer implements OnDestroy {
422-
constructor(...args: unknown[]);
423418
// (undocumented)
424419
protected _containerElement: HTMLElement | undefined;
425420
protected _createContainer(): void;
@@ -477,7 +472,6 @@ export class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
477472

478473
// @public
479474
export class OverlayPositionBuilder {
480-
constructor(...args: unknown[]);
481475
flexibleConnectedTo(origin: FlexibleConnectedPositionStrategyOrigin): FlexibleConnectedPositionStrategy;
482476
global(): GlobalPositionStrategy;
483477
// (undocumented)
@@ -567,7 +561,6 @@ export interface RepositionScrollStrategyConfig {
567561

568562
// @public
569563
export class ScrollDispatcher implements OnDestroy {
570-
constructor(...args: unknown[]);
571564
ancestorScrolled(elementOrElementRef: ElementRef | HTMLElement, auditTimeInMs?: number): Observable<CdkScrollable | void>;
572565
deregister(scrollable: CdkScrollable): void;
573566
getAncestorScrollContainers(elementOrElementRef: ElementRef | HTMLElement): CdkScrollable[];
@@ -604,7 +597,6 @@ export interface ScrollStrategy {
604597

605598
// @public
606599
export class ScrollStrategyOptions {
607-
constructor(...args: unknown[]);
608600
block: () => BlockScrollStrategy;
609601
close: (config?: CloseScrollStrategyConfig) => CloseScrollStrategy;
610602
noop: () => NoopScrollStrategy;
@@ -640,7 +632,7 @@ export type ViewportMargin = number | {
640632

641633
// @public
642634
export class ViewportRuler implements OnDestroy {
643-
constructor(...args: unknown[]);
635+
constructor();
644636
change(throttleTime?: number): Observable<Event>;
645637
protected _document: Document;
646638
getViewportRect(): {

goldens/cdk/platform/index.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export function normalizePassiveListenerOptions(options: AddEventListenerOptions
2929

3030
// @public
3131
export class Platform {
32-
constructor(..._args: unknown[]);
3332
ANDROID: boolean;
3433
BLINK: boolean;
3534
EDGE: boolean;

0 commit comments

Comments
 (0)