index.d.ts 954 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. declare namespace ImportResolver {
  2. interface AliasItem {
  3. alias: string;
  4. name: string;
  5. onlyModule?: boolean;
  6. }
  7. interface Dictionary<T> {
  8. [key: string]: T;
  9. }
  10. interface Plugin {
  11. apply(...args: any[]): void;
  12. }
  13. interface ResolverOption {
  14. alias?: AliasItem[] | Dictionary<string>;
  15. aliasFields?: string[];
  16. cachePredicate?: (val: Object) => boolean;
  17. descriptionFiles?: string[];
  18. enforceExtension?: boolean;
  19. enforceModuleExtension?: boolean;
  20. extensions?: string[];
  21. fileSystem?: Object;
  22. mainFields?: string[];
  23. mainFiles?: string[];
  24. moduleExtensions?: string[];
  25. modules?: string[];
  26. plugins?: Plugin[];
  27. resolver?: Object;
  28. resolveToContext?: boolean;
  29. symlinks?: string[] | boolean;
  30. unsafeCache?: boolean | Dictionary<any>;
  31. useSyncFileSystemCalls?: boolean;
  32. }
  33. }
  34. declare function resolver(config: ImportResolver.ResolverOption): Function
  35. export = resolver