style(lint): re-format modules/@angular

This commit is contained in:
Alex Eagle
2016-06-08 16:38:52 -07:00
parent bbed364e7b
commit f39c9c9e75
589 changed files with 21829 additions and 24259 deletions

View File

@ -1,15 +1,12 @@
import {MessageBus} from './message_bus';
import {print, isPresent, DateWrapper, stringify, StringWrapper} from '../../facade/lang';
import {
PromiseCompleter,
PromiseWrapper,
ObservableWrapper,
EventEmitter
} from '../../facade/async';
import {StringMapWrapper} from '../../facade/collection';
import {Serializer} from './serializer';
import {Injectable, Type} from '@angular/core';
import {EventEmitter, ObservableWrapper, PromiseCompleter, PromiseWrapper} from '../../facade/async';
import {StringMapWrapper} from '../../facade/collection';
import {DateWrapper, StringWrapper, isPresent, print, stringify} from '../../facade/lang';
import {MessageBus} from './message_bus';
import {Serializer} from './serializer';
export abstract class ClientMessageBrokerFactory {
/**
* Initializes the given channel and attaches a new {@link ClientMessageBroker} to it.
@ -45,13 +42,14 @@ export class ClientMessageBroker_ extends ClientMessageBroker {
/** @internal */
public _serializer: Serializer;
constructor(messageBus: MessageBus, _serializer: Serializer, public channel: any /** TODO #9100 */) {
constructor(
messageBus: MessageBus, _serializer: Serializer, public channel: any /** TODO #9100 */) {
super();
this._sink = messageBus.to(channel);
this._serializer = _serializer;
var source = messageBus.from(channel);
ObservableWrapper.subscribe(source,
(message: {[key: string]: any}) => this._handleMessage(message));
ObservableWrapper.subscribe(
source, (message: {[key: string]: any}) => this._handleMessage(message));
}
private _generateMessageId(name: string): string {
@ -112,10 +110,10 @@ export class ClientMessageBroker_ extends ClientMessageBroker {
private _handleMessage(message: {[key: string]: any}): void {
var data = new MessageData(message);
// TODO(jteplitz602): replace these strings with messaging constants #3685
if (StringWrapper.equals(data.type, "result") || StringWrapper.equals(data.type, "error")) {
if (StringWrapper.equals(data.type, 'result') || StringWrapper.equals(data.type, 'error')) {
var id = data.id;
if (this._pending.has(id)) {
if (StringWrapper.equals(data.type, "result")) {
if (StringWrapper.equals(data.type, 'result')) {
this._pending.get(id).resolve(data.value);
} else {
this._pending.get(id).reject(data.value, null);
@ -132,9 +130,9 @@ class MessageData {
id: string;
constructor(data: {[key: string]: any}) {
this.type = StringMapWrapper.get(data, "type");
this.id = this._getValueIfPresent(data, "id");
this.value = this._getValueIfPresent(data, "value");
this.type = StringMapWrapper.get(data, 'type');
this.id = this._getValueIfPresent(data, 'id');
this.value = this._getValueIfPresent(data, 'value');
}
/**

View File

@ -1,6 +1,8 @@
import {EventEmitter} from '../../facade/async';
import {NgZone} from '@angular/core';
import {EventEmitter} from '../../facade/async';
/**
* Message Bus is a low level API used to communicate between the UI and the background.
* Communication is based on a channel abstraction. Messages published in a

View File

@ -2,6 +2,6 @@
* All channels used by angular's WebWorker components are listed here.
* You should not use these channels in your application code.
*/
export const RENDERER_CHANNEL = "ng-Renderer";
export const EVENT_CHANNEL = "ng-Events";
export const ROUTER_CHANNEL = "ng-Router";
export const RENDERER_CHANNEL = 'ng-Renderer';
export const EVENT_CHANNEL = 'ng-Events';
export const ROUTER_CHANNEL = 'ng-Router';

View File

@ -1,11 +1,16 @@
import {MessageBus, MessageBusSource, MessageBusSink} from './message_bus';
import {BaseException} from '../../facade/exceptions';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {StringMapWrapper} from '../../facade/collection';
import {Injectable, NgZone} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {StringMapWrapper} from '../../facade/collection';
import {BaseException} from '../../facade/exceptions';
import {MessageBus, MessageBusSink, MessageBusSource} from './message_bus';
// TODO(jteplitz602) Replace this with the definition in lib.webworker.d.ts(#3492)
export interface PostMessageTarget { postMessage: (message: any, transfer?:[ArrayBuffer]) => void; }
export interface PostMessageTarget {
postMessage: (message: any, transfer?: [ArrayBuffer]) => void;
}
export class PostMessageBusSink implements MessageBusSink {
private _zone: NgZone;
@ -63,11 +68,11 @@ export class PostMessageBusSource implements MessageBusSource {
constructor(eventTarget?: EventTarget) {
if (eventTarget) {
eventTarget.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
eventTarget.addEventListener('message', (ev: MessageEvent) => this._handleMessages(ev));
} else {
// if no eventTarget is given we assume we're in a WebWorker and listen on the global scope
const workerScope = <EventTarget>self;
workerScope.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
workerScope.addEventListener('message', (ev: MessageEvent) => this._handleMessages(ev));
}
}

View File

@ -1,7 +1,8 @@
// This file contains interface versions of browser types that can be serialized to Plain Old
// JavaScript Objects
export class LocationType {
constructor(public href: string, public protocol: string, public host: string,
public hostname: string, public port: string, public pathname: string,
public search: string, public hash: string, public origin: string) {}
constructor(
public href: string, public protocol: string, public host: string, public hostname: string,
public port: string, public pathname: string, public search: string, public hash: string,
public origin: string) {}
}

View File

@ -1,11 +1,14 @@
import {Type, isArray, isPresent, serializeEnum} from '../../facade/lang';
import {BaseException} from '../../facade/exceptions';
import {Map, StringMapWrapper, MapWrapper} from '../../facade/collection';
import {RenderComponentType, Injectable, ViewEncapsulation} from '@angular/core';
import {Injectable, RenderComponentType, ViewEncapsulation} from '@angular/core';
import {VIEW_ENCAPSULATION_VALUES} from '../../../core_private';
import {Map, MapWrapper, StringMapWrapper} from '../../facade/collection';
import {BaseException} from '../../facade/exceptions';
import {Type, isArray, isPresent, serializeEnum} from '../../facade/lang';
import {RenderStore} from './render_store';
import {LocationType} from './serialized_types';
// PRIMITIVE is any type that does not need to be serialized (string, number, boolean)
// We set it to String so that it is considered a Type.
export const PRIMITIVE: Type = String;
@ -33,7 +36,7 @@ export class Serializer {
} else if (type === LocationType) {
return this._serializeLocation(obj);
} else {
throw new BaseException("No serializer for " + type.toString());
throw new BaseException('No serializer for ' + type.toString());
}
}
@ -59,7 +62,7 @@ export class Serializer {
} else if (type === LocationType) {
return this._deserializeLocation(map);
} else {
throw new BaseException("No deserializer for " + type.toString());
throw new BaseException('No deserializer for ' + type.toString());
}
}
@ -78,8 +81,9 @@ export class Serializer {
}
private _deserializeLocation(loc: {[key: string]: any}): LocationType {
return new LocationType(loc['href'], loc['protocol'], loc['host'], loc['hostname'], loc['port'],
loc['pathname'], loc['search'], loc['hash'], loc['origin']);
return new LocationType(
loc['href'], loc['protocol'], loc['host'], loc['hostname'], loc['port'], loc['pathname'],
loc['search'], loc['hash'], loc['origin']);
}
private _serializeRenderComponentType(obj: RenderComponentType): Object {
@ -93,9 +97,10 @@ export class Serializer {
}
private _deserializeRenderComponentType(map: {[key: string]: any}): RenderComponentType {
return new RenderComponentType(map['id'], map['templateUrl'], map['slotCount'],
this.deserialize(map['encapsulation'], ViewEncapsulation),
this.deserialize(map['styles'], PRIMITIVE));
return new RenderComponentType(
map['id'], map['templateUrl'], map['slotCount'],
this.deserialize(map['encapsulation'], ViewEncapsulation),
this.deserialize(map['styles'], PRIMITIVE));
}
}

View File

@ -1,9 +1,10 @@
import {Injectable} from '@angular/core';
import {EventEmitter, ObservableWrapper, PromiseWrapper} from '../../facade/async';
import {ListWrapper, Map} from '../../facade/collection';
import {Serializer} from '../shared/serializer';
import {isPresent, Type, FunctionWrapper} from '../../facade/lang';
import {FunctionWrapper, Type, isPresent} from '../../facade/lang';
import {MessageBus} from '../shared/message_bus';
import {EventEmitter, PromiseWrapper, ObservableWrapper} from '../../facade/async';
import {Serializer} from '../shared/serializer';
export abstract class ServiceMessageBrokerFactory {
/**
@ -29,8 +30,8 @@ export class ServiceMessageBrokerFactory_ extends ServiceMessageBrokerFactory {
}
export abstract class ServiceMessageBroker {
abstract registerMethod(methodName: string, signature: Type[], method: Function,
returnType?: Type): void;
abstract registerMethod(
methodName: string, signature: Type[], method: Function, returnType?: Type): void;
}
/**
@ -43,15 +44,18 @@ export class ServiceMessageBroker_ extends ServiceMessageBroker {
private _sink: EventEmitter<any>;
private _methods: Map<string, Function> = new Map<string, Function>();
constructor(messageBus: MessageBus, private _serializer: Serializer, public channel: any /** TODO #9100 */) {
constructor(
messageBus: MessageBus, private _serializer: Serializer,
public channel: any /** TODO #9100 */) {
super();
this._sink = messageBus.to(channel);
var source = messageBus.from(channel);
ObservableWrapper.subscribe(source, (message) => this._handleMessage(message));
}
registerMethod(methodName: string, signature: Type[], method: (..._: any[]) => Promise<any>| void,
returnType?: Type): void {
registerMethod(
methodName: string, signature: Type[], method: (..._: any[]) => Promise<any>| void,
returnType?: Type): void {
this._methods.set(methodName, (message: ReceivedMessage) => {
var serializedArgs = message.args;
let numArgs = signature === null ? 0 : signature.length;

View File

@ -1,13 +1,8 @@
import {Serializer, RenderStoreObject} from '../shared/serializer';
import {
serializeMouseEvent,
serializeKeyboardEvent,
serializeGenericEvent,
serializeEventWithTarget,
serializeTransitionEvent
} from './event_serializer';
import {BaseException} from '../../facade/exceptions';
import {EventEmitter, ObservableWrapper} from '../../facade/async';
import {BaseException} from '../../facade/exceptions';
import {RenderStoreObject, Serializer} from '../shared/serializer';
import {serializeEventWithTarget, serializeGenericEvent, serializeKeyboardEvent, serializeMouseEvent, serializeTransitionEvent} from './event_serializer';
export class EventDispatcher {
constructor(private _sink: EventEmitter<any>, private _serializer: Serializer) {}
@ -16,90 +11,90 @@ export class EventDispatcher {
var serializedEvent: any /** TODO #9100 */;
// TODO (jteplitz602): support custom events #3350
switch (event.type) {
case "click":
case "mouseup":
case "mousedown":
case "dblclick":
case "contextmenu":
case "mouseenter":
case "mouseleave":
case "mousemove":
case "mouseout":
case "mouseover":
case "show":
case 'click':
case 'mouseup':
case 'mousedown':
case 'dblclick':
case 'contextmenu':
case 'mouseenter':
case 'mouseleave':
case 'mousemove':
case 'mouseout':
case 'mouseover':
case 'show':
serializedEvent = serializeMouseEvent(event);
break;
case "keydown":
case "keypress":
case "keyup":
case 'keydown':
case 'keypress':
case 'keyup':
serializedEvent = serializeKeyboardEvent(event);
break;
case "input":
case "change":
case "blur":
case 'input':
case 'change':
case 'blur':
serializedEvent = serializeEventWithTarget(event);
break;
case "abort":
case "afterprint":
case "beforeprint":
case "cached":
case "canplay":
case "canplaythrough":
case "chargingchange":
case "chargingtimechange":
case "close":
case "dischargingtimechange":
case "DOMContentLoaded":
case "downloading":
case "durationchange":
case "emptied":
case "ended":
case "error":
case "fullscreenchange":
case "fullscreenerror":
case "invalid":
case "languagechange":
case "levelfchange":
case "loadeddata":
case "loadedmetadata":
case "obsolete":
case "offline":
case "online":
case "open":
case "orientatoinchange":
case "pause":
case "pointerlockchange":
case "pointerlockerror":
case "play":
case "playing":
case "ratechange":
case "readystatechange":
case "reset":
case "scroll":
case "seeked":
case "seeking":
case "stalled":
case "submit":
case "success":
case "suspend":
case "timeupdate":
case "updateready":
case "visibilitychange":
case "volumechange":
case "waiting":
case 'abort':
case 'afterprint':
case 'beforeprint':
case 'cached':
case 'canplay':
case 'canplaythrough':
case 'chargingchange':
case 'chargingtimechange':
case 'close':
case 'dischargingtimechange':
case 'DOMContentLoaded':
case 'downloading':
case 'durationchange':
case 'emptied':
case 'ended':
case 'error':
case 'fullscreenchange':
case 'fullscreenerror':
case 'invalid':
case 'languagechange':
case 'levelfchange':
case 'loadeddata':
case 'loadedmetadata':
case 'obsolete':
case 'offline':
case 'online':
case 'open':
case 'orientatoinchange':
case 'pause':
case 'pointerlockchange':
case 'pointerlockerror':
case 'play':
case 'playing':
case 'ratechange':
case 'readystatechange':
case 'reset':
case 'scroll':
case 'seeked':
case 'seeking':
case 'stalled':
case 'submit':
case 'success':
case 'suspend':
case 'timeupdate':
case 'updateready':
case 'visibilitychange':
case 'volumechange':
case 'waiting':
serializedEvent = serializeGenericEvent(event);
break;
case "transitionend":
case 'transitionend':
serializedEvent = serializeTransitionEvent(event);
break;
default:
throw new BaseException(eventName + " not supported on WebWorkers");
throw new BaseException(eventName + ' not supported on WebWorkers');
}
ObservableWrapper.callEmit(this._sink, {
"element": this._serializer.serialize(element, RenderStoreObject),
"eventName": eventName,
"eventTarget": eventTarget,
"event": serializedEvent
'element': this._serializer.serialize(element, RenderStoreObject),
'eventName': eventName,
'eventTarget': eventTarget,
'event': serializedEvent
});
// TODO(kegluneq): Eventually, we want the user to indicate from the UI side whether the event

View File

@ -2,34 +2,13 @@ import {Set} from '../../facade/collection';
import {isPresent} from '../../facade/lang';
const MOUSE_EVENT_PROPERTIES = [
"altKey",
"button",
"clientX",
"clientY",
"metaKey",
"movementX",
"movementY",
"offsetX",
"offsetY",
"region",
"screenX",
"screenY",
"shiftKey"
'altKey', 'button', 'clientX', 'clientY', 'metaKey', 'movementX', 'movementY', 'offsetX',
'offsetY', 'region', 'screenX', 'screenY', 'shiftKey'
];
const KEYBOARD_EVENT_PROPERTIES = [
'altkey',
'charCode',
'code',
'ctrlKey',
'isComposing',
'key',
'keyCode',
'location',
'metaKey',
'repeat',
'shiftKey',
'which'
'altkey', 'charCode', 'code', 'ctrlKey', 'isComposing', 'key', 'keyCode', 'location', 'metaKey',
'repeat', 'shiftKey', 'which'
];
const TRANSITION_EVENT_PROPERTIES = ['propertyName', 'elapsedTime', 'pseudoElement'];
@ -37,7 +16,7 @@ const TRANSITION_EVENT_PROPERTIES = ['propertyName', 'elapsedTime', 'pseudoEleme
const EVENT_PROPERTIES = ['type', 'bubbles', 'cancelable'];
const NODES_WITH_VALUE = new Set(
["input", "select", "option", "button", "li", "meter", "progress", "param", "textarea"]);
['input', 'select', 'option', 'button', 'li', 'meter', 'progress', 'param', 'textarea']);
export function serializeGenericEvent(e: Event): {[key: string]: any} {
return serializeEvent(e, EVENT_PROPERTIES);

View File

@ -1,14 +1,16 @@
import {MessageBasedPlatformLocation} from './platform_location';
import {BrowserPlatformLocation} from '../../browser/location/browser_platform_location';
import {APP_INITIALIZER, Injector, NgZone} from '@angular/core';
import {BrowserPlatformLocation} from '../../browser/location/browser_platform_location';
import {MessageBasedPlatformLocation} from './platform_location';
/**
* A list of {@link Provider}s. To use the router in a Worker enabled application you must
* include these providers when setting up the render thread.
*/
export const WORKER_RENDER_LOCATION_PROVIDERS = [
MessageBasedPlatformLocation,
BrowserPlatformLocation,
MessageBasedPlatformLocation, BrowserPlatformLocation,
{provide: APP_INITIALIZER, useFactory: initUiLocation, multi: true, deps: [Injector]}
];

View File

@ -1,22 +1,24 @@
import {BrowserPlatformLocation} from '../../browser/location/browser_platform_location';
import {UrlChangeListener} from '@angular/common';
import {Injectable} from '@angular/core';
import {ROUTER_CHANNEL} from '../shared/messaging_api';
import {ServiceMessageBrokerFactory, ServiceMessageBroker} from '../shared/service_message_broker';
import {PRIMITIVE, Serializer} from '../shared/serializer';
import {LocationType} from '../shared/serialized_types';
import {MessageBus} from '../shared/message_bus';
import {BrowserPlatformLocation} from '../../browser/location/browser_platform_location';
import {EventEmitter, ObservableWrapper, PromiseWrapper} from '../../facade/async';
import {FunctionWrapper} from '../../facade/lang';
import {MessageBus} from '../shared/message_bus';
import {ROUTER_CHANNEL} from '../shared/messaging_api';
import {LocationType} from '../shared/serialized_types';
import {PRIMITIVE, Serializer} from '../shared/serializer';
import {ServiceMessageBroker, ServiceMessageBrokerFactory} from '../shared/service_message_broker';
@Injectable()
export class MessageBasedPlatformLocation {
private _channelSink: EventEmitter<Object>;
private _broker: ServiceMessageBroker;
constructor(private _brokerFactory: ServiceMessageBrokerFactory,
private _platformLocation: BrowserPlatformLocation, bus: MessageBus,
private _serializer: Serializer) {
constructor(
private _brokerFactory: ServiceMessageBrokerFactory,
private _platformLocation: BrowserPlatformLocation, bus: MessageBus,
private _serializer: Serializer) {
this._platformLocation.onPopState(
<UrlChangeListener>FunctionWrapper.bind(this._sendUrlChangeEvent, this));
this._platformLocation.onHashChange(
@ -26,21 +28,21 @@ export class MessageBasedPlatformLocation {
}
start(): void {
this._broker.registerMethod("getLocation", null, FunctionWrapper.bind(this._getLocation, this),
LocationType);
this._broker.registerMethod("setPathname", [PRIMITIVE],
FunctionWrapper.bind(this._setPathname, this));
this._broker.registerMethod(
"pushState", [PRIMITIVE, PRIMITIVE, PRIMITIVE],
'getLocation', null, FunctionWrapper.bind(this._getLocation, this), LocationType);
this._broker.registerMethod(
'setPathname', [PRIMITIVE], FunctionWrapper.bind(this._setPathname, this));
this._broker.registerMethod(
'pushState', [PRIMITIVE, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._platformLocation.pushState, this._platformLocation));
this._broker.registerMethod(
"replaceState", [PRIMITIVE, PRIMITIVE, PRIMITIVE],
'replaceState', [PRIMITIVE, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._platformLocation.replaceState, this._platformLocation));
this._broker.registerMethod(
"forward", null,
'forward', null,
FunctionWrapper.bind(this._platformLocation.forward, this._platformLocation));
this._broker.registerMethod(
"back", null, FunctionWrapper.bind(this._platformLocation.back, this._platformLocation));
'back', null, FunctionWrapper.bind(this._platformLocation.back, this._platformLocation));
}
private _getLocation(): Promise<Location> {

View File

@ -1,75 +1,88 @@
import {Injectable, RootRenderer, Renderer, RenderComponentType} from '@angular/core';
import {MessageBus} from '../shared/message_bus';
import {Serializer, PRIMITIVE, RenderStoreObject} from '../shared/serializer';
import {EVENT_CHANNEL, RENDERER_CHANNEL} from '../shared/messaging_api';
import {EventDispatcher} from '../ui/event_dispatcher';
import {RenderStore} from '../shared/render_store';
import {ServiceMessageBrokerFactory} from '../shared/service_message_broker';
import {Injectable, RenderComponentType, Renderer, RootRenderer} from '@angular/core';
import {FunctionWrapper} from '../../facade/lang';
import {MessageBus} from '../shared/message_bus';
import {EVENT_CHANNEL, RENDERER_CHANNEL} from '../shared/messaging_api';
import {RenderStore} from '../shared/render_store';
import {PRIMITIVE, RenderStoreObject, Serializer} from '../shared/serializer';
import {ServiceMessageBrokerFactory} from '../shared/service_message_broker';
import {EventDispatcher} from '../ui/event_dispatcher';
@Injectable()
export class MessageBasedRenderer {
private _eventDispatcher: EventDispatcher;
constructor(private _brokerFactory: ServiceMessageBrokerFactory, private _bus: MessageBus,
private _serializer: Serializer, private _renderStore: RenderStore,
private _rootRenderer: RootRenderer) {}
constructor(
private _brokerFactory: ServiceMessageBrokerFactory, private _bus: MessageBus,
private _serializer: Serializer, private _renderStore: RenderStore,
private _rootRenderer: RootRenderer) {}
start(): void {
var broker = this._brokerFactory.createMessageBroker(RENDERER_CHANNEL);
this._bus.initChannel(EVENT_CHANNEL);
this._eventDispatcher = new EventDispatcher(this._bus.to(EVENT_CHANNEL), this._serializer);
broker.registerMethod("renderComponent", [RenderComponentType, PRIMITIVE],
FunctionWrapper.bind(this._renderComponent, this));
broker.registerMethod(
'renderComponent', [RenderComponentType, PRIMITIVE],
FunctionWrapper.bind(this._renderComponent, this));
broker.registerMethod("selectRootElement", [RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._selectRootElement, this));
broker.registerMethod("createElement",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._createElement, this));
broker.registerMethod("createViewRoot", [RenderStoreObject, RenderStoreObject, PRIMITIVE],
FunctionWrapper.bind(this._createViewRoot, this));
broker.registerMethod("createTemplateAnchor", [RenderStoreObject, RenderStoreObject, PRIMITIVE],
FunctionWrapper.bind(this._createTemplateAnchor, this));
broker.registerMethod("createText",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._createText, this));
broker.registerMethod("projectNodes", [RenderStoreObject, RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._projectNodes, this));
broker.registerMethod("attachViewAfter",
[RenderStoreObject, RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._attachViewAfter, this));
broker.registerMethod("detachView", [RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._detachView, this));
broker.registerMethod("destroyView", [RenderStoreObject, RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._destroyView, this));
broker.registerMethod("setElementProperty",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementProperty, this));
broker.registerMethod("setElementAttribute",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementAttribute, this));
broker.registerMethod("setBindingDebugInfo",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setBindingDebugInfo, this));
broker.registerMethod("setElementClass",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementClass, this));
broker.registerMethod("setElementStyle",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementStyle, this));
broker.registerMethod("invokeElementMethod",
[RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._invokeElementMethod, this));
broker.registerMethod("setText", [RenderStoreObject, RenderStoreObject, PRIMITIVE],
FunctionWrapper.bind(this._setText, this));
broker.registerMethod("listen", [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._listen, this));
broker.registerMethod("listenGlobal", [RenderStoreObject, PRIMITIVE, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._listenGlobal, this));
broker.registerMethod("listenDone", [RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._listenDone, this));
broker.registerMethod(
'selectRootElement', [RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._selectRootElement, this));
broker.registerMethod(
'createElement', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._createElement, this));
broker.registerMethod(
'createViewRoot', [RenderStoreObject, RenderStoreObject, PRIMITIVE],
FunctionWrapper.bind(this._createViewRoot, this));
broker.registerMethod(
'createTemplateAnchor', [RenderStoreObject, RenderStoreObject, PRIMITIVE],
FunctionWrapper.bind(this._createTemplateAnchor, this));
broker.registerMethod(
'createText', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._createText, this));
broker.registerMethod(
'projectNodes', [RenderStoreObject, RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._projectNodes, this));
broker.registerMethod(
'attachViewAfter', [RenderStoreObject, RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._attachViewAfter, this));
broker.registerMethod(
'detachView', [RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._detachView, this));
broker.registerMethod(
'destroyView', [RenderStoreObject, RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._destroyView, this));
broker.registerMethod(
'setElementProperty', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementProperty, this));
broker.registerMethod(
'setElementAttribute', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementAttribute, this));
broker.registerMethod(
'setBindingDebugInfo', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setBindingDebugInfo, this));
broker.registerMethod(
'setElementClass', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementClass, this));
broker.registerMethod(
'setElementStyle', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._setElementStyle, this));
broker.registerMethod(
'invokeElementMethod', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._invokeElementMethod, this));
broker.registerMethod(
'setText', [RenderStoreObject, RenderStoreObject, PRIMITIVE],
FunctionWrapper.bind(this._setText, this));
broker.registerMethod(
'listen', [RenderStoreObject, RenderStoreObject, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._listen, this));
broker.registerMethod(
'listenGlobal', [RenderStoreObject, PRIMITIVE, PRIMITIVE, PRIMITIVE],
FunctionWrapper.bind(this._listenGlobal, this));
broker.registerMethod(
'listenDone', [RenderStoreObject, RenderStoreObject],
FunctionWrapper.bind(this._listenDone, this));
}
private _renderComponent(renderComponentType: RenderComponentType, rendererId: number) {
@ -119,33 +132,33 @@ export class MessageBasedRenderer {
}
}
private _setElementProperty(renderer: Renderer, renderElement: any, propertyName: string,
propertyValue: any) {
private _setElementProperty(
renderer: Renderer, renderElement: any, propertyName: string, propertyValue: any) {
renderer.setElementProperty(renderElement, propertyName, propertyValue);
}
private _setElementAttribute(renderer: Renderer, renderElement: any, attributeName: string,
attributeValue: string) {
private _setElementAttribute(
renderer: Renderer, renderElement: any, attributeName: string, attributeValue: string) {
renderer.setElementAttribute(renderElement, attributeName, attributeValue);
}
private _setBindingDebugInfo(renderer: Renderer, renderElement: any, propertyName: string,
propertyValue: string) {
private _setBindingDebugInfo(
renderer: Renderer, renderElement: any, propertyName: string, propertyValue: string) {
renderer.setBindingDebugInfo(renderElement, propertyName, propertyValue);
}
private _setElementClass(renderer: Renderer, renderElement: any, className: string,
isAdd: boolean) {
private _setElementClass(
renderer: Renderer, renderElement: any, className: string, isAdd: boolean) {
renderer.setElementClass(renderElement, className, isAdd);
}
private _setElementStyle(renderer: Renderer, renderElement: any, styleName: string,
styleValue: string) {
private _setElementStyle(
renderer: Renderer, renderElement: any, styleName: string, styleValue: string) {
renderer.setElementStyle(renderElement, styleName, styleValue);
}
private _invokeElementMethod(renderer: Renderer, renderElement: any, methodName: string,
args: any[]) {
private _invokeElementMethod(
renderer: Renderer, renderElement: any, methodName: string, args: any[]) {
renderer.invokeElementMethod(renderElement, methodName, args);
}
@ -154,17 +167,19 @@ export class MessageBasedRenderer {
}
private _listen(renderer: Renderer, renderElement: any, eventName: string, unlistenId: number) {
var unregisterCallback = renderer.listen(renderElement, eventName,
(event: any /** TODO #9100 */) => this._eventDispatcher.dispatchRenderEvent(
renderElement, null, eventName, event));
var unregisterCallback = renderer.listen(
renderElement, eventName,
(event: any /** TODO #9100 */) =>
this._eventDispatcher.dispatchRenderEvent(renderElement, null, eventName, event));
this._renderStore.store(unregisterCallback, unlistenId);
}
private _listenGlobal(renderer: Renderer, eventTarget: string, eventName: string,
unlistenId: number) {
private _listenGlobal(
renderer: Renderer, eventTarget: string, eventName: string, unlistenId: number) {
var unregisterCallback = renderer.listenGlobal(
eventTarget, eventName,
(event: any /** TODO #9100 */) => this._eventDispatcher.dispatchRenderEvent(null, eventTarget, eventName, event));
(event: any /** TODO #9100 */) =>
this._eventDispatcher.dispatchRenderEvent(null, eventTarget, eventName, event));
this._renderStore.store(unregisterCallback, unlistenId);
}

View File

@ -1,6 +1,6 @@
// no deserialization is necessary in TS.
// This is only here to match dart interface
export function deserializeGenericEvent(
serializedEvent: {[key: string]: any}): {[key: string]: any} {
export function deserializeGenericEvent(serializedEvent: {[key: string]: any}):
{[key: string]: any} {
return serializedEvent;
}

View File

@ -1,18 +1,23 @@
import {NgZone, APP_INITIALIZER} from '@angular/core';
import {PlatformLocation} from '@angular/common';
import {APP_INITIALIZER, NgZone} from '@angular/core';
import {WebWorkerPlatformLocation} from './platform_location';
/**
* Those providers should be added when the router is used in a worker context in addition to the
* {@link ROUTER_PROVIDERS} and after them.
*/
export const WORKER_APP_LOCATION_PROVIDERS = [
{provide: PlatformLocation, useClass: WebWorkerPlatformLocation},
{provide: APP_INITIALIZER, useFactory: appInitFnFactory, multi: true, deps: [PlatformLocation, NgZone]}
{provide: PlatformLocation, useClass: WebWorkerPlatformLocation}, {
provide: APP_INITIALIZER,
useFactory: appInitFnFactory,
multi: true,
deps: [PlatformLocation, NgZone]
}
];
function appInitFnFactory(platformLocation: WebWorkerPlatformLocation, zone: NgZone): () => Promise<boolean> {
return () => {
return zone.runGuarded(() => platformLocation.init());
};
function appInitFnFactory(platformLocation: WebWorkerPlatformLocation, zone: NgZone): () =>
Promise<boolean> {
return () => { return zone.runGuarded(() => platformLocation.init()); };
}

View File

@ -1,19 +1,16 @@
import {Injectable} from '@angular/core';
import {
FnArg,
UiArguments,
ClientMessageBroker,
ClientMessageBrokerFactory
} from '../shared/client_message_broker';
import {PlatformLocation, UrlChangeListener} from '@angular/common';
import {Injectable} from '@angular/core';
import {EventEmitter, ObservableWrapper, PromiseWrapper} from '../../facade/async';
import {StringMapWrapper} from '../../facade/collection';
import {BaseException} from '../../facade/exceptions';
import {StringWrapper} from '../../facade/lang';
import {ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments} from '../shared/client_message_broker';
import {MessageBus} from '../shared/message_bus';
import {ROUTER_CHANNEL} from '../shared/messaging_api';
import {LocationType} from '../shared/serialized_types';
import {PromiseWrapper, EventEmitter, ObservableWrapper} from '../../facade/async';
import {BaseException} from '../../facade/exceptions';
import {PRIMITIVE, Serializer} from '../shared/serializer';
import {MessageBus} from '../shared/message_bus';
import {StringMapWrapper} from '../../facade/collection';
import {StringWrapper} from '../../facade/lang';
import {deserializeGenericEvent} from './event_deserializer';
@Injectable()
@ -24,8 +21,8 @@ export class WebWorkerPlatformLocation extends PlatformLocation {
private _location: LocationType = null;
private _channelSource: EventEmitter<Object>;
constructor(brokerFactory: ClientMessageBrokerFactory, bus: MessageBus,
private _serializer: Serializer) {
constructor(
brokerFactory: ClientMessageBrokerFactory, bus: MessageBus, private _serializer: Serializer) {
super();
this._broker = brokerFactory.createMessageBroker(ROUTER_CHANNEL);
@ -34,9 +31,9 @@ export class WebWorkerPlatformLocation extends PlatformLocation {
var listeners: Array<Function> = null;
if (StringMapWrapper.contains(msg, 'event')) {
let type: string = msg['event']['type'];
if (StringWrapper.equals(type, "popstate")) {
if (StringWrapper.equals(type, 'popstate')) {
listeners = this._popStateListeners;
} else if (StringWrapper.equals(type, "hashchange")) {
} else if (StringWrapper.equals(type, 'hashchange')) {
listeners = this._hashChangeListeners;
}
@ -52,18 +49,21 @@ export class WebWorkerPlatformLocation extends PlatformLocation {
/** @internal **/
init(): Promise<boolean> {
var args: UiArguments = new UiArguments("getLocation");
var args: UiArguments = new UiArguments('getLocation');
var locationPromise: Promise<LocationType> = this._broker.runOnService(args, LocationType);
return PromiseWrapper.then(locationPromise, (val: LocationType): boolean => {
this._location = val;
return true;
}, (err): boolean => { throw new BaseException(err); });
return PromiseWrapper.then(
locationPromise, (val: LocationType):
boolean => {
this._location = val;
return true;
},
(err): boolean => { throw new BaseException(err); });
}
getBaseHrefFromDOM(): string {
throw new BaseException(
"Attempt to get base href from DOM from WebWorker. You must either provide a value for the APP_BASE_HREF token through DI or use the hash location strategy.");
'Attempt to get base href from DOM from WebWorker. You must either provide a value for the APP_BASE_HREF token through DI or use the hash location strategy.');
}
onPopState(fn: UrlChangeListener): void { this._popStateListeners.push(fn); }
@ -96,37 +96,37 @@ export class WebWorkerPlatformLocation extends PlatformLocation {
set pathname(newPath: string) {
if (this._location === null) {
throw new BaseException("Attempt to set pathname before value is obtained from UI");
throw new BaseException('Attempt to set pathname before value is obtained from UI');
}
this._location.pathname = newPath;
var fnArgs = [new FnArg(newPath, PRIMITIVE)];
var args = new UiArguments("setPathname", fnArgs);
var args = new UiArguments('setPathname', fnArgs);
this._broker.runOnService(args, null);
}
pushState(state: any, title: string, url: string): void {
var fnArgs =
[new FnArg(state, PRIMITIVE), new FnArg(title, PRIMITIVE), new FnArg(url, PRIMITIVE)];
var args = new UiArguments("pushState", fnArgs);
var args = new UiArguments('pushState', fnArgs);
this._broker.runOnService(args, null);
}
replaceState(state: any, title: string, url: string): void {
var fnArgs =
[new FnArg(state, PRIMITIVE), new FnArg(title, PRIMITIVE), new FnArg(url, PRIMITIVE)];
var args = new UiArguments("replaceState", fnArgs);
var args = new UiArguments('replaceState', fnArgs);
this._broker.runOnService(args, null);
}
forward(): void {
var args = new UiArguments("forward");
var args = new UiArguments('forward');
this._broker.runOnService(args, null);
}
back(): void {
var args = new UiArguments("back");
var args = new UiArguments('back');
this._broker.runOnService(args, null);
}
}

View File

@ -1,22 +1,16 @@
import {
Renderer,
RootRenderer,
RenderComponentType,
Injectable,
ViewEncapsulation
} from '@angular/core';
import {ClientMessageBrokerFactory, FnArg, UiArguments} from '../shared/client_message_broker';
import {isPresent, isBlank} from '../../facade/lang';
import {ListWrapper} from '../../facade/collection';
import {RenderStore} from '../shared/render_store';
import {RENDERER_CHANNEL, EVENT_CHANNEL} from '../shared/messaging_api';
import {Serializer, RenderStoreObject} from '../shared/serializer';
import {MessageBus} from '../shared/message_bus';
import {ObservableWrapper} from '../../facade/async';
import {deserializeGenericEvent} from './event_deserializer';
import {Injectable, RenderComponentType, Renderer, RootRenderer, ViewEncapsulation} from '@angular/core';
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} from '../../../core_private';
import {ObservableWrapper} from '../../facade/async';
import {ListWrapper} from '../../facade/collection';
import {isBlank, isPresent} from '../../facade/lang';
import {ClientMessageBrokerFactory, FnArg, UiArguments} from '../shared/client_message_broker';
import {MessageBus} from '../shared/message_bus';
import {EVENT_CHANNEL, RENDERER_CHANNEL} from '../shared/messaging_api';
import {RenderStore} from '../shared/render_store';
import {RenderStoreObject, Serializer} from '../shared/serializer';
import {deserializeGenericEvent} from './event_deserializer';
@Injectable()
export class WebWorkerRootRenderer implements RootRenderer {
@ -25,8 +19,9 @@ export class WebWorkerRootRenderer implements RootRenderer {
private _componentRenderers: Map<string, WebWorkerRenderer> =
new Map<string, WebWorkerRenderer>();
constructor(messageBrokerFactory: ClientMessageBrokerFactory, bus: MessageBus,
private _serializer: Serializer, private _renderStore: RenderStore) {
constructor(
messageBrokerFactory: ClientMessageBrokerFactory, bus: MessageBus,
private _serializer: Serializer, private _renderStore: RenderStore) {
this._messageBroker = messageBrokerFactory.createMessageBroker(RENDERER_CHANNEL);
bus.initChannel(EVENT_CHANNEL);
var source = bus.from(EVENT_CHANNEL);
@ -83,8 +78,8 @@ export class WebWorkerRootRenderer implements RootRenderer {
}
export class WebWorkerRenderer implements Renderer, RenderStoreObject {
constructor(private _rootRenderer: WebWorkerRootRenderer,
private _componentType: RenderComponentType) {}
constructor(
private _rootRenderer: WebWorkerRootRenderer, private _componentType: RenderComponentType) {}
private _runOnService(fnName: string, fnArgs: FnArg[]) {
var fnArgsWithRenderer = [new FnArg(this, RenderStoreObject)].concat(fnArgs);
@ -93,16 +88,15 @@ export class WebWorkerRenderer implements Renderer, RenderStoreObject {
selectRootElement(selectorOrNode: string, debugInfo?: RenderDebugInfo): any {
var node = this._rootRenderer.allocateNode();
this._runOnService('selectRootElement',
[new FnArg(selectorOrNode, null), new FnArg(node, RenderStoreObject)]);
this._runOnService(
'selectRootElement', [new FnArg(selectorOrNode, null), new FnArg(node, RenderStoreObject)]);
return node;
}
createElement(parentElement: any, name: string, debugInfo?: RenderDebugInfo): any {
var node = this._rootRenderer.allocateNode();
this._runOnService('createElement', [
new FnArg(parentElement, RenderStoreObject),
new FnArg(name, null),
new FnArg(parentElement, RenderStoreObject), new FnArg(name, null),
new FnArg(node, RenderStoreObject)
]);
return node;
@ -110,8 +104,8 @@ export class WebWorkerRenderer implements Renderer, RenderStoreObject {
createViewRoot(hostElement: any): any {
var viewRoot = this._componentType.encapsulation === ViewEncapsulation.Native ?
this._rootRenderer.allocateNode() :
hostElement;
this._rootRenderer.allocateNode() :
hostElement;
this._runOnService(
'createViewRoot',
[new FnArg(hostElement, RenderStoreObject), new FnArg(viewRoot, RenderStoreObject)]);
@ -129,8 +123,7 @@ export class WebWorkerRenderer implements Renderer, RenderStoreObject {
createText(parentElement: any, value: string, debugInfo?: RenderDebugInfo): any {
var node = this._rootRenderer.allocateNode();
this._runOnService('createText', [
new FnArg(parentElement, RenderStoreObject),
new FnArg(value, null),
new FnArg(parentElement, RenderStoreObject), new FnArg(value, null),
new FnArg(node, RenderStoreObject)
]);
return node;
@ -161,63 +154,56 @@ export class WebWorkerRenderer implements Renderer, RenderStoreObject {
setElementProperty(renderElement: any, propertyName: string, propertyValue: any) {
this._runOnService('setElementProperty', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(propertyName, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(propertyName, null),
new FnArg(propertyValue, null)
]);
}
setElementAttribute(renderElement: any, attributeName: string, attributeValue: string) {
this._runOnService('setElementAttribute', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(attributeName, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(attributeName, null),
new FnArg(attributeValue, null)
]);
}
setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string) {
this._runOnService('setBindingDebugInfo', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(propertyName, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(propertyName, null),
new FnArg(propertyValue, null)
]);
}
setElementClass(renderElement: any, className: string, isAdd: boolean) {
this._runOnService('setElementClass', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(className, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(className, null),
new FnArg(isAdd, null)
]);
}
setElementStyle(renderElement: any, styleName: string, styleValue: string) {
this._runOnService('setElementStyle', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(styleName, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(styleName, null),
new FnArg(styleValue, null)
]);
}
invokeElementMethod(renderElement: any, methodName: string, args?: any[]) {
this._runOnService('invokeElementMethod', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(methodName, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(methodName, null),
new FnArg(args, null)
]);
}
setText(renderNode: any, text: string) {
this._runOnService('setText',
[new FnArg(renderNode, RenderStoreObject), new FnArg(text, null)]);
this._runOnService(
'setText', [new FnArg(renderNode, RenderStoreObject), new FnArg(text, null)]);
}
listen(renderElement: WebWorkerRenderNode, name: string, callback: Function): Function {
renderElement.events.listen(name, callback);
var unlistenCallbackId = this._rootRenderer.allocateId();
this._runOnService('listen', [
new FnArg(renderElement, RenderStoreObject),
new FnArg(name, null),
new FnArg(renderElement, RenderStoreObject), new FnArg(name, null),
new FnArg(unlistenCallbackId, null)
]);
return () => {
@ -238,10 +224,11 @@ export class WebWorkerRenderer implements Renderer, RenderStoreObject {
};
}
animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number,
easing: string): AnimationPlayer {
// TODO
return null;
animate(
element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[],
duration: number, delay: number, easing: string): AnimationPlayer {
// TODO
return null;
}
}

View File

@ -1,5 +1,6 @@
import {Type} from '../../facade/lang';
import {DomAdapter, setRootDomAdapter} from '../../dom/dom_adapter';
import {Type} from '../../facade/lang';
/**
* This adapter is required to log error messages.
@ -34,127 +35,170 @@ export class WorkerDomAdapter extends DomAdapter {
}
}
hasProperty(element: any /** TODO #9100 */, name: string): boolean { throw "not implemented"; }
setProperty(el: Element, name: string, value: any) { throw "not implemented"; }
getProperty(el: Element, name: string): any { throw "not implemented"; }
invoke(el: Element, methodName: string, args: any[]): any { throw "not implemented"; }
hasProperty(element: any /** TODO #9100 */, name: string): boolean { throw 'not implemented'; }
setProperty(el: Element, name: string, value: any) { throw 'not implemented'; }
getProperty(el: Element, name: string): any { throw 'not implemented'; }
invoke(el: Element, methodName: string, args: any[]): any { throw 'not implemented'; }
getXHR(): Type { throw "not implemented"; }
getXHR(): Type { throw 'not implemented'; }
get attrToPropMap(): {[key: string]: string} { throw "not implemented"; }
set attrToPropMap(value: {[key: string]: string}) { throw "not implemented"; }
get attrToPropMap(): {[key: string]: string} { throw 'not implemented'; }
set attrToPropMap(value: {[key: string]: string}) { throw 'not implemented'; }
parse(templateHtml: string) { throw "not implemented"; }
query(selector: string): any { throw "not implemented"; }
querySelector(el: any /** TODO #9100 */, selector: string): HTMLElement { throw "not implemented"; }
querySelectorAll(el: any /** TODO #9100 */, selector: string): any[] { throw "not implemented"; }
on(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */) { throw "not implemented"; }
onAndCancel(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */): Function { throw "not implemented"; }
dispatchEvent(el: any /** TODO #9100 */, evt: any /** TODO #9100 */) { throw "not implemented"; }
createMouseEvent(eventType: any /** TODO #9100 */): any { throw "not implemented"; }
createEvent(eventType: string): any { throw "not implemented"; }
preventDefault(evt: any /** TODO #9100 */) { throw "not implemented"; }
isPrevented(evt: any /** TODO #9100 */): boolean { throw "not implemented"; }
getInnerHTML(el: any /** TODO #9100 */): string { throw "not implemented"; }
getTemplateContent(el: any /** TODO #9100 */): any { throw "not implemented"; }
getOuterHTML(el: any /** TODO #9100 */): string { throw "not implemented"; }
nodeName(node: any /** TODO #9100 */): string { throw "not implemented"; }
nodeValue(node: any /** TODO #9100 */): string { throw "not implemented"; }
type(node: any /** TODO #9100 */): string { throw "not implemented"; }
content(node: any /** TODO #9100 */): any { throw "not implemented"; }
firstChild(el: any /** TODO #9100 */): Node { throw "not implemented"; }
nextSibling(el: any /** TODO #9100 */): Node { throw "not implemented"; }
parentElement(el: any /** TODO #9100 */): Node { throw "not implemented"; }
childNodes(el: any /** TODO #9100 */): Node[] { throw "not implemented"; }
childNodesAsList(el: any /** TODO #9100 */): Node[] { throw "not implemented"; }
clearNodes(el: any /** TODO #9100 */) { throw "not implemented"; }
appendChild(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
removeChild(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
replaceChild(el: any /** TODO #9100 */, newNode: any /** TODO #9100 */, oldNode: any /** TODO #9100 */) { throw "not implemented"; }
remove(el: any /** TODO #9100 */): Node { throw "not implemented"; }
insertBefore(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
insertAllBefore(el: any /** TODO #9100 */, nodes: any /** TODO #9100 */) { throw "not implemented"; }
insertAfter(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw "not implemented"; }
setInnerHTML(el: any /** TODO #9100 */, value: any /** TODO #9100 */) { throw "not implemented"; }
getText(el: any /** TODO #9100 */): string { throw "not implemented"; }
setText(el: any /** TODO #9100 */, value: string) { throw "not implemented"; }
getValue(el: any /** TODO #9100 */): string { throw "not implemented"; }
setValue(el: any /** TODO #9100 */, value: string) { throw "not implemented"; }
getChecked(el: any /** TODO #9100 */): boolean { throw "not implemented"; }
setChecked(el: any /** TODO #9100 */, value: boolean) { throw "not implemented"; }
createComment(text: string): any { throw "not implemented"; }
createTemplate(html: any /** TODO #9100 */): HTMLElement { throw "not implemented"; }
createElement(tagName: any /** TODO #9100 */, doc?: any /** TODO #9100 */): HTMLElement { throw "not implemented"; }
createElementNS(ns: string, tagName: string, doc?: any /** TODO #9100 */): Element { throw "not implemented"; }
createTextNode(text: string, doc?: any /** TODO #9100 */): Text { throw "not implemented"; }
createScriptTag(attrName: string, attrValue: string, doc?: any /** TODO #9100 */): HTMLElement {
throw "not implemented";
parse(templateHtml: string) { throw 'not implemented'; }
query(selector: string): any { throw 'not implemented'; }
querySelector(el: any /** TODO #9100 */, selector: string): HTMLElement {
throw 'not implemented';
}
createStyleElement(css: string, doc?: any /** TODO #9100 */): HTMLStyleElement { throw "not implemented"; }
createShadowRoot(el: any /** TODO #9100 */): any { throw "not implemented"; }
getShadowRoot(el: any /** TODO #9100 */): any { throw "not implemented"; }
getHost(el: any /** TODO #9100 */): any { throw "not implemented"; }
getDistributedNodes(el: any /** TODO #9100 */): Node[] { throw "not implemented"; }
clone(node: Node): Node { throw "not implemented"; }
getElementsByClassName(element: any /** TODO #9100 */, name: string): HTMLElement[] { throw "not implemented"; }
getElementsByTagName(element: any /** TODO #9100 */, name: string): HTMLElement[] { throw "not implemented"; }
classList(element: any /** TODO #9100 */): any[] { throw "not implemented"; }
addClass(element: any /** TODO #9100 */, className: string) { throw "not implemented"; }
removeClass(element: any /** TODO #9100 */, className: string) { throw "not implemented"; }
hasClass(element: any /** TODO #9100 */, className: string): boolean { throw "not implemented"; }
setStyle(element: any /** TODO #9100 */, styleName: string, styleValue: string) { throw "not implemented"; }
removeStyle(element: any /** TODO #9100 */, styleName: string) { throw "not implemented"; }
getStyle(element: any /** TODO #9100 */, styleName: string): string { throw "not implemented"; }
hasStyle(element: any /** TODO #9100 */, styleName: string, styleValue?: string): boolean { throw "not implemented"; }
tagName(element: any /** TODO #9100 */): string { throw "not implemented"; }
attributeMap(element: any /** TODO #9100 */): Map<string, string> { throw "not implemented"; }
hasAttribute(element: any /** TODO #9100 */, attribute: string): boolean { throw "not implemented"; }
hasAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string): boolean { throw "not implemented"; }
getAttribute(element: any /** TODO #9100 */, attribute: string): string { throw "not implemented"; }
getAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string): string { throw "not implemented"; }
setAttribute(element: any /** TODO #9100 */, name: string, value: string) { throw "not implemented"; }
setAttributeNS(element: any /** TODO #9100 */, ns: string, name: string, value: string) { throw "not implemented"; }
removeAttribute(element: any /** TODO #9100 */, attribute: string) { throw "not implemented"; }
removeAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string) { throw "not implemented"; }
templateAwareRoot(el: any /** TODO #9100 */) { throw "not implemented"; }
createHtmlDocument(): HTMLDocument { throw "not implemented"; }
defaultDoc(): HTMLDocument { throw "not implemented"; }
getBoundingClientRect(el: any /** TODO #9100 */) { throw "not implemented"; }
getTitle(): string { throw "not implemented"; }
setTitle(newTitle: string) { throw "not implemented"; }
elementMatches(n: any /** TODO #9100 */, selector: string): boolean { throw "not implemented"; }
isTemplateElement(el: any): boolean { throw "not implemented"; }
isTextNode(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
isCommentNode(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
isElementNode(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
hasShadowRoot(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
isShadowRoot(node: any /** TODO #9100 */): boolean { throw "not implemented"; }
importIntoDoc(node: Node): Node { throw "not implemented"; }
adoptNode(node: Node): Node { throw "not implemented"; }
getHref(element: any /** TODO #9100 */): string { throw "not implemented"; }
getEventKey(event: any /** TODO #9100 */): string { throw "not implemented"; }
resolveAndSetHref(element: any /** TODO #9100 */, baseUrl: string, href: string) { throw "not implemented"; }
supportsDOMEvents(): boolean { throw "not implemented"; }
supportsNativeShadowDOM(): boolean { throw "not implemented"; }
getGlobalEventTarget(target: string): any { throw "not implemented"; }
getHistory(): History { throw "not implemented"; }
getLocation(): Location { throw "not implemented"; }
getBaseHref(): string { throw "not implemented"; }
resetBaseElement(): void { throw "not implemented"; }
getUserAgent(): string { throw "not implemented"; }
setData(element: any /** TODO #9100 */, name: string, value: string) { throw "not implemented"; }
getComputedStyle(element: any /** TODO #9100 */): any { throw "not implemented"; }
getData(element: any /** TODO #9100 */, name: string): string { throw "not implemented"; }
setGlobalVar(name: string, value: any) { throw "not implemented"; }
requestAnimationFrame(callback: any /** TODO #9100 */): number { throw "not implemented"; }
cancelAnimationFrame(id: any /** TODO #9100 */) { throw "not implemented"; }
performanceNow(): number { throw "not implemented"; }
getAnimationPrefix(): string { throw "not implemented"; }
getTransitionEnd(): string { throw "not implemented"; }
supportsAnimation(): boolean { throw "not implemented"; }
supportsWebAnimation(): boolean { throw "not implemented"; }
querySelectorAll(el: any /** TODO #9100 */, selector: string): any[] { throw 'not implemented'; }
on(el: any /** TODO #9100 */, evt: any /** TODO #9100 */, listener: any /** TODO #9100 */) {
throw 'not implemented';
}
onAndCancel(
el: any /** TODO #9100 */, evt: any /** TODO #9100 */,
listener: any /** TODO #9100 */): Function {
throw 'not implemented';
}
dispatchEvent(el: any /** TODO #9100 */, evt: any /** TODO #9100 */) { throw 'not implemented'; }
createMouseEvent(eventType: any /** TODO #9100 */): any { throw 'not implemented'; }
createEvent(eventType: string): any { throw 'not implemented'; }
preventDefault(evt: any /** TODO #9100 */) { throw 'not implemented'; }
isPrevented(evt: any /** TODO #9100 */): boolean { throw 'not implemented'; }
getInnerHTML(el: any /** TODO #9100 */): string { throw 'not implemented'; }
getTemplateContent(el: any /** TODO #9100 */): any { throw 'not implemented'; }
getOuterHTML(el: any /** TODO #9100 */): string { throw 'not implemented'; }
nodeName(node: any /** TODO #9100 */): string { throw 'not implemented'; }
nodeValue(node: any /** TODO #9100 */): string { throw 'not implemented'; }
type(node: any /** TODO #9100 */): string { throw 'not implemented'; }
content(node: any /** TODO #9100 */): any { throw 'not implemented'; }
firstChild(el: any /** TODO #9100 */): Node { throw 'not implemented'; }
nextSibling(el: any /** TODO #9100 */): Node { throw 'not implemented'; }
parentElement(el: any /** TODO #9100 */): Node { throw 'not implemented'; }
childNodes(el: any /** TODO #9100 */): Node[] { throw 'not implemented'; }
childNodesAsList(el: any /** TODO #9100 */): Node[] { throw 'not implemented'; }
clearNodes(el: any /** TODO #9100 */) { throw 'not implemented'; }
appendChild(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw 'not implemented'; }
removeChild(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw 'not implemented'; }
replaceChild(
el: any /** TODO #9100 */, newNode: any /** TODO #9100 */, oldNode: any /** TODO #9100 */) {
throw 'not implemented';
}
remove(el: any /** TODO #9100 */): Node { throw 'not implemented'; }
insertBefore(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw 'not implemented'; }
insertAllBefore(el: any /** TODO #9100 */, nodes: any /** TODO #9100 */) {
throw 'not implemented';
}
insertAfter(el: any /** TODO #9100 */, node: any /** TODO #9100 */) { throw 'not implemented'; }
setInnerHTML(el: any /** TODO #9100 */, value: any /** TODO #9100 */) { throw 'not implemented'; }
getText(el: any /** TODO #9100 */): string { throw 'not implemented'; }
setText(el: any /** TODO #9100 */, value: string) { throw 'not implemented'; }
getValue(el: any /** TODO #9100 */): string { throw 'not implemented'; }
setValue(el: any /** TODO #9100 */, value: string) { throw 'not implemented'; }
getChecked(el: any /** TODO #9100 */): boolean { throw 'not implemented'; }
setChecked(el: any /** TODO #9100 */, value: boolean) { throw 'not implemented'; }
createComment(text: string): any { throw 'not implemented'; }
createTemplate(html: any /** TODO #9100 */): HTMLElement { throw 'not implemented'; }
createElement(tagName: any /** TODO #9100 */, doc?: any /** TODO #9100 */): HTMLElement {
throw 'not implemented';
}
createElementNS(ns: string, tagName: string, doc?: any /** TODO #9100 */): Element {
throw 'not implemented';
}
createTextNode(text: string, doc?: any /** TODO #9100 */): Text { throw 'not implemented'; }
createScriptTag(attrName: string, attrValue: string, doc?: any /** TODO #9100 */): HTMLElement {
throw 'not implemented';
}
createStyleElement(css: string, doc?: any /** TODO #9100 */): HTMLStyleElement {
throw 'not implemented';
}
createShadowRoot(el: any /** TODO #9100 */): any { throw 'not implemented'; }
getShadowRoot(el: any /** TODO #9100 */): any { throw 'not implemented'; }
getHost(el: any /** TODO #9100 */): any { throw 'not implemented'; }
getDistributedNodes(el: any /** TODO #9100 */): Node[] { throw 'not implemented'; }
clone(node: Node): Node { throw 'not implemented'; }
getElementsByClassName(element: any /** TODO #9100 */, name: string): HTMLElement[] {
throw 'not implemented';
}
getElementsByTagName(element: any /** TODO #9100 */, name: string): HTMLElement[] {
throw 'not implemented';
}
classList(element: any /** TODO #9100 */): any[] { throw 'not implemented'; }
addClass(element: any /** TODO #9100 */, className: string) { throw 'not implemented'; }
removeClass(element: any /** TODO #9100 */, className: string) { throw 'not implemented'; }
hasClass(element: any /** TODO #9100 */, className: string): boolean { throw 'not implemented'; }
setStyle(element: any /** TODO #9100 */, styleName: string, styleValue: string) {
throw 'not implemented';
}
removeStyle(element: any /** TODO #9100 */, styleName: string) { throw 'not implemented'; }
getStyle(element: any /** TODO #9100 */, styleName: string): string { throw 'not implemented'; }
hasStyle(element: any /** TODO #9100 */, styleName: string, styleValue?: string): boolean {
throw 'not implemented';
}
tagName(element: any /** TODO #9100 */): string { throw 'not implemented'; }
attributeMap(element: any /** TODO #9100 */): Map<string, string> { throw 'not implemented'; }
hasAttribute(element: any /** TODO #9100 */, attribute: string): boolean {
throw 'not implemented';
}
hasAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string): boolean {
throw 'not implemented';
}
getAttribute(element: any /** TODO #9100 */, attribute: string): string {
throw 'not implemented';
}
getAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string): string {
throw 'not implemented';
}
setAttribute(element: any /** TODO #9100 */, name: string, value: string) {
throw 'not implemented';
}
setAttributeNS(element: any /** TODO #9100 */, ns: string, name: string, value: string) {
throw 'not implemented';
}
removeAttribute(element: any /** TODO #9100 */, attribute: string) { throw 'not implemented'; }
removeAttributeNS(element: any /** TODO #9100 */, ns: string, attribute: string) {
throw 'not implemented';
}
templateAwareRoot(el: any /** TODO #9100 */) { throw 'not implemented'; }
createHtmlDocument(): HTMLDocument { throw 'not implemented'; }
defaultDoc(): HTMLDocument { throw 'not implemented'; }
getBoundingClientRect(el: any /** TODO #9100 */) { throw 'not implemented'; }
getTitle(): string { throw 'not implemented'; }
setTitle(newTitle: string) { throw 'not implemented'; }
elementMatches(n: any /** TODO #9100 */, selector: string): boolean { throw 'not implemented'; }
isTemplateElement(el: any): boolean { throw 'not implemented'; }
isTextNode(node: any /** TODO #9100 */): boolean { throw 'not implemented'; }
isCommentNode(node: any /** TODO #9100 */): boolean { throw 'not implemented'; }
isElementNode(node: any /** TODO #9100 */): boolean { throw 'not implemented'; }
hasShadowRoot(node: any /** TODO #9100 */): boolean { throw 'not implemented'; }
isShadowRoot(node: any /** TODO #9100 */): boolean { throw 'not implemented'; }
importIntoDoc(node: Node): Node { throw 'not implemented'; }
adoptNode(node: Node): Node { throw 'not implemented'; }
getHref(element: any /** TODO #9100 */): string { throw 'not implemented'; }
getEventKey(event: any /** TODO #9100 */): string { throw 'not implemented'; }
resolveAndSetHref(element: any /** TODO #9100 */, baseUrl: string, href: string) {
throw 'not implemented';
}
supportsDOMEvents(): boolean { throw 'not implemented'; }
supportsNativeShadowDOM(): boolean { throw 'not implemented'; }
getGlobalEventTarget(target: string): any { throw 'not implemented'; }
getHistory(): History { throw 'not implemented'; }
getLocation(): Location { throw 'not implemented'; }
getBaseHref(): string { throw 'not implemented'; }
resetBaseElement(): void { throw 'not implemented'; }
getUserAgent(): string { throw 'not implemented'; }
setData(element: any /** TODO #9100 */, name: string, value: string) { throw 'not implemented'; }
getComputedStyle(element: any /** TODO #9100 */): any { throw 'not implemented'; }
getData(element: any /** TODO #9100 */, name: string): string { throw 'not implemented'; }
setGlobalVar(name: string, value: any) { throw 'not implemented'; }
requestAnimationFrame(callback: any /** TODO #9100 */): number { throw 'not implemented'; }
cancelAnimationFrame(id: any /** TODO #9100 */) { throw 'not implemented'; }
performanceNow(): number { throw 'not implemented'; }
getAnimationPrefix(): string { throw 'not implemented'; }
getTransitionEnd(): string { throw 'not implemented'; }
supportsAnimation(): boolean { throw 'not implemented'; }
supportsWebAnimation(): boolean { throw 'not implemented'; }
supportsCookies(): boolean { return false; }
getCookie(name: string): string { throw "not implemented"; }
setCookie(name: string, value: string) { throw "not implemented"; }
getCookie(name: string): string { throw 'not implemented'; }
setCookie(name: string, value: string) { throw 'not implemented'; }
}