UNPKG

1.24 kBTypeScriptView Raw
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/transformers/inline_resources" />
9import * as ts from 'typescript';
10import { MetadataObject, MetadataValue } from '../metadata/index';
11import { MetadataTransformer, ValueTransform } from './metadata_cache';
12/** A subset of members from AotCompilerHost */
13export declare type ResourcesHost = {
14 resourceNameToFileName(resourceName: string, containingFileName: string): string | null;
15 loadResource(path: string): Promise<string> | string;
16};
17export declare type StaticResourceLoader = {
18 get(url: string | MetadataValue): string;
19};
20export declare class InlineResourcesMetadataTransformer implements MetadataTransformer {
21 private host;
22 constructor(host: ResourcesHost);
23 start(sourceFile: ts.SourceFile): ValueTransform | undefined;
24 updateDecoratorMetadata(loader: StaticResourceLoader, arg: MetadataObject): MetadataObject;
25}
26export declare function getInlineResourcesTransformFactory(program: ts.Program, host: ResourcesHost): ts.TransformerFactory<ts.SourceFile>;