[6a3a178] | 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/schema" />
|
---|
| 9 | export declare const METADATA_VERSION = 4;
|
---|
| 10 | export declare type MetadataEntry = ClassMetadata | InterfaceMetadata | FunctionMetadata | MetadataValue;
|
---|
| 11 | export interface ModuleMetadata {
|
---|
| 12 | __symbolic: 'module';
|
---|
| 13 | version: number;
|
---|
| 14 | exports?: ModuleExportMetadata[];
|
---|
| 15 | importAs?: string;
|
---|
| 16 | metadata: {
|
---|
| 17 | [name: string]: MetadataEntry;
|
---|
| 18 | };
|
---|
| 19 | origins?: {
|
---|
| 20 | [name: string]: string;
|
---|
| 21 | };
|
---|
| 22 | }
|
---|
| 23 | export declare function isModuleMetadata(value: any): value is ModuleMetadata;
|
---|
| 24 | export interface ModuleExportMetadata {
|
---|
| 25 | export?: (string | {
|
---|
| 26 | name: string;
|
---|
| 27 | as: string;
|
---|
| 28 | })[];
|
---|
| 29 | from: string;
|
---|
| 30 | }
|
---|
| 31 | export interface ClassMetadata {
|
---|
| 32 | __symbolic: 'class';
|
---|
| 33 | extends?: MetadataSymbolicExpression | MetadataError;
|
---|
| 34 | arity?: number;
|
---|
| 35 | decorators?: (MetadataSymbolicExpression | MetadataError)[];
|
---|
| 36 | members?: MetadataMap;
|
---|
| 37 | statics?: {
|
---|
| 38 | [name: string]: MetadataValue | FunctionMetadata;
|
---|
| 39 | };
|
---|
| 40 | }
|
---|
| 41 | export declare function isClassMetadata(value: any): value is ClassMetadata;
|
---|
| 42 | export interface InterfaceMetadata {
|
---|
| 43 | __symbolic: 'interface';
|
---|
| 44 | }
|
---|
| 45 | export declare function isInterfaceMetadata(value: any): value is InterfaceMetadata;
|
---|
| 46 | export interface MetadataMap {
|
---|
| 47 | [name: string]: MemberMetadata[];
|
---|
| 48 | }
|
---|
| 49 | export interface MemberMetadata {
|
---|
| 50 | __symbolic: 'constructor' | 'method' | 'property';
|
---|
| 51 | decorators?: (MetadataSymbolicExpression | MetadataError)[];
|
---|
| 52 | parameters?: (MetadataSymbolicExpression | MetadataError | null | undefined)[];
|
---|
| 53 | }
|
---|
| 54 | export declare function isMemberMetadata(value: any): value is MemberMetadata;
|
---|
| 55 | export interface MethodMetadata extends MemberMetadata {
|
---|
| 56 | __symbolic: 'constructor' | 'method';
|
---|
| 57 | parameterDecorators?: ((MetadataSymbolicExpression | MetadataError)[] | undefined)[];
|
---|
| 58 | }
|
---|
| 59 | export declare function isMethodMetadata(value: any): value is MethodMetadata;
|
---|
| 60 | export interface ConstructorMetadata extends MethodMetadata {
|
---|
| 61 | __symbolic: 'constructor';
|
---|
| 62 | parameters?: (MetadataSymbolicExpression | MetadataError | null | undefined)[];
|
---|
| 63 | }
|
---|
| 64 | export declare function isConstructorMetadata(value: any): value is ConstructorMetadata;
|
---|
| 65 | export interface FunctionMetadata {
|
---|
| 66 | __symbolic: 'function';
|
---|
| 67 | parameters: string[];
|
---|
| 68 | defaults?: MetadataValue[];
|
---|
| 69 | value: MetadataValue;
|
---|
| 70 | }
|
---|
| 71 | export declare function isFunctionMetadata(value: any): value is FunctionMetadata;
|
---|
| 72 | export declare type MetadataValue = string | number | boolean | undefined | null | MetadataObject | MetadataArray | MetadataSymbolicExpression | MetadataSymbolicReferenceExpression | MetadataSymbolicBinaryExpression | MetadataSymbolicIndexExpression | MetadataSymbolicCallExpression | MetadataSymbolicPrefixExpression | MetadataSymbolicIfExpression | MetadataSymbolicSpreadExpression | MetadataSymbolicSelectExpression | MetadataError;
|
---|
| 73 | export interface MetadataObject {
|
---|
| 74 | [name: string]: MetadataValue;
|
---|
| 75 | }
|
---|
| 76 | export interface MetadataArray {
|
---|
| 77 | [name: number]: MetadataValue;
|
---|
| 78 | }
|
---|
| 79 | export declare type MetadataSymbolicExpression = MetadataSymbolicBinaryExpression | MetadataSymbolicIndexExpression | MetadataSymbolicIndexExpression | MetadataSymbolicCallExpression | MetadataSymbolicCallExpression | MetadataSymbolicPrefixExpression | MetadataSymbolicIfExpression | MetadataGlobalReferenceExpression | MetadataModuleReferenceExpression | MetadataImportedSymbolReferenceExpression | MetadataImportedDefaultReferenceExpression | MetadataSymbolicSelectExpression | MetadataSymbolicSpreadExpression;
|
---|
| 80 | export declare function isMetadataSymbolicExpression(value: any): value is MetadataSymbolicExpression;
|
---|
| 81 | export interface MetadataSymbolicBinaryExpression {
|
---|
| 82 | __symbolic: 'binary';
|
---|
| 83 | operator: '&&' | '||' | '|' | '^' | '&' | '==' | '!=' | '===' | '!==' | '<' | '>' | '<=' | '>=' | 'instanceof' | 'in' | 'as' | '<<' | '>>' | '>>>' | '+' | '-' | '*' | '/' | '%' | '**' | '??';
|
---|
| 84 | left: MetadataValue;
|
---|
| 85 | right: MetadataValue;
|
---|
| 86 | }
|
---|
| 87 | export declare function isMetadataSymbolicBinaryExpression(value: any): value is MetadataSymbolicBinaryExpression;
|
---|
| 88 | export interface MetadataSymbolicIndexExpression {
|
---|
| 89 | __symbolic: 'index';
|
---|
| 90 | expression: MetadataValue;
|
---|
| 91 | index: MetadataValue;
|
---|
| 92 | }
|
---|
| 93 | export declare function isMetadataSymbolicIndexExpression(value: any): value is MetadataSymbolicIndexExpression;
|
---|
| 94 | export interface MetadataSymbolicCallExpression {
|
---|
| 95 | __symbolic: 'call' | 'new';
|
---|
| 96 | expression: MetadataValue;
|
---|
| 97 | arguments?: MetadataValue[];
|
---|
| 98 | }
|
---|
| 99 | export declare function isMetadataSymbolicCallExpression(value: any): value is MetadataSymbolicCallExpression;
|
---|
| 100 | export interface MetadataSymbolicPrefixExpression {
|
---|
| 101 | __symbolic: 'pre';
|
---|
| 102 | operator: '+' | '-' | '~' | '!';
|
---|
| 103 | operand: MetadataValue;
|
---|
| 104 | }
|
---|
| 105 | export declare function isMetadataSymbolicPrefixExpression(value: any): value is MetadataSymbolicPrefixExpression;
|
---|
| 106 | export interface MetadataSymbolicIfExpression {
|
---|
| 107 | __symbolic: 'if';
|
---|
| 108 | condition: MetadataValue;
|
---|
| 109 | thenExpression: MetadataValue;
|
---|
| 110 | elseExpression: MetadataValue;
|
---|
| 111 | }
|
---|
| 112 | export declare function isMetadataSymbolicIfExpression(value: any): value is MetadataSymbolicIfExpression;
|
---|
| 113 | export interface MetadataSourceLocationInfo {
|
---|
| 114 | /**
|
---|
| 115 | * The line number of the error in the .ts file the metadata was created for.
|
---|
| 116 | */
|
---|
| 117 | line?: number;
|
---|
| 118 | /**
|
---|
| 119 | * The number of utf8 code-units from the beginning of the file of the error.
|
---|
| 120 | */
|
---|
| 121 | character?: number;
|
---|
| 122 | }
|
---|
| 123 | export interface MetadataGlobalReferenceExpression extends MetadataSourceLocationInfo {
|
---|
| 124 | __symbolic: 'reference';
|
---|
| 125 | name: string;
|
---|
| 126 | arguments?: MetadataValue[];
|
---|
| 127 | }
|
---|
| 128 | export declare function isMetadataGlobalReferenceExpression(value: any): value is MetadataGlobalReferenceExpression;
|
---|
| 129 | export interface MetadataModuleReferenceExpression extends MetadataSourceLocationInfo {
|
---|
| 130 | __symbolic: 'reference';
|
---|
| 131 | module: string;
|
---|
| 132 | }
|
---|
| 133 | export declare function isMetadataModuleReferenceExpression(value: any): value is MetadataModuleReferenceExpression;
|
---|
| 134 | export interface MetadataImportedSymbolReferenceExpression extends MetadataSourceLocationInfo {
|
---|
| 135 | __symbolic: 'reference';
|
---|
| 136 | module: string;
|
---|
| 137 | name: string;
|
---|
| 138 | arguments?: MetadataValue[];
|
---|
| 139 | }
|
---|
| 140 | export declare function isMetadataImportedSymbolReferenceExpression(value: any): value is MetadataImportedSymbolReferenceExpression;
|
---|
| 141 | export interface MetadataImportedDefaultReferenceExpression extends MetadataSourceLocationInfo {
|
---|
| 142 | __symbolic: 'reference';
|
---|
| 143 | module: string;
|
---|
| 144 | default: boolean;
|
---|
| 145 | arguments?: MetadataValue[];
|
---|
| 146 | }
|
---|
| 147 | export declare function isMetadataImportDefaultReference(value: any): value is MetadataImportedDefaultReferenceExpression;
|
---|
| 148 | export declare type MetadataSymbolicReferenceExpression = MetadataGlobalReferenceExpression | MetadataModuleReferenceExpression | MetadataImportedSymbolReferenceExpression | MetadataImportedDefaultReferenceExpression;
|
---|
| 149 | export declare function isMetadataSymbolicReferenceExpression(value: any): value is MetadataSymbolicReferenceExpression;
|
---|
| 150 | export interface MetadataSymbolicSelectExpression {
|
---|
| 151 | __symbolic: 'select';
|
---|
| 152 | expression: MetadataValue;
|
---|
| 153 | member: string;
|
---|
| 154 | }
|
---|
| 155 | export declare function isMetadataSymbolicSelectExpression(value: any): value is MetadataSymbolicSelectExpression;
|
---|
| 156 | export interface MetadataSymbolicSpreadExpression {
|
---|
| 157 | __symbolic: 'spread';
|
---|
| 158 | expression: MetadataValue;
|
---|
| 159 | }
|
---|
| 160 | export declare function isMetadataSymbolicSpreadExpression(value: any): value is MetadataSymbolicSpreadExpression;
|
---|
| 161 | export interface MetadataError extends MetadataSourceLocationInfo {
|
---|
| 162 | __symbolic: 'error';
|
---|
| 163 | /**
|
---|
| 164 | * This message should be short and relatively discriptive and should be fixed once it is created.
|
---|
| 165 | * If the reader doesn't recognize the message, it will display the message unmodified. If the
|
---|
| 166 | * reader recognizes the error message is it free to use substitute message the is more
|
---|
| 167 | * descriptive and/or localized.
|
---|
| 168 | */
|
---|
| 169 | message: string;
|
---|
| 170 | /**
|
---|
| 171 | * The module of the error (only used in bundled metadata)
|
---|
| 172 | */
|
---|
| 173 | module?: string;
|
---|
| 174 | /**
|
---|
| 175 | * Context information that can be used to generate a more descriptive error message. The content
|
---|
| 176 | * of the context is dependent on the error message.
|
---|
| 177 | */
|
---|
| 178 | context?: {
|
---|
| 179 | [name: string]: string;
|
---|
| 180 | };
|
---|
| 181 | }
|
---|
| 182 | export declare function isMetadataError(value: any): value is MetadataError;
|
---|