index.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //#region types.d.ts
  2. interface PackageManifest {
  3. name: string;
  4. display: string;
  5. addon?: boolean;
  6. author?: string;
  7. description?: string;
  8. external?: string[];
  9. globals?: Record<string, string>;
  10. manualImport?: boolean;
  11. deprecated?: boolean;
  12. submodules?: boolean;
  13. build?: boolean;
  14. iife?: boolean;
  15. mjs?: boolean;
  16. dts?: boolean;
  17. target?: string;
  18. utils?: boolean;
  19. copy?: string[];
  20. manualEntryPoints?: true;
  21. }
  22. interface VueUseFunction {
  23. name: string;
  24. package: string;
  25. importPath?: string;
  26. lastUpdated?: number;
  27. category?: string;
  28. description?: string;
  29. docs?: string;
  30. deprecated?: boolean;
  31. internal?: boolean;
  32. component?: boolean;
  33. directive?: boolean;
  34. external?: string;
  35. alias?: string[];
  36. related?: string[];
  37. variants?: string[];
  38. utils?: string[];
  39. }
  40. interface VueUsePackage extends PackageManifest {
  41. dir: string;
  42. docs?: string;
  43. }
  44. interface PackageIndexes {
  45. packages: Record<string, VueUsePackage>;
  46. categories: string[];
  47. functions: VueUseFunction[];
  48. }
  49. interface CommitInfo {
  50. functions: string[];
  51. version?: string;
  52. hash: string;
  53. date: string;
  54. message: string;
  55. refs?: string;
  56. body?: string;
  57. author_name: string;
  58. author_email: string;
  59. }
  60. interface ContributorInfo {
  61. name: string;
  62. count: number;
  63. hash: string;
  64. }
  65. //#endregion
  66. //#region metadata.d.ts
  67. declare const metadata: PackageIndexes;
  68. declare const functions: PackageIndexes["functions"];
  69. declare const packages: PackageIndexes["packages"];
  70. declare const categories: PackageIndexes["categories"];
  71. declare const functionNames: string[];
  72. declare const categoryNames: string[];
  73. declare const coreCategoryNames: string[];
  74. declare const addonCategoryNames: string[];
  75. declare function getFunction(name: string): VueUseFunction | undefined;
  76. //#endregion
  77. //#region utils.d.ts
  78. declare function getCategories(functions: VueUseFunction[]): string[];
  79. declare function uniq<T extends any[]>(a: T): any[];
  80. //#endregion
  81. export { CommitInfo, ContributorInfo, PackageIndexes, PackageManifest, VueUseFunction, VueUsePackage, addonCategoryNames, categories, categoryNames, coreCategoryNames, functionNames, functions, getCategories, getFunction, metadata, packages, uniq };