1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { OnDestroy } from '@angular/core';
|
---|
9 | import * as ɵngcc0 from '@angular/core';
|
---|
10 | export declare type UniqueSelectionDispatcherListener = (id: string, name: string) => void;
|
---|
11 | /**
|
---|
12 | * Class to coordinate unique selection based on name.
|
---|
13 | * Intended to be consumed as an Angular service.
|
---|
14 | * This service is needed because native radio change events are only fired on the item currently
|
---|
15 | * being selected, and we still need to uncheck the previous selection.
|
---|
16 | *
|
---|
17 | * This service does not *store* any IDs and names because they may change at any time, so it is
|
---|
18 | * less error-prone if they are simply passed through when the events occur.
|
---|
19 | */
|
---|
20 | export declare class UniqueSelectionDispatcher implements OnDestroy {
|
---|
21 | private _listeners;
|
---|
22 | /**
|
---|
23 | * Notify other items that selection for the given name has been set.
|
---|
24 | * @param id ID of the item.
|
---|
25 | * @param name Name of the item.
|
---|
26 | */
|
---|
27 | notify(id: string, name: string): void;
|
---|
28 | /**
|
---|
29 | * Listen for future changes to item selection.
|
---|
30 | * @return Function used to deregister listener
|
---|
31 | */
|
---|
32 | listen(listener: UniqueSelectionDispatcherListener): () => void;
|
---|
33 | ngOnDestroy(): void;
|
---|
34 | static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<UniqueSelectionDispatcher, never>;
|
---|
35 | }
|
---|
36 |
|
---|
37 | //# sourceMappingURL=unique-selection-dispatcher.d.ts.map |
---|