license import { ListKeyManager , ListKeyManagerOption } from './list-key-manager' ; import { FocusOrigin } from '../focus-monitor/focus-monitor' ; /**
 * This is the interface for focusable items (used by the FocusKeyManager).
 * Each item must know how to focus itself, whether or not it is currently disabled
 * and be able to supply it's label.
 */ export interface FocusableOption extends ListKeyManagerOption { /** Focuses the `FocusableOption`. */ focus ( origin ? ) : void ; } export class FocusKeyManager < T > extends ListKeyManager < FocusableOption & T > { private _origin : FocusOrigin = 'program' ; param origin setFocusOrigin ( origin ) { this . _origin = origin ; return this ; } param index setActiveItem ( index ) ; param item setActiveItem ( item ) ; setActiveItem ( item ) { super . setActiveItem ( item ) ; if ( this . activeItem ) { this . activeItem . focus ( this . _origin ) ; } } }