2018-02-28 12:45:11 -05:00
|
|
|
/** @experimental */
|
2018-03-02 01:34:21 -05:00
|
|
|
export declare function createNgElementConstructor<P>(component: Type<any>, config: NgElementConfig): NgElementConstructor<P>;
|
2018-02-28 12:45:11 -05:00
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export declare abstract class NgElement extends HTMLElement {
|
|
|
|
protected ngElementEventsSubscription: Subscription | null;
|
|
|
|
protected ngElementStrategy: NgElementStrategy;
|
|
|
|
abstract attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string, namespace?: string): void;
|
|
|
|
abstract connectedCallback(): void;
|
|
|
|
abstract disconnectedCallback(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export interface NgElementConfig {
|
2018-03-02 13:08:16 -05:00
|
|
|
attributeToPropertyInputs?: {
|
|
|
|
[key: string]: string;
|
|
|
|
};
|
2018-03-02 01:34:21 -05:00
|
|
|
injector: Injector;
|
|
|
|
propertyInputs?: string[];
|
|
|
|
strategyFactory?: NgElementStrategyFactory;
|
2018-02-28 12:45:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export interface NgElementConstructor<P> {
|
|
|
|
readonly observedAttributes: string[];
|
|
|
|
new (): NgElement & WithProperties<P>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @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
|
|
|
}
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export interface NgElementStrategyEvent {
|
|
|
|
name: string;
|
|
|
|
value: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export interface NgElementStrategyFactory {
|
|
|
|
create(): NgElementStrategy;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export declare const VERSION: Version;
|
2018-03-02 13:08:16 -05:00
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
export declare type WithProperties<P> = {
|
|
|
|
[property in keyof P]: P[property];
|
|
|
|
};
|