source: trip-planner-front/node_modules/@angular/compiler-cli/src/metadata/evaluator.d.ts@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.5 KB
Line 
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/// <amd-module name="@angular/compiler-cli/src/metadata/evaluator" />
9import * as ts from 'typescript';
10import { CollectorOptions } from './collector';
11import { MetadataEntry, MetadataError, MetadataValue } from './schema';
12import { Symbols } from './symbols';
13export declare function isPrimitive(value: any): boolean;
14export interface ImportSpecifierMetadata {
15 name: string;
16 propertyName?: string;
17}
18export interface ImportMetadata {
19 defaultName?: string;
20 namespace?: string;
21 namedImports?: ImportSpecifierMetadata[];
22 from: string;
23}
24/**
25 * Produce a symbolic representation of an expression folding values into their final value when
26 * possible.
27 */
28export declare class Evaluator {
29 private symbols;
30 private nodeMap;
31 private options;
32 private recordExport?;
33 constructor(symbols: Symbols, nodeMap: Map<MetadataEntry, ts.Node>, options?: CollectorOptions, recordExport?: ((name: string, value: MetadataValue) => void) | undefined);
34 nameOf(node: ts.Node | undefined): string | MetadataError;
35 /**
36 * Returns true if the expression represented by `node` can be folded into a literal expression.
37 *
38 * For example, a literal is always foldable. This means that literal expressions such as `1.2`
39 * `"Some value"` `true` `false` are foldable.
40 *
41 * - An object literal is foldable if all the properties in the literal are foldable.
42 * - An array literal is foldable if all the elements are foldable.
43 * - A call is foldable if it is a call to a Array.prototype.concat or a call to CONST_EXPR.
44 * - A property access is foldable if the object is foldable.
45 * - A array index is foldable if index expression is foldable and the array is foldable.
46 * - Binary operator expressions are foldable if the left and right expressions are foldable and
47 * it is one of '+', '-', '*', '/', '%', '||', and '&&'.
48 * - An identifier is foldable if a value can be found for its symbol in the evaluator symbol
49 * table.
50 */
51 isFoldable(node: ts.Node): boolean;
52 private isFoldableWorker;
53 /**
54 * Produce a JSON serialiable object representing `node`. The foldable values in the expression
55 * tree are folded. For example, a node representing `1 + 2` is folded into `3`.
56 */
57 evaluateNode(node: ts.Node, preferReference?: boolean): MetadataValue;
58}
Note: See TracBrowser for help on using the repository browser.