1 | /**
|
2 | * @license
|
3 | * Copyright Google Inc. 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 | /**
|
9 | * Create a {@link UrlResolver} with no package prefix.
|
10 | */
|
11 | export declare function createUrlResolverWithoutPackagePrefix(): UrlResolver;
|
12 | export declare function createOfflineCompileUrlResolver(): UrlResolver;
|
13 | /**
|
14 | * Used by the {@link Compiler} when resolving HTML and CSS template URLs.
|
15 | *
|
16 | * This class can be overridden by the application developer to create custom behavior.
|
17 | *
|
18 | * See {@link Compiler}
|
19 | *
|
20 | * ## Example
|
21 | *
|
22 | * {@example compiler/ts/url_resolver/url_resolver.ts region='url_resolver'}
|
23 | *
|
24 | * @security When compiling templates at runtime, you must
|
25 | * ensure that the entire template comes from a trusted source.
|
26 | * Attacker-controlled data introduced by a template could expose your
|
27 | * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
|
28 | */
|
29 | export interface UrlResolver {
|
30 | resolve(baseUrl: string, url: string): string;
|
31 | }
|
32 | export interface UrlResolverCtor {
|
33 | new (packagePrefix?: string | null): UrlResolver;
|
34 | }
|
35 | export declare const UrlResolver: UrlResolverCtor;
|
36 | /**
|
37 | * Extract the scheme of a URL.
|
38 | */
|
39 | export declare function getUrlScheme(url: string): string;
|