helpers.d.ts 4.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { BuildError } from './errors';
  2. import { BuildContext, DeepLinkConfigEntry, WebpackStats, SemverVersion } from './interfaces';
  3. export declare function getAppScriptsPackageJson(): any;
  4. export declare function getAppScriptsVersion(): string;
  5. export declare function getSystemText(userRootDir: string): string[];
  6. export declare function getSystemData(userRootDir: string): {
  7. ionicAppScripts: string;
  8. ionicFramework: string;
  9. ionicNative: string;
  10. angularCore: string;
  11. angularCompilerCli: string;
  12. node: string;
  13. osName: any;
  14. };
  15. export declare function splitLineBreaks(sourceText: string): string[];
  16. export declare const objectAssign: {
  17. <T, U>(target: T, source: U): T & U;
  18. <T, U, V>(target: T, source1: U, source2: V): T & U & V;
  19. <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
  20. (target: object, ...sources: any[]): any;
  21. };
  22. export declare function titleCase(str: string): string;
  23. export declare function writeFileAsync(filePath: string, content: string): Promise<{}>;
  24. export declare function readFileAsync(filePath: string): Promise<string>;
  25. export declare function readJsonAsync(filePath: string): Promise<any>;
  26. export declare function readAndCacheFile(filePath: string, purge?: boolean): Promise<string>;
  27. export declare function unlinkAsync(filePath: string | string[]): Promise<any>;
  28. export declare function rimRafAsync(directoryPath: string): Promise<void>;
  29. export declare function copyFileAsync(srcPath: string, destPath: string): Promise<void>;
  30. export declare function mkDirpAsync(directoryPath: string): Promise<{}>;
  31. export declare function readDirAsync(pathToDir: string): Promise<string[]>;
  32. export declare function setContext(context: BuildContext): void;
  33. export declare function getContext(): BuildContext;
  34. export declare function setParsedDeepLinkConfig(map: Map<string, DeepLinkConfigEntry>): void;
  35. export declare function getParsedDeepLinkConfig(): Map<string, DeepLinkConfigEntry>;
  36. export declare function transformSrcPathToTmpPath(originalPath: string, context: BuildContext): string;
  37. export declare function transformTmpPathToSrcPath(originalPath: string, context: BuildContext): string;
  38. export declare function changeExtension(filePath: string, newExtension: string): string;
  39. export declare function escapeHtml(unsafe: string): string;
  40. export declare function escapeStringForRegex(input: string): string;
  41. export declare function rangeReplace(source: string, startIndex: number, endIndex: number, newContent: string): string;
  42. export declare function stringSplice(source: string, startIndex: number, numToDelete: number, newContent: string): string;
  43. export declare function toUnixPath(filePath: string): string;
  44. export declare function generateRandomHexString(numCharacters: number): string;
  45. export declare function getStringPropertyValue(propertyName: string): string;
  46. export declare function getIntPropertyValue(propertyName: string): number;
  47. export declare function getBooleanPropertyValue(propertyName: string): boolean;
  48. export declare function convertFilePathToNgFactoryPath(filePath: string): string;
  49. export declare function printDependencyMap(map: Map<string, Set<string>>): void;
  50. export declare function webpackStatsToDependencyMap(context: BuildContext, stats: any): Map<string, Set<string>>;
  51. export declare function processStatsImpl(webpackStats: WebpackStats): Map<string, Set<string>>;
  52. export declare function purgeWebpackPrefixFromPath(filePath: string): string;
  53. export declare function replaceAll(input: string, toReplace: string, replacement: string): string;
  54. export declare function ensureSuffix(input: string, suffix: string): string;
  55. export declare function removeSuffix(input: string, suffix: string): string;
  56. export declare function buildErrorToJson(buildError: BuildError): {
  57. message: string;
  58. name: string;
  59. stack: string;
  60. hasBeenLogged: boolean;
  61. isFatal: boolean;
  62. };
  63. export declare function jsonToBuildError(nonTypedBuildError: any): BuildError;
  64. export declare function upperCaseFirst(input: string): string;
  65. export declare function sentenceCase(input: string): string;
  66. export declare function snakeCase(input: string): string;
  67. export declare function constantCase(input: string): string;
  68. export declare function camelCase(input: string): string;
  69. export declare function paramCase(input: string): string;
  70. export declare function pascalCase(input: string): string;
  71. export declare function removeCaseFromString(input: string, inReplacement?: string): string;
  72. export declare function semverStringToObject(semverString: string): SemverVersion;