e6d3291a4c037b2a4742f56a36aee7ee7eb6460f058f9937492bd0a94d098bb215f5b81bb498218e16c76596cd4b9f62b0471d0ca84a3d409ad069f2bad2e7 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { SFCDescriptor } from './parse'
  2. export interface StartOfSourceMap {
  3. file?: string
  4. sourceRoot?: string
  5. }
  6. export interface RawSourceMap extends StartOfSourceMap {
  7. version: string
  8. sources: string[]
  9. names: string[]
  10. sourcesContent?: string[]
  11. mappings: string
  12. }
  13. export interface VueTemplateCompiler {
  14. parseComponent(source: string, options?: any): SFCDescriptor
  15. compile(
  16. template: string,
  17. options: VueTemplateCompilerOptions
  18. ): VueTemplateCompilerResults
  19. ssrCompile(
  20. template: string,
  21. options: VueTemplateCompilerOptions
  22. ): VueTemplateCompilerResults
  23. }
  24. // we'll just shim this much for now - in the future these types
  25. // should come from vue-template-compiler directly, or this package should be
  26. // part of the vue monorepo.
  27. export interface VueTemplateCompilerOptions {
  28. modules?: Object[]
  29. outputSourceRange?: boolean
  30. whitespace?: 'preserve' | 'condense'
  31. directives?: { [key: string]: Function }
  32. }
  33. export interface VueTemplateCompilerParseOptions {
  34. pad?: 'line' | 'space'
  35. }
  36. export interface ErrorWithRange {
  37. msg: string
  38. start: number
  39. end: number
  40. }
  41. export interface VueTemplateCompilerResults {
  42. ast: Object | undefined
  43. render: string
  44. staticRenderFns: string[]
  45. errors: (string | ErrorWithRange)[]
  46. tips: (string | ErrorWithRange)[]
  47. }