2017-12-01 14:23:03 -08:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-12 00:03:04 +01:00
|
|
|
import {SchemaMetadata, ViewEncapsulation} from '../../core';
|
2019-03-11 10:35:25 -07:00
|
|
|
import {ProcessProvidersFunction} from '../../di/interface/provider';
|
2019-01-09 13:49:16 -08:00
|
|
|
import {Type} from '../../interface/type';
|
2019-09-23 20:08:51 +02:00
|
|
|
|
|
|
|
|
import {TAttributes} from './node';
|
2018-03-29 16:41:45 -07:00
|
|
|
import {CssSelectorList} from './projection';
|
2019-05-17 16:25:09 -07:00
|
|
|
import {TView} from './view';
|
2018-03-04 20:21:23 -08:00
|
|
|
|
2018-07-18 01:59:49 +00:00
|
|
|
|
2017-12-01 14:23:03 -08:00
|
|
|
/**
|
2018-07-18 01:59:49 +00:00
|
|
|
* Definition of what a template rendering function should look like for a component.
|
2017-12-01 14:23:03 -08:00
|
|
|
*/
|
|
|
|
|
export type ComponentTemplate<T> = {
|
2019-02-09 22:51:29 +01:00
|
|
|
// Note: the ctx parameter is typed as T|U, as using only U would prevent a template with
|
|
|
|
|
// e.g. ctx: {} from being assigned to ComponentTemplate<any> as TypeScript won't infer U = any
|
|
|
|
|
// in that scenario. By including T this incompatibility is resolved.
|
2019-05-17 16:25:09 -07:00
|
|
|
<U extends T>(rf: RenderFlags, ctx: T | U): void;
|
2018-07-18 01:59:49 +00:00
|
|
|
};
|
|
|
|
|
|
2018-06-19 17:58:42 +02:00
|
|
|
/**
|
2019-02-02 11:20:33 -08:00
|
|
|
* Definition of what a view queries function should look like.
|
2018-06-19 17:58:42 +02:00
|
|
|
*/
|
2019-02-02 11:20:33 -08:00
|
|
|
export type ViewQueriesFunction<T> = <U extends T>(rf: RenderFlags, ctx: U) => void;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Definition of what a content queries function should look like.
|
|
|
|
|
*/
|
|
|
|
|
export type ContentQueriesFunction<T> =
|
|
|
|
|
<U extends T>(rf: RenderFlags, ctx: U, directiveIndex: number) => void;
|
2018-06-19 17:58:42 +02:00
|
|
|
|
2019-02-09 22:51:29 +01:00
|
|
|
/**
|
|
|
|
|
* Definition of what a factory function should look like.
|
|
|
|
|
*/
|
|
|
|
|
export type FactoryFn<T> = {
|
|
|
|
|
/**
|
|
|
|
|
* Subclasses without an explicit constructor call through to the factory of their base
|
|
|
|
|
* definition, providing it with their own constructor to instantiate.
|
|
|
|
|
*/
|
|
|
|
|
<U extends T>(t: Type<U>): U;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* If no constructor to instantiate is provided, an instance of type T itself is created.
|
|
|
|
|
*/
|
2019-06-04 13:50:48 -07:00
|
|
|
(t?: undefined): T;
|
2019-02-09 22:51:29 +01:00
|
|
|
};
|
|
|
|
|
|
2018-04-10 20:57:09 -07:00
|
|
|
/**
|
|
|
|
|
* Flags passed into template functions to determine which blocks (i.e. creation, update)
|
|
|
|
|
* should be executed.
|
|
|
|
|
*
|
|
|
|
|
* Typically, a template runs both the creation block and the update block on initialization and
|
|
|
|
|
* subsequent runs only execute the update block. However, dynamically created views require that
|
|
|
|
|
* the creation block be executed separately from the update block (for backwards compat).
|
|
|
|
|
*/
|
|
|
|
|
export const enum RenderFlags {
|
|
|
|
|
/* Whether to run the creation block (e.g. create elements and directives) */
|
|
|
|
|
Create = 0b01,
|
|
|
|
|
|
|
|
|
|
/* Whether to run the update block (e.g. refresh bindings) */
|
|
|
|
|
Update = 0b10
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-04 20:21:23 -08:00
|
|
|
/**
|
2018-04-13 23:02:29 -07:00
|
|
|
* A subclass of `Type` which has a static `ngComponentDef`:`ComponentDef` field making it
|
2018-03-04 20:21:23 -08:00
|
|
|
* consumable for rendering.
|
|
|
|
|
*/
|
2018-04-14 09:18:38 -07:00
|
|
|
export interface ComponentType<T> extends Type<T> { ngComponentDef: never; }
|
2017-12-01 14:23:03 -08:00
|
|
|
|
2018-03-04 20:21:23 -08:00
|
|
|
/**
|
2018-04-13 23:02:29 -07:00
|
|
|
* A subclass of `Type` which has a static `ngDirectiveDef`:`DirectiveDef` field making it
|
2018-03-04 20:21:23 -08:00
|
|
|
* consumable for rendering.
|
|
|
|
|
*/
|
2019-08-12 09:26:20 +03:00
|
|
|
export interface DirectiveType<T> extends Type<T> {
|
|
|
|
|
ngDirectiveDef: never;
|
|
|
|
|
ngFactoryDef: () => T;
|
|
|
|
|
}
|
2017-12-01 14:23:03 -08:00
|
|
|
|
2019-09-27 16:16:10 +02:00
|
|
|
export enum DirectiveDefFlags {
|
|
|
|
|
ContentQuery = 0b10
|
|
|
|
|
}
|
2017-12-01 14:23:03 -08:00
|
|
|
|
2018-03-04 20:21:23 -08:00
|
|
|
/**
|
2018-04-13 23:02:29 -07:00
|
|
|
* A subclass of `Type` which has a static `ngPipeDef`:`PipeDef` field making it
|
2018-03-04 20:21:23 -08:00
|
|
|
* consumable for rendering.
|
|
|
|
|
*/
|
2018-04-14 09:18:38 -07:00
|
|
|
export interface PipeType<T> extends Type<T> { ngPipeDef: never; }
|
2018-01-27 13:07:03 -08:00
|
|
|
|
2019-04-04 11:41:52 -07:00
|
|
|
/**
|
2019-04-10 13:45:26 -07:00
|
|
|
* @codeGenApi
|
2019-04-04 11:41:52 -07:00
|
|
|
*/
|
2019-05-17 18:49:21 -07:00
|
|
|
export type ɵɵDirectiveDefWithMeta<
|
2019-01-08 16:30:57 -08:00
|
|
|
T, Selector extends string, ExportAs extends string[], InputMap extends{[key: string]: string},
|
2018-09-21 12:12:06 -07:00
|
|
|
OutputMap extends{[key: string]: string}, QueryFields extends string[]> = DirectiveDef<T>;
|
2018-05-31 15:50:02 -07:00
|
|
|
|
2017-12-01 14:23:03 -08:00
|
|
|
/**
|
2018-07-23 17:01:22 -07:00
|
|
|
* Runtime information for classes that are inherited by components or directives
|
|
|
|
|
* that aren't defined as components or directives.
|
2018-03-04 20:21:23 -08:00
|
|
|
*
|
2019-04-21 17:37:15 +02:00
|
|
|
* This is an internal data structure used by the renderer to determine what inputs
|
2018-07-23 17:01:22 -07:00
|
|
|
* and outputs should be inherited.
|
2018-03-04 20:21:23 -08:00
|
|
|
*
|
2018-07-23 17:01:22 -07:00
|
|
|
* See: {@link defineBase}
|
2019-04-04 11:41:52 -07:00
|
|
|
*
|
2019-04-10 13:45:26 -07:00
|
|
|
* @codeGenApi
|
2017-12-01 14:23:03 -08:00
|
|
|
*/
|
2019-05-17 18:49:21 -07:00
|
|
|
export interface ɵɵBaseDef<T> {
|
2017-12-01 14:23:03 -08:00
|
|
|
/**
|
2018-02-21 18:12:02 +01:00
|
|
|
* A dictionary mapping the inputs' minified property names to their public API names, which
|
|
|
|
|
* are their aliases if any, or their original unminified property names
|
|
|
|
|
* (as in `@Input('alias') propertyName: any;`).
|
2017-12-01 14:23:03 -08:00
|
|
|
*/
|
2018-06-25 11:11:22 +02:00
|
|
|
readonly inputs: {[P in keyof T]: string};
|
2017-12-01 14:23:03 -08:00
|
|
|
|
2018-06-18 08:05:06 -07:00
|
|
|
/**
|
|
|
|
|
* @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of
|
|
|
|
|
* public or minified name.
|
|
|
|
|
*/
|
2019-01-16 09:35:35 -08:00
|
|
|
readonly declaredInputs: {[P in keyof T]: string};
|
2018-06-18 08:05:06 -07:00
|
|
|
|
2018-02-21 18:12:02 +01:00
|
|
|
/**
|
|
|
|
|
* A dictionary mapping the outputs' minified property names to their public API names, which
|
|
|
|
|
* are their aliases if any, or their original unminified property names
|
|
|
|
|
* (as in `@Output('alias') propertyName: any;`).
|
2017-12-01 14:23:03 -08:00
|
|
|
*/
|
2019-01-16 09:35:35 -08:00
|
|
|
readonly outputs: {[P in keyof T]: string};
|
2019-04-21 17:37:15 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function to create and refresh content queries associated with a given directive.
|
|
|
|
|
*/
|
|
|
|
|
contentQueries: ContentQueriesFunction<T>|null;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Query-related instructions for a directive. Note that while directives don't have a
|
|
|
|
|
* view and as such view queries won't necessarily do anything, there might be
|
|
|
|
|
* components that extend the directive.
|
|
|
|
|
*/
|
|
|
|
|
viewQuery: ViewQueriesFunction<T>|null;
|
2019-04-27 09:33:10 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Refreshes host bindings on the associated directive.
|
|
|
|
|
*/
|
|
|
|
|
hostBindings: HostBindingsFunction<T>|null;
|
2018-07-23 17:01:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runtime link information for Directives.
|
|
|
|
|
*
|
|
|
|
|
* This is internal data structure used by the render to link
|
|
|
|
|
* directives into templates.
|
|
|
|
|
*
|
|
|
|
|
* NOTE: Always use `defineDirective` function to create this object,
|
|
|
|
|
* never create the object directly since the shape of this object
|
|
|
|
|
* can change between versions.
|
|
|
|
|
*
|
|
|
|
|
* @param Selector type metadata specifying the selector of the directive or component
|
|
|
|
|
*
|
|
|
|
|
* See: {@link defineDirective}
|
|
|
|
|
*/
|
2019-05-17 18:49:21 -07:00
|
|
|
export interface DirectiveDef<T> extends ɵɵBaseDef<T> {
|
2018-07-23 17:01:22 -07:00
|
|
|
/** Token representing the directive. Used by DI. */
|
|
|
|
|
type: Type<T>;
|
|
|
|
|
|
2018-10-18 09:23:18 +02:00
|
|
|
/** Function that resolves providers and publishes them into the DI system. */
|
2019-03-11 10:35:25 -07:00
|
|
|
providersResolver:
|
|
|
|
|
(<U extends T>(def: DirectiveDef<U>, processProvidersFn?: ProcessProvidersFunction) =>
|
|
|
|
|
void)|null;
|
2018-07-23 17:01:22 -07:00
|
|
|
|
|
|
|
|
/** The selectors that will be used to match nodes to this directive. */
|
2018-10-18 09:23:18 +02:00
|
|
|
readonly selectors: CssSelectorList;
|
2017-12-01 14:23:03 -08:00
|
|
|
|
2018-01-08 21:57:50 -08:00
|
|
|
/**
|
|
|
|
|
* Name under which the directive is exported (for use with local references in template)
|
|
|
|
|
*/
|
2019-01-10 22:24:32 +01:00
|
|
|
readonly exportAs: string[]|null;
|
2018-01-08 21:57:50 -08:00
|
|
|
|
2017-12-01 14:23:03 -08:00
|
|
|
/**
|
2019-08-12 09:26:20 +03:00
|
|
|
* Factory function used to create a new directive instance. Will be null initially.
|
|
|
|
|
* Populated when the factory is first requested by directive instantiation logic.
|
2017-12-01 14:23:03 -08:00
|
|
|
*/
|
2019-08-12 09:26:20 +03:00
|
|
|
factory: FactoryFn<T>|null;
|
2017-12-01 14:23:03 -08:00
|
|
|
|
2018-01-23 18:39:09 -08:00
|
|
|
/* The following are lifecycle hooks for this component */
|
2019-01-18 17:38:39 +01:00
|
|
|
onChanges: (() => void)|null;
|
2018-01-23 18:39:09 -08:00
|
|
|
onInit: (() => void)|null;
|
|
|
|
|
doCheck: (() => void)|null;
|
|
|
|
|
afterContentInit: (() => void)|null;
|
|
|
|
|
afterContentChecked: (() => void)|null;
|
|
|
|
|
afterViewInit: (() => void)|null;
|
|
|
|
|
afterViewChecked: (() => void)|null;
|
|
|
|
|
onDestroy: (() => void)|null;
|
2018-06-18 08:05:06 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The features applied to this directive
|
|
|
|
|
*/
|
2018-10-18 09:23:18 +02:00
|
|
|
readonly features: DirectiveDefFeature[]|null;
|
2019-01-16 09:35:35 -08:00
|
|
|
|
|
|
|
|
setInput:
|
2019-02-09 22:51:29 +01:00
|
|
|
(<U extends T>(
|
|
|
|
|
this: DirectiveDef<U>, instance: U, value: any, publicName: string,
|
|
|
|
|
privateName: string) => void)|null;
|
2017-12-01 14:23:03 -08:00
|
|
|
}
|
|
|
|
|
|
2019-04-04 11:41:52 -07:00
|
|
|
/**
|
2019-04-10 13:45:26 -07:00
|
|
|
* @codeGenApi
|
2019-04-04 11:41:52 -07:00
|
|
|
*/
|
2019-05-17 18:49:21 -07:00
|
|
|
export type ɵɵComponentDefWithMeta<
|
2019-01-08 16:30:57 -08:00
|
|
|
T, Selector extends String, ExportAs extends string[], InputMap extends{[key: string]: string},
|
2018-09-21 12:12:06 -07:00
|
|
|
OutputMap extends{[key: string]: string}, QueryFields extends string[]> = ComponentDef<T>;
|
2018-05-31 15:50:02 -07:00
|
|
|
|
2019-08-12 09:26:20 +03:00
|
|
|
/**
|
|
|
|
|
* @codeGenApi
|
|
|
|
|
*/
|
|
|
|
|
export type ɵɵFactoryDef<T> = () => T;
|
|
|
|
|
|
2018-03-04 20:21:23 -08:00
|
|
|
/**
|
|
|
|
|
* Runtime link information for Components.
|
|
|
|
|
*
|
|
|
|
|
* This is internal data structure used by the render to link
|
|
|
|
|
* components into templates.
|
|
|
|
|
*
|
|
|
|
|
* NOTE: Always use `defineComponent` function to create this object,
|
|
|
|
|
* never create the object directly since the shape of this object
|
|
|
|
|
* can change between versions.
|
|
|
|
|
*
|
|
|
|
|
* See: {@link defineComponent}
|
|
|
|
|
*/
|
2018-09-21 12:12:06 -07:00
|
|
|
export interface ComponentDef<T> extends DirectiveDef<T> {
|
2018-08-08 13:22:52 -07:00
|
|
|
/**
|
|
|
|
|
* Runtime unique component ID.
|
|
|
|
|
*/
|
2018-10-12 15:49:42 -07:00
|
|
|
readonly id: string;
|
2018-08-08 13:22:52 -07:00
|
|
|
|
2017-12-01 14:23:03 -08:00
|
|
|
/**
|
|
|
|
|
* The View template of the component.
|
|
|
|
|
*/
|
2018-01-09 16:43:12 -08:00
|
|
|
readonly template: ComponentTemplate<T>;
|
2017-12-11 16:30:46 +01:00
|
|
|
|
2019-09-23 20:08:51 +02:00
|
|
|
/** Constants associated with the component's view. */
|
|
|
|
|
readonly consts: TAttributes[]|null;
|
|
|
|
|
|
2018-12-22 16:02:34 +00:00
|
|
|
/**
|
|
|
|
|
* An array of `ngContent[selector]` values that were found in the template.
|
|
|
|
|
*/
|
|
|
|
|
readonly ngContentSelectors?: string[];
|
|
|
|
|
|
2018-08-08 13:22:52 -07:00
|
|
|
/**
|
|
|
|
|
* A set of styles that the component needs to be present for component to render correctly.
|
|
|
|
|
*/
|
|
|
|
|
readonly styles: string[];
|
|
|
|
|
|
2018-08-16 18:53:21 -07:00
|
|
|
/**
|
|
|
|
|
* The number of nodes, local refs, and pipes in this component template.
|
|
|
|
|
*
|
2018-11-21 21:14:06 -08:00
|
|
|
* Used to calculate the length of the component's LView array, so we
|
2018-08-16 18:53:21 -07:00
|
|
|
* can pre-fill the array and set the binding start index.
|
|
|
|
|
*/
|
|
|
|
|
// TODO(kara): remove queries from this count
|
2019-09-23 20:08:51 +02:00
|
|
|
readonly decls: number;
|
2018-08-16 18:53:21 -07:00
|
|
|
|
2018-08-18 11:14:50 -07:00
|
|
|
/**
|
|
|
|
|
* The number of bindings in this component template (including pure fn bindings).
|
|
|
|
|
*
|
2018-11-21 21:14:06 -08:00
|
|
|
* Used to calculate the length of the component's LView array, so we
|
2018-08-18 11:14:50 -07:00
|
|
|
* can pre-fill the array and set the host binding start index.
|
|
|
|
|
*/
|
2018-10-12 15:49:42 -07:00
|
|
|
readonly vars: number;
|
2018-08-18 11:14:50 -07:00
|
|
|
|
2018-06-19 17:58:42 +02:00
|
|
|
/**
|
|
|
|
|
* Query-related instructions for a component.
|
|
|
|
|
*/
|
2019-02-02 11:20:33 -08:00
|
|
|
viewQuery: ViewQueriesFunction<T>|null;
|
2018-06-19 17:58:42 +02:00
|
|
|
|
2017-12-11 16:30:46 +01:00
|
|
|
/**
|
2018-08-08 13:22:52 -07:00
|
|
|
* The view encapsulation type, which determines how styles are applied to
|
|
|
|
|
* DOM elements. One of
|
|
|
|
|
* - `Emulated` (default): Emulate native scoping of styles.
|
|
|
|
|
* - `Native`: Use the native encapsulation mechanism of the renderer.
|
|
|
|
|
* - `ShadowDom`: Use modern [ShadowDOM](https://w3c.github.io/webcomponents/spec/shadow/) and
|
|
|
|
|
* create a ShadowRoot for component's host element.
|
|
|
|
|
* - `None`: Do not provide any template or style encapsulation.
|
|
|
|
|
*/
|
|
|
|
|
readonly encapsulation: ViewEncapsulation;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Defines arbitrary developer-defined data to be stored on a renderer instance.
|
|
|
|
|
* This is useful for renderers that delegate to other renderers.
|
2017-12-11 16:30:46 +01:00
|
|
|
*/
|
2018-08-08 13:22:52 -07:00
|
|
|
readonly data: {[kind: string]: any};
|
2018-02-23 13:17:20 -08:00
|
|
|
|
|
|
|
|
/** Whether or not this component's ChangeDetectionStrategy is OnPush */
|
|
|
|
|
readonly onPush: boolean;
|
2018-03-04 20:21:23 -08:00
|
|
|
|
|
|
|
|
/**
|
2018-03-25 21:32:39 -07:00
|
|
|
* Registry of directives and components that may be found in this view.
|
|
|
|
|
*
|
2018-04-13 23:02:29 -07:00
|
|
|
* The property is either an array of `DirectiveDef`s or a function which returns the array of
|
|
|
|
|
* `DirectiveDef`s. The function is necessary to be able to support forward declarations.
|
2018-03-25 21:32:39 -07:00
|
|
|
*/
|
|
|
|
|
directiveDefs: DirectiveDefListOrFactory|null;
|
2018-03-27 15:53:48 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Registry of pipes that may be found in this view.
|
|
|
|
|
*
|
|
|
|
|
* The property is either an array of `PipeDefs`s or a function which returns the array of
|
|
|
|
|
* `PipeDefs`s. The function is necessary to be able to support forward declarations.
|
|
|
|
|
*/
|
|
|
|
|
pipeDefs: PipeDefListOrFactory|null;
|
2018-10-12 15:49:42 -07:00
|
|
|
|
2019-02-12 00:03:04 +01:00
|
|
|
/**
|
|
|
|
|
* The set of schemas that declare elements to be allowed in the component's template.
|
|
|
|
|
*/
|
|
|
|
|
schemas: SchemaMetadata[]|null;
|
|
|
|
|
|
2019-05-17 16:25:09 -07:00
|
|
|
/**
|
|
|
|
|
* Ivy runtime uses this place to store the computed tView for the component. This gets filled on
|
|
|
|
|
* the first run of component.
|
|
|
|
|
*/
|
|
|
|
|
tView: TView|null;
|
|
|
|
|
|
2018-10-12 15:49:42 -07:00
|
|
|
/**
|
|
|
|
|
* Used to store the result of `noSideEffects` function so that it is not removed by closure
|
|
|
|
|
* compiler. The property should never be read.
|
|
|
|
|
*/
|
|
|
|
|
readonly _?: never;
|
2017-12-01 14:23:03 -08:00
|
|
|
}
|
|
|
|
|
|
2018-01-27 13:07:03 -08:00
|
|
|
/**
|
2018-03-04 20:21:23 -08:00
|
|
|
* Runtime link information for Pipes.
|
|
|
|
|
*
|
|
|
|
|
* This is internal data structure used by the renderer to link
|
|
|
|
|
* pipes into templates.
|
2018-01-27 13:07:03 -08:00
|
|
|
*
|
2018-03-04 20:21:23 -08:00
|
|
|
* NOTE: Always use `definePipe` function to create this object,
|
|
|
|
|
* never create the object directly since the shape of this object
|
|
|
|
|
* can change between versions.
|
|
|
|
|
*
|
|
|
|
|
* See: {@link definePipe}
|
2018-01-27 13:07:03 -08:00
|
|
|
*/
|
2018-09-21 12:12:06 -07:00
|
|
|
export interface PipeDef<T> {
|
2019-08-12 09:26:20 +03:00
|
|
|
/** Token representing the pipe. */
|
|
|
|
|
type: Type<T>;
|
|
|
|
|
|
2018-03-27 15:53:48 -07:00
|
|
|
/**
|
|
|
|
|
* Pipe name.
|
|
|
|
|
*
|
|
|
|
|
* Used to resolve pipe in templates.
|
|
|
|
|
*/
|
2018-10-18 09:23:18 +02:00
|
|
|
readonly name: string;
|
2018-03-27 15:53:48 -07:00
|
|
|
|
2018-01-27 13:07:03 -08:00
|
|
|
/**
|
2019-08-12 09:26:20 +03:00
|
|
|
* Factory function used to create a new pipe instance. Will be null initially.
|
|
|
|
|
* Populated when the factory is first requested by pipe instantiation logic.
|
2018-01-27 13:07:03 -08:00
|
|
|
*/
|
2019-08-12 09:26:20 +03:00
|
|
|
factory: FactoryFn<T>|null;
|
2018-01-27 13:07:03 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether or not the pipe is pure.
|
|
|
|
|
*
|
|
|
|
|
* Pure pipes result only depends on the pipe input and not on internal
|
|
|
|
|
* state of the pipe.
|
|
|
|
|
*/
|
2018-10-18 09:23:18 +02:00
|
|
|
readonly pure: boolean;
|
2018-01-27 13:07:03 -08:00
|
|
|
|
|
|
|
|
/* The following are lifecycle hooks for this pipe */
|
|
|
|
|
onDestroy: (() => void)|null;
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-04 11:41:52 -07:00
|
|
|
/**
|
2019-04-10 13:45:26 -07:00
|
|
|
* @codeGenApi
|
2019-04-04 11:41:52 -07:00
|
|
|
*/
|
2019-05-17 18:49:21 -07:00
|
|
|
export type ɵɵPipeDefWithMeta<T, Name extends string> = PipeDef<T>;
|
2018-06-26 10:43:06 -07:00
|
|
|
|
2018-11-08 11:26:28 -08:00
|
|
|
export interface DirectiveDefFeature {
|
|
|
|
|
<T>(directiveDef: DirectiveDef<T>): void;
|
2019-01-22 11:17:13 -08:00
|
|
|
/**
|
|
|
|
|
* Marks a feature as something that {@link InheritDefinitionFeature} will execute
|
|
|
|
|
* during inheritance.
|
|
|
|
|
*
|
|
|
|
|
* NOTE: DO NOT SET IN ROOT OF MODULE! Doing so will result in tree-shakers/bundlers
|
|
|
|
|
* identifying the change as a side effect, and the feature will be included in
|
|
|
|
|
* every bundle.
|
|
|
|
|
*/
|
2018-11-08 11:26:28 -08:00
|
|
|
ngInherit?: true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ComponentDefFeature {
|
|
|
|
|
<T>(componentDef: ComponentDef<T>): void;
|
2019-01-22 11:17:13 -08:00
|
|
|
/**
|
|
|
|
|
* Marks a feature as something that {@link InheritDefinitionFeature} will execute
|
|
|
|
|
* during inheritance.
|
|
|
|
|
*
|
|
|
|
|
* NOTE: DO NOT SET IN ROOT OF MODULE! Doing so will result in tree-shakers/bundlers
|
|
|
|
|
* identifying the change as a side effect, and the feature will be included in
|
|
|
|
|
* every bundle.
|
|
|
|
|
*/
|
2018-11-08 11:26:28 -08:00
|
|
|
ngInherit?: true;
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-09 18:38:17 -08:00
|
|
|
|
2018-03-25 21:32:39 -07:00
|
|
|
/**
|
|
|
|
|
* Type used for directiveDefs on component definition.
|
|
|
|
|
*
|
|
|
|
|
* The function is necessary to be able to support forward declarations.
|
|
|
|
|
*/
|
|
|
|
|
export type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;
|
|
|
|
|
|
2018-09-21 12:12:06 -07:00
|
|
|
export type DirectiveDefList = (DirectiveDef<any>| ComponentDef<any>)[];
|
2018-03-25 21:32:39 -07:00
|
|
|
|
2018-03-29 12:58:41 -07:00
|
|
|
export type DirectiveTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;
|
|
|
|
|
|
|
|
|
|
export type DirectiveTypeList =
|
2019-06-11 21:13:36 +02:00
|
|
|
(DirectiveType<any>| ComponentType<any>|
|
2018-03-29 12:58:41 -07:00
|
|
|
Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];
|
|
|
|
|
|
2019-02-09 22:51:29 +01:00
|
|
|
export type HostBindingsFunction<T> =
|
|
|
|
|
<U extends T>(rf: RenderFlags, ctx: U, elementIndex: number) => void;
|
2018-10-08 16:04:46 -07:00
|
|
|
|
2018-03-27 15:53:48 -07:00
|
|
|
/**
|
|
|
|
|
* Type used for PipeDefs on component definition.
|
|
|
|
|
*
|
|
|
|
|
* The function is necessary to be able to support forward declarations.
|
|
|
|
|
*/
|
|
|
|
|
export type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;
|
|
|
|
|
|
2018-09-21 12:12:06 -07:00
|
|
|
export type PipeDefList = PipeDef<any>[];
|
2018-03-27 15:53:48 -07:00
|
|
|
|
2019-06-11 21:13:36 +02:00
|
|
|
export type PipeTypesOrFactory = (() => PipeTypeList) | PipeTypeList;
|
2018-03-29 12:58:41 -07:00
|
|
|
|
|
|
|
|
export type PipeTypeList =
|
2019-06-11 21:13:36 +02:00
|
|
|
(PipeType<any>| Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];
|
2018-03-29 12:58:41 -07:00
|
|
|
|
|
|
|
|
|
2018-01-09 18:38:17 -08:00
|
|
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
|
|
|
// failure based on types.
|
2019-01-10 22:24:32 +01:00
|
|
|
export const unusedValueExportToPlacateAjd = 1;
|