2018-03-14 16:24:27 -04:00
|
|
|
export declare function createCustomElement<P>(component: Type<any>, config: NgElementConfig): NgElementConstructor<P>;
|
2018-02-28 12:45:11 -05:00
|
|
|
|
|
|
|
export declare abstract class NgElement extends HTMLElement {
|
|
|
|
protected ngElementEventsSubscription: Subscription | null;
|
2020-07-15 06:21:04 -04:00
|
|
|
protected abstract ngElementStrategy: NgElementStrategy;
|
2018-02-28 12:45:11 -05:00
|
|
|
abstract attributeChangedCallback(attrName: string, oldValue: string | null, newValue: string, namespace?: string): void;
|
|
|
|
abstract connectedCallback(): void;
|
|
|
|
abstract disconnectedCallback(): void;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgElementConfig {
|
2018-03-02 01:34:21 -05:00
|
|
|
injector: Injector;
|
|
|
|
strategyFactory?: NgElementStrategyFactory;
|
2018-02-28 12:45:11 -05:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgElementConstructor<P> {
|
2018-02-28 12:45:11 -05:00
|
|
|
readonly observedAttributes: string[];
|
2020-03-04 20:27:27 -05:00
|
|
|
new (injector?: Injector): NgElement & WithProperties<P>;
|
2018-02-28 12:45:11 -05:00
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgElementStrategy {
|
2018-02-28 12:45:11 -05:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgElementStrategyEvent {
|
2018-02-28 12:45:11 -05:00
|
|
|
name: string;
|
|
|
|
value: any;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface NgElementStrategyFactory {
|
2018-03-06 17:02:25 -05:00
|
|
|
create(injector: Injector): NgElementStrategy;
|
2018-02-28 12:45:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare const VERSION: Version;
|
2018-03-02 13:08:16 -05:00
|
|
|
|
|
|
|
export declare type WithProperties<P> = {
|
|
|
|
[property in keyof P]: P[property];
|
|
|
|
};
|