1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | export interface Inject {
|
---|
9 | token: any;
|
---|
10 | }
|
---|
11 | export declare const createInject: MetadataFactory<Inject>;
|
---|
12 | export declare const createInjectionToken: MetadataFactory<object>;
|
---|
13 | export interface Attribute {
|
---|
14 | attributeName: string;
|
---|
15 | }
|
---|
16 | export declare const createAttribute: MetadataFactory<Attribute>;
|
---|
17 | export declare const emitDistinctChangesOnlyDefaultValue = true;
|
---|
18 | export interface Query {
|
---|
19 | descendants: boolean;
|
---|
20 | first: boolean;
|
---|
21 | read: any;
|
---|
22 | isViewQuery: boolean;
|
---|
23 | selector: any;
|
---|
24 | static?: boolean;
|
---|
25 | emitDistinctChangesOnly: boolean;
|
---|
26 | }
|
---|
27 | export declare const createContentChildren: MetadataFactory<Query>;
|
---|
28 | export declare const createContentChild: MetadataFactory<Query>;
|
---|
29 | export declare const createViewChildren: MetadataFactory<Query>;
|
---|
30 | export declare const createViewChild: MetadataFactory<Query>;
|
---|
31 | export interface Directive {
|
---|
32 | selector?: string;
|
---|
33 | inputs?: string[];
|
---|
34 | outputs?: string[];
|
---|
35 | host?: {
|
---|
36 | [key: string]: string;
|
---|
37 | };
|
---|
38 | providers?: Provider[];
|
---|
39 | exportAs?: string;
|
---|
40 | queries?: {
|
---|
41 | [key: string]: any;
|
---|
42 | };
|
---|
43 | guards?: {
|
---|
44 | [key: string]: any;
|
---|
45 | };
|
---|
46 | }
|
---|
47 | export declare const createDirective: MetadataFactory<Directive>;
|
---|
48 | export interface Component extends Directive {
|
---|
49 | changeDetection?: ChangeDetectionStrategy;
|
---|
50 | viewProviders?: Provider[];
|
---|
51 | moduleId?: string;
|
---|
52 | templateUrl?: string;
|
---|
53 | template?: string;
|
---|
54 | styleUrls?: string[];
|
---|
55 | styles?: string[];
|
---|
56 | animations?: any[];
|
---|
57 | encapsulation?: ViewEncapsulation;
|
---|
58 | interpolation?: [string, string];
|
---|
59 | entryComponents?: Array<Type | any[]>;
|
---|
60 | preserveWhitespaces?: boolean;
|
---|
61 | }
|
---|
62 | export declare enum ViewEncapsulation {
|
---|
63 | Emulated = 0,
|
---|
64 | None = 2,
|
---|
65 | ShadowDom = 3
|
---|
66 | }
|
---|
67 | export declare enum ChangeDetectionStrategy {
|
---|
68 | OnPush = 0,
|
---|
69 | Default = 1
|
---|
70 | }
|
---|
71 | export declare const createComponent: MetadataFactory<Component>;
|
---|
72 | export interface Pipe {
|
---|
73 | name: string;
|
---|
74 | pure?: boolean;
|
---|
75 | }
|
---|
76 | export declare const createPipe: MetadataFactory<Pipe>;
|
---|
77 | export interface Input {
|
---|
78 | bindingPropertyName?: string;
|
---|
79 | }
|
---|
80 | export declare const createInput: MetadataFactory<Input>;
|
---|
81 | export interface Output {
|
---|
82 | bindingPropertyName?: string;
|
---|
83 | }
|
---|
84 | export declare const createOutput: MetadataFactory<Output>;
|
---|
85 | export interface HostBinding {
|
---|
86 | hostPropertyName?: string;
|
---|
87 | }
|
---|
88 | export declare const createHostBinding: MetadataFactory<HostBinding>;
|
---|
89 | export interface HostListener {
|
---|
90 | eventName?: string;
|
---|
91 | args?: string[];
|
---|
92 | }
|
---|
93 | export declare const createHostListener: MetadataFactory<HostListener>;
|
---|
94 | export interface NgModule {
|
---|
95 | providers?: Provider[];
|
---|
96 | declarations?: Array<Type | any[]>;
|
---|
97 | imports?: Array<Type | ModuleWithProviders | any[]>;
|
---|
98 | exports?: Array<Type | any[]>;
|
---|
99 | entryComponents?: Array<Type | any[]>;
|
---|
100 | bootstrap?: Array<Type | any[]>;
|
---|
101 | schemas?: Array<SchemaMetadata | any[]>;
|
---|
102 | id?: string;
|
---|
103 | }
|
---|
104 | export declare const createNgModule: MetadataFactory<NgModule>;
|
---|
105 | export interface ModuleWithProviders {
|
---|
106 | ngModule: Type;
|
---|
107 | providers?: Provider[];
|
---|
108 | }
|
---|
109 | export interface Injectable {
|
---|
110 | providedIn?: Type | 'root' | any;
|
---|
111 | useClass?: Type | any;
|
---|
112 | useExisting?: Type | any;
|
---|
113 | useValue?: any;
|
---|
114 | useFactory?: Type | any;
|
---|
115 | deps?: Array<Type | any[]>;
|
---|
116 | }
|
---|
117 | export declare const createInjectable: MetadataFactory<Injectable>;
|
---|
118 | export interface SchemaMetadata {
|
---|
119 | name: string;
|
---|
120 | }
|
---|
121 | export declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
|
---|
122 | export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
|
---|
123 | export declare const createOptional: MetadataFactory<unknown>;
|
---|
124 | export declare const createSelf: MetadataFactory<unknown>;
|
---|
125 | export declare const createSkipSelf: MetadataFactory<unknown>;
|
---|
126 | export declare const createHost: MetadataFactory<unknown>;
|
---|
127 | export interface Type extends Function {
|
---|
128 | new (...args: any[]): any;
|
---|
129 | }
|
---|
130 | export declare const Type: FunctionConstructor;
|
---|
131 | export declare enum SecurityContext {
|
---|
132 | NONE = 0,
|
---|
133 | HTML = 1,
|
---|
134 | STYLE = 2,
|
---|
135 | SCRIPT = 3,
|
---|
136 | URL = 4,
|
---|
137 | RESOURCE_URL = 5
|
---|
138 | }
|
---|
139 | export declare type Provider = any;
|
---|
140 | export declare const enum NodeFlags {
|
---|
141 | None = 0,
|
---|
142 | TypeElement = 1,
|
---|
143 | TypeText = 2,
|
---|
144 | ProjectedTemplate = 4,
|
---|
145 | CatRenderNode = 3,
|
---|
146 | TypeNgContent = 8,
|
---|
147 | TypePipe = 16,
|
---|
148 | TypePureArray = 32,
|
---|
149 | TypePureObject = 64,
|
---|
150 | TypePurePipe = 128,
|
---|
151 | CatPureExpression = 224,
|
---|
152 | TypeValueProvider = 256,
|
---|
153 | TypeClassProvider = 512,
|
---|
154 | TypeFactoryProvider = 1024,
|
---|
155 | TypeUseExistingProvider = 2048,
|
---|
156 | LazyProvider = 4096,
|
---|
157 | PrivateProvider = 8192,
|
---|
158 | TypeDirective = 16384,
|
---|
159 | Component = 32768,
|
---|
160 | CatProviderNoDirective = 3840,
|
---|
161 | CatProvider = 20224,
|
---|
162 | OnInit = 65536,
|
---|
163 | OnDestroy = 131072,
|
---|
164 | DoCheck = 262144,
|
---|
165 | OnChanges = 524288,
|
---|
166 | AfterContentInit = 1048576,
|
---|
167 | AfterContentChecked = 2097152,
|
---|
168 | AfterViewInit = 4194304,
|
---|
169 | AfterViewChecked = 8388608,
|
---|
170 | EmbeddedViews = 16777216,
|
---|
171 | ComponentView = 33554432,
|
---|
172 | TypeContentQuery = 67108864,
|
---|
173 | TypeViewQuery = 134217728,
|
---|
174 | StaticQuery = 268435456,
|
---|
175 | DynamicQuery = 536870912,
|
---|
176 | TypeModuleProvider = 1073741824,
|
---|
177 | EmitDistinctChangesOnly = -2147483648,
|
---|
178 | CatQuery = 201326592,
|
---|
179 | Types = 201347067
|
---|
180 | }
|
---|
181 | export declare const enum DepFlags {
|
---|
182 | None = 0,
|
---|
183 | SkipSelf = 1,
|
---|
184 | Optional = 2,
|
---|
185 | Self = 4,
|
---|
186 | Value = 8
|
---|
187 | }
|
---|
188 | /**
|
---|
189 | * Injection flags for DI.
|
---|
190 | */
|
---|
191 | export declare const enum InjectFlags {
|
---|
192 | Default = 0,
|
---|
193 | /**
|
---|
194 | * Specifies that an injector should retrieve a dependency from any injector until reaching the
|
---|
195 | * host element of the current component. (Only used with Element Injector)
|
---|
196 | */
|
---|
197 | Host = 1,
|
---|
198 | /** Don't descend into ancestors of the node requesting injection. */
|
---|
199 | Self = 2,
|
---|
200 | /** Skip the node that is requesting injection. */
|
---|
201 | SkipSelf = 4,
|
---|
202 | /** Inject `defaultValue` instead if token not found. */
|
---|
203 | Optional = 8
|
---|
204 | }
|
---|
205 | export declare const enum ArgumentType {
|
---|
206 | Inline = 0,
|
---|
207 | Dynamic = 1
|
---|
208 | }
|
---|
209 | export declare const enum BindingFlags {
|
---|
210 | TypeElementAttribute = 1,
|
---|
211 | TypeElementClass = 2,
|
---|
212 | TypeElementStyle = 4,
|
---|
213 | TypeProperty = 8,
|
---|
214 | SyntheticProperty = 16,
|
---|
215 | SyntheticHostProperty = 32,
|
---|
216 | CatSyntheticProperty = 48,
|
---|
217 | Types = 15
|
---|
218 | }
|
---|
219 | export declare const enum QueryBindingType {
|
---|
220 | First = 0,
|
---|
221 | All = 1
|
---|
222 | }
|
---|
223 | export declare const enum QueryValueType {
|
---|
224 | ElementRef = 0,
|
---|
225 | RenderElement = 1,
|
---|
226 | TemplateRef = 2,
|
---|
227 | ViewContainerRef = 3,
|
---|
228 | Provider = 4
|
---|
229 | }
|
---|
230 | export declare const enum ViewFlags {
|
---|
231 | None = 0,
|
---|
232 | OnPush = 2
|
---|
233 | }
|
---|
234 | export declare enum MissingTranslationStrategy {
|
---|
235 | Error = 0,
|
---|
236 | Warning = 1,
|
---|
237 | Ignore = 2
|
---|
238 | }
|
---|
239 | export interface MetadataFactory<T> {
|
---|
240 | (...args: any[]): T;
|
---|
241 | isTypeOf(obj: any): obj is T;
|
---|
242 | ngMetadataName: string;
|
---|
243 | }
|
---|
244 | export interface Route {
|
---|
245 | children?: Route[];
|
---|
246 | loadChildren?: string | Type | any;
|
---|
247 | }
|
---|
248 | /**
|
---|
249 | * Flags used to generate R3-style CSS Selectors. They are pasted from
|
---|
250 | * core/src/render3/projection.ts because they cannot be referenced directly.
|
---|
251 | */
|
---|
252 | export declare const enum SelectorFlags {
|
---|
253 | /** Indicates this is the beginning of a new negative selector */
|
---|
254 | NOT = 1,
|
---|
255 | /** Mode for matching attributes */
|
---|
256 | ATTRIBUTE = 2,
|
---|
257 | /** Mode for matching tag names */
|
---|
258 | ELEMENT = 4,
|
---|
259 | /** Mode for matching class names */
|
---|
260 | CLASS = 8
|
---|
261 | }
|
---|
262 | export declare type R3CssSelector = (string | SelectorFlags)[];
|
---|
263 | export declare type R3CssSelectorList = R3CssSelector[];
|
---|
264 | export declare function parseSelectorToR3Selector(selector: string | null): R3CssSelectorList;
|
---|
265 | /**
|
---|
266 | * Flags passed into template functions to determine which blocks (i.e. creation, update)
|
---|
267 | * should be executed.
|
---|
268 | *
|
---|
269 | * Typically, a template runs both the creation block and the update block on initialization and
|
---|
270 | * subsequent runs only execute the update block. However, dynamically created views require that
|
---|
271 | * the creation block be executed separately from the update block (for backwards compat).
|
---|
272 | */
|
---|
273 | export declare const enum RenderFlags {
|
---|
274 | Create = 1,
|
---|
275 | Update = 2
|
---|
276 | }
|
---|
277 | /**
|
---|
278 | * A set of marker values to be used in the attributes arrays. These markers indicate that some
|
---|
279 | * items are not regular attributes and the processing should be adapted accordingly.
|
---|
280 | */
|
---|
281 | export declare const enum AttributeMarker {
|
---|
282 | /**
|
---|
283 | * Marker indicates that the following 3 values in the attributes array are:
|
---|
284 | * namespaceUri, attributeName, attributeValue
|
---|
285 | * in that order.
|
---|
286 | */
|
---|
287 | NamespaceURI = 0,
|
---|
288 | /**
|
---|
289 | * Signals class declaration.
|
---|
290 | *
|
---|
291 | * Each value following `Classes` designates a class name to include on the element.
|
---|
292 | * ## Example:
|
---|
293 | *
|
---|
294 | * Given:
|
---|
295 | * ```
|
---|
296 | * <div class="foo bar baz">...<d/vi>
|
---|
297 | * ```
|
---|
298 | *
|
---|
299 | * the generated code is:
|
---|
300 | * ```
|
---|
301 | * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];
|
---|
302 | * ```
|
---|
303 | */
|
---|
304 | Classes = 1,
|
---|
305 | /**
|
---|
306 | * Signals style declaration.
|
---|
307 | *
|
---|
308 | * Each pair of values following `Styles` designates a style name and value to include on the
|
---|
309 | * element.
|
---|
310 | * ## Example:
|
---|
311 | *
|
---|
312 | * Given:
|
---|
313 | * ```
|
---|
314 | * <div style="width:100px; height:200px; color:red">...</div>
|
---|
315 | * ```
|
---|
316 | *
|
---|
317 | * the generated code is:
|
---|
318 | * ```
|
---|
319 | * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];
|
---|
320 | * ```
|
---|
321 | */
|
---|
322 | Styles = 2,
|
---|
323 | /**
|
---|
324 | * Signals that the following attribute names were extracted from input or output bindings.
|
---|
325 | *
|
---|
326 | * For example, given the following HTML:
|
---|
327 | *
|
---|
328 | * ```
|
---|
329 | * <div moo="car" [foo]="exp" (bar)="doSth()">
|
---|
330 | * ```
|
---|
331 | *
|
---|
332 | * the generated code is:
|
---|
333 | *
|
---|
334 | * ```
|
---|
335 | * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar'];
|
---|
336 | * ```
|
---|
337 | */
|
---|
338 | Bindings = 3,
|
---|
339 | /**
|
---|
340 | * Signals that the following attribute names were hoisted from an inline-template declaration.
|
---|
341 | *
|
---|
342 | * For example, given the following HTML:
|
---|
343 | *
|
---|
344 | * ```
|
---|
345 | * <div *ngFor="let value of values; trackBy:trackBy" dirA [dirB]="value">
|
---|
346 | * ```
|
---|
347 | *
|
---|
348 | * the generated code for the `template()` instruction would include:
|
---|
349 | *
|
---|
350 | * ```
|
---|
351 | * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf',
|
---|
352 | * 'ngForTrackBy', 'let-value']
|
---|
353 | * ```
|
---|
354 | *
|
---|
355 | * while the generated code for the `element()` instruction inside the template function would
|
---|
356 | * include:
|
---|
357 | *
|
---|
358 | * ```
|
---|
359 | * ['dirA', '', AttributeMarker.Bindings, 'dirB']
|
---|
360 | * ```
|
---|
361 | */
|
---|
362 | Template = 4,
|
---|
363 | /**
|
---|
364 | * Signals that the following attribute is `ngProjectAs` and its value is a parsed `CssSelector`.
|
---|
365 | *
|
---|
366 | * For example, given the following HTML:
|
---|
367 | *
|
---|
368 | * ```
|
---|
369 | * <h1 attr="value" ngProjectAs="[title]">
|
---|
370 | * ```
|
---|
371 | *
|
---|
372 | * the generated code for the `element()` instruction would include:
|
---|
373 | *
|
---|
374 | * ```
|
---|
375 | * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']]
|
---|
376 | * ```
|
---|
377 | */
|
---|
378 | ProjectAs = 5,
|
---|
379 | /**
|
---|
380 | * Signals that the following attribute will be translated by runtime i18n
|
---|
381 | *
|
---|
382 | * For example, given the following HTML:
|
---|
383 | *
|
---|
384 | * ```
|
---|
385 | * <div moo="car" foo="value" i18n-foo [bar]="binding" i18n-bar>
|
---|
386 | * ```
|
---|
387 | *
|
---|
388 | * the generated code is:
|
---|
389 | *
|
---|
390 | * ```
|
---|
391 | * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar'];
|
---|
392 | */
|
---|
393 | I18n = 6
|
---|
394 | }
|
---|