2016-06-23 09:47:54 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
|
*/
|
|
|
|
|
|
2016-12-27 09:36:47 -08:00
|
|
|
import {StaticSymbol} from '../aot/static_symbol';
|
|
|
|
|
|
2016-01-06 14:13:44 -08:00
|
|
|
/**
|
2016-05-02 09:38:46 -07:00
|
|
|
* Interface that defines how import statements should be generated.
|
2016-01-06 14:13:44 -08:00
|
|
|
*/
|
2016-11-15 11:13:20 -08:00
|
|
|
export abstract class ImportResolver {
|
2016-11-18 08:40:41 -08:00
|
|
|
/**
|
|
|
|
|
* Converts a file path to a module name that can be used as an `import.
|
|
|
|
|
* I.e. `path/to/importedFile.ts` should be imported by `path/to/containingFile.ts`.
|
|
|
|
|
*/
|
2016-12-15 09:12:40 -08:00
|
|
|
abstract fileNameToModuleName(importedFilePath: string, containingFilePath: string): string
|
|
|
|
|
/*|null*/;
|
2016-12-27 09:36:47 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Converts the given StaticSymbol into another StaticSymbol that should be used
|
|
|
|
|
* to generate the import from.
|
|
|
|
|
*/
|
|
|
|
|
abstract getImportAs(symbol: StaticSymbol): StaticSymbol /*|null*/;
|
2017-01-30 15:32:08 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Determine the airty of a type.
|
|
|
|
|
*/
|
|
|
|
|
abstract getTypeArity(symbol: StaticSymbol): number /*|null*/;
|
2016-01-06 14:13:44 -08:00
|
|
|
}
|