2018-02-28 12:45:11 -05:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
import {ComponentFactory} from '@angular/core';
|
|
|
|
import {Observable} from 'rxjs/Observable';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for the events emitted through the NgElementStrategy.
|
|
|
|
*
|
|
|
|
* @experimental
|
|
|
|
*/
|
|
|
|
export interface NgElementStrategyEvent {
|
|
|
|
name: string;
|
|
|
|
value: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Underlying strategy used by the NgElement to create/destroy the component and react to input
|
|
|
|
* changes.
|
|
|
|
*
|
|
|
|
* @experimental
|
|
|
|
*/
|
|
|
|
export interface NgElementStrategy {
|
|
|
|
events: Observable<NgElementStrategyEvent>;
|
|
|
|
|
|
|
|
connect(element: HTMLElement): void;
|
|
|
|
disconnect(): void;
|
2018-03-02 13:08:16 -05:00
|
|
|
getInputValue(propName: string): any;
|
|
|
|
setInputValue(propName: string, value: string): void;
|
2018-02-28 12:45:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Factory used to create new strategies for each NgElement instance.
|
|
|
|
*
|
|
|
|
* @experimental
|
|
|
|
*/
|
|
|
|
export interface NgElementStrategyFactory { create(): NgElementStrategy; }
|