版博士V2.0程序
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

30 líneas
1.2 KiB

  1. import { AttachedScope } from '@vue-macros/common';
  2. import { Node } from '@babel/types';
  3. import { HmrContext, ModuleNode } from 'vite';
  4. interface FileContextComponent {
  5. code: string;
  6. body: string;
  7. node: Node;
  8. scopes: string[];
  9. }
  10. interface FileContext {
  11. components: FileContextComponent[];
  12. imports: string[];
  13. }
  14. type SetupComponentContext = Record<string, FileContext>;
  15. declare function scanSetupComponent(code: string, id: string): FileContext | undefined;
  16. declare function transformSetupComponent(code: string, _id: string, ctx: SetupComponentContext): {
  17. code: string;
  18. map: any;
  19. } | undefined;
  20. declare function loadSetupComponent(virtualId: string, ctx: SetupComponentContext, root: string): string | undefined;
  21. declare function hotUpdateSetupComponent({ file, modules, read }: HmrContext, ctx: SetupComponentContext): Promise<ModuleNode[] | undefined>;
  22. declare function transformPost(code: string, _id: string): {
  23. code: string;
  24. map: any;
  25. } | undefined;
  26. declare function getScopeDecls(scope: AttachedScope | undefined): string[];
  27. export { SetupComponentContext as S, transformPost as a, getScopeDecls as g, hotUpdateSetupComponent as h, loadSetupComponent as l, scanSetupComponent as s, transformSetupComponent as t };