UNPKG

873 BTypeScriptView Raw
1import { ResourceLoader } from '@angular/compiler';
2/**
3 * Provides interface for a resource loader/resolver.
4 * It is responsible for getting resources from some source.
5 * A typical implementation of this interface will get files from the hard drive.
6 *
7 * @export
8 * @interface ResourceResolver
9 * @extends {ResourceLoader}
10 */
11export interface ResourceResolver extends ResourceLoader {
12 /**
13 * Gets the resource asynchronously.
14 *
15 * @param {*} url
16 * @returns {Promise<string>}
17 *
18 * @memberOf ResourceResolver
19 */
20 get(url: any): Promise<string>;
21 /**
22 * Returns the resource synchronously. This could be either
23 * synchronous read of data from the hard drive, a sync XHR, etc.
24 *
25 * @param {string} url
26 * @returns {string}
27 *
28 * @memberOf ResourceResolver
29 */
30 getSync(url: string): string;
31}