import {isBlank, Type} from '../facade/lang'; var _DOM: DomAdapter = null; export function getDOM() { return _DOM; } export function setDOM(adapter: DomAdapter) { _DOM = adapter; } export function setRootDomAdapter(adapter: DomAdapter) { if (isBlank(_DOM)) { _DOM = adapter; } } /* tslint:disable:requireParameterType */ /** * Provides DOM operations in an environment-agnostic way. */ export abstract class DomAdapter { public xhrType: Type = null; abstract hasProperty(element: any /** TODO #9100 */, name: string): boolean; abstract setProperty(el: Element, name: string, value: any): any /** TODO #9100 */; abstract getProperty(el: Element, name: string): any; abstract invoke(el: Element, methodName: string, args: any[]): any; abstract logError(error: any /** TODO #9100 */): any /** TODO #9100 */; abstract log(error: any /** TODO #9100 */): any /** TODO #9100 */; abstract logGroup(error: any /** TODO #9100 */): any /** TODO #9100 */; abstract logGroupEnd(): any /** TODO #9100 */; /** @deprecated */ getXHR(): Type { return this.xhrType; } /** * Maps attribute names to their corresponding property names for cases * where attribute name doesn't match property name. */ get attrToPropMap(): {[key: string]: string} { return this._attrToPropMap; }; set attrToPropMap(value: {[key: string]: string}) { this._attrToPropMap = value; }; /** @internal */ _attrToPropMap: {[key: string]: string}; abstract parse(templateHtml: string): any /** TODO #9100 */; abstract query(selector: string): any; abstract querySelector(el: any /** TODO #9100 */, selector: string): HTMLElement; abstract querySelectorAll(el: any /** TODO #9100 */, selector: string): any[]; abstract on(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */): any /** TODO #9100 */; abstract onAndCancel(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */): Function; abstract dispatchEvent(el: any /** TODO #9100 */, evt: any /** TODO #9100 */): any /** TODO #9100 */; abstract createMouseEvent(eventType: any /** TODO #9100 */): any; abstract createEvent(eventType: string): any; abstract preventDefault(evt: any /** TODO #9100 */): any /** TODO #9100 */; abstract isPrevented(evt: any /** TODO #9100 */): boolean; abstract getInnerHTML(el: any /** TODO #9100 */): string; /** Returns content if el is a