2016-05-31 15:22:59 -07:00
|
|
|
import {unimplemented} from '../facade/exceptions';
|
2016-04-28 17:50:03 -07:00
|
|
|
import {ViewEncapsulation} from '../metadata/view';
|
|
|
|
import {Injector} from '../di/injector';
|
2016-05-25 12:46:22 -07:00
|
|
|
import {AnimationKeyframe} from '../../src/animation/animation_keyframe';
|
|
|
|
import {AnimationPlayer} from '../../src/animation/animation_player';
|
|
|
|
import {AnimationStyles} from '../../src/animation/animation_styles';
|
2015-03-23 14:10:55 -07:00
|
|
|
|
2016-05-25 15:00:05 -07:00
|
|
|
/**
|
|
|
|
* @experimental
|
|
|
|
*/
|
2015-12-02 10:35:51 -08:00
|
|
|
export class RenderComponentType {
|
2016-01-06 14:13:44 -08:00
|
|
|
constructor(public id: string, public templateUrl: string, public slotCount: number,
|
|
|
|
public encapsulation: ViewEncapsulation, public styles: Array<string | any[]>) {}
|
2015-12-02 10:35:51 -08:00
|
|
|
}
|
2015-09-28 19:58:38 -07:00
|
|
|
|
2016-01-06 14:13:44 -08:00
|
|
|
export abstract class RenderDebugInfo {
|
|
|
|
get injector(): Injector { return unimplemented(); }
|
|
|
|
get component(): any { return unimplemented(); }
|
|
|
|
get providerTokens(): any[] { return unimplemented(); }
|
2016-04-28 14:00:31 -07:00
|
|
|
get references(): {[key: string]: any} { return unimplemented(); }
|
|
|
|
get context(): any { return unimplemented(); }
|
2016-01-06 14:13:44 -08:00
|
|
|
get source(): string { return unimplemented(); }
|
2016-01-13 21:35:21 -08:00
|
|
|
}
|
|
|
|
|
2016-05-25 15:00:05 -07:00
|
|
|
/**
|
|
|
|
* @experimental
|
|
|
|
*/
|
2016-01-06 14:13:44 -08:00
|
|
|
export abstract class Renderer {
|
2016-05-26 14:41:33 +01:00
|
|
|
abstract selectRootElement(selectorOrNode: string | any, debugInfo?: RenderDebugInfo): any;
|
2015-09-28 19:58:38 -07:00
|
|
|
|
2016-05-26 14:41:33 +01:00
|
|
|
abstract createElement(parentElement: any, name: string, debugInfo?: RenderDebugInfo): any;
|
2015-09-28 19:58:38 -07:00
|
|
|
|
2015-12-02 10:35:51 -08:00
|
|
|
abstract createViewRoot(hostElement: any): any;
|
2015-09-28 19:58:38 -07:00
|
|
|
|
2016-05-26 14:41:33 +01:00
|
|
|
abstract createTemplateAnchor(parentElement: any, debugInfo?: RenderDebugInfo): any;
|
2015-06-24 13:46:39 -07:00
|
|
|
|
2016-05-26 14:41:33 +01:00
|
|
|
abstract createText(parentElement: any, value: string, debugInfo?: RenderDebugInfo): any;
|
2015-09-28 19:58:38 -07:00
|
|
|
|
2016-03-28 14:25:22 -07:00
|
|
|
abstract projectNodes(parentElement: any, nodes: any[]): void;
|
2015-03-23 14:10:55 -07:00
|
|
|
|
2016-03-28 14:25:22 -07:00
|
|
|
abstract attachViewAfter(node: any, viewRootNodes: any[]): void;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2016-03-28 14:25:22 -07:00
|
|
|
abstract detachView(viewRootNodes: any[]): void;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2016-03-28 14:25:22 -07:00
|
|
|
abstract destroyView(hostElement: any, viewAllNodes: any[]): void;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2016-01-25 14:47:25 -08:00
|
|
|
abstract listen(renderElement: any, name: string, callback: Function): Function;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2015-12-02 10:35:51 -08:00
|
|
|
abstract listenGlobal(target: string, name: string, callback: Function): Function;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2016-03-28 14:25:22 -07:00
|
|
|
abstract setElementProperty(renderElement: any, propertyName: string, propertyValue: any): void;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2016-04-12 09:40:37 -07:00
|
|
|
abstract setElementAttribute(renderElement: any, attributeName: string,
|
|
|
|
attributeValue: string): void;
|
2015-09-11 13:37:05 -07:00
|
|
|
|
2015-07-07 08:15:58 +02:00
|
|
|
/**
|
2016-01-06 14:13:44 -08:00
|
|
|
* Used only in debug mode to serialize property changes to dom nodes as attributes.
|
2015-07-07 08:15:58 +02:00
|
|
|
*/
|
2016-04-12 09:40:37 -07:00
|
|
|
abstract setBindingDebugInfo(renderElement: any, propertyName: string,
|
|
|
|
propertyValue: string): void;
|
2015-10-06 06:53:39 -07:00
|
|
|
|
2016-06-08 15:45:15 -07:00
|
|
|
abstract setElementClass(renderElement: any, className: string, isAdd: boolean): any /** TODO #9100 */;
|
2015-06-23 11:21:56 -07:00
|
|
|
|
2016-06-08 15:45:15 -07:00
|
|
|
abstract setElementStyle(renderElement: any, styleName: string, styleValue: string): any /** TODO #9100 */;
|
2015-12-02 10:35:51 -08:00
|
|
|
|
2016-06-08 15:45:15 -07:00
|
|
|
abstract invokeElementMethod(renderElement: any, methodName: string, args?: any[]): any /** TODO #9100 */;
|
2015-12-02 10:35:51 -08:00
|
|
|
|
2016-06-08 15:45:15 -07:00
|
|
|
abstract setText(renderNode: any, text: string): any /** TODO #9100 */;
|
2016-05-25 12:46:22 -07:00
|
|
|
|
|
|
|
abstract animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string): AnimationPlayer;
|
2015-11-02 08:39:14 -08:00
|
|
|
}
|
2015-09-28 19:58:38 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Injectable service that provides a low-level interface for modifying the UI.
|
|
|
|
*
|
|
|
|
* Use this service to bypass Angular's templating and make custom UI changes that can't be
|
|
|
|
* expressed declaratively. For example if you need to set a property or an attribute whose name is
|
|
|
|
* not statically known, use {@link #setElementProperty} or {@link #setElementAttribute}
|
|
|
|
* respectively.
|
|
|
|
*
|
|
|
|
* If you are implementing a custom renderer, you must implement this interface.
|
|
|
|
*
|
2015-12-03 15:49:09 -08:00
|
|
|
* The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.
|
2016-05-25 15:00:05 -07:00
|
|
|
* @experimental
|
2015-09-28 19:58:38 -07:00
|
|
|
*/
|
2016-01-06 14:13:44 -08:00
|
|
|
export abstract class RootRenderer {
|
2015-12-02 10:35:51 -08:00
|
|
|
abstract renderComponent(componentType: RenderComponentType): Renderer;
|
2015-03-23 14:10:55 -07:00
|
|
|
}
|