@loadsmart/miranda-wc
Version:
Miranda Web Components component library
35 lines (34 loc) • 1.28 kB
TypeScript
import type { ReactiveControllerHost, ReactiveController } from 'lit';
import type { AcceptedType, SelectionState, SelectionStrategy, SelectionType } from '../../utils/selection';
type SelectionHost = ReactiveControllerHost & HTMLElement & {
selection: SelectionState;
type: SelectionType;
};
/**
* Manage selection through the SelectionStrategy.
* `host` is expected to have a `selection` and a `type` (`SelectionType`) properties/state.
* @deprecated Use `SelectionController` (named import) instead.
*/
declare class SelectionController implements ReactiveController {
#private;
disabled: boolean;
event: string;
host: SelectionHost;
strategy: SelectionStrategy;
type: SelectionType;
/**
* @param Type of selection to be managed.
* @param Name of the event that should be listened to.
*/
constructor(host: SelectionHost, type: SelectionType, event: string);
hostConnected(): void;
hostDisconnected(): void;
hostUpdate(): void;
init: (values: AcceptedType[]) => void;
select: (values: AcceptedType[]) => void;
unselect: (values: AcceptedType[]) => void;
toggle: (values: AcceptedType[]) => void;
subscribe: () => void;
unsubscribe: () => void;
}
export default SelectionController;