Skip to content

Commit 0626cad

Browse files
committed
types: 2.6 compiler error type change
1 parent 8de35e6 commit 0626cad

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

lib/compileTemplate.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { VueTemplateCompiler, VueTemplateCompilerOptions } from './types'
1+
import {
2+
VueTemplateCompiler,
3+
VueTemplateCompilerOptions,
4+
ErrorWithRange
5+
} from './types'
26

37
import assetUrlsModule, {
48
AssetURLOptions
@@ -26,8 +30,8 @@ export interface TemplateCompileOptions {
2630
export interface TemplateCompileResult {
2731
code: string
2832
source: string
29-
tips: string[]
30-
errors: string[]
33+
tips: (string | ErrorWithRange)[]
34+
errors: (string | ErrorWithRange)[]
3135
}
3236

3337
export function compileTemplate(

lib/types.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,23 @@ export interface VueTemplateCompiler {
3232
// part of the vue monorepo.
3333
export interface VueTemplateCompilerOptions {
3434
modules?: Object[]
35+
outputSourceRange?: boolean
3536
}
3637

3738
export interface VueTemplateCompilerParseOptions {
3839
pad?: 'line' | 'space'
3940
}
4041

42+
export interface ErrorWithRange {
43+
msg: string
44+
start: number
45+
end: number
46+
}
47+
4148
export interface VueTemplateCompilerResults {
4249
ast: Object | void
4350
render: string
4451
staticRenderFns: string[]
45-
errors: string[]
46-
tips: string[]
52+
errors: (string | ErrorWithRange)[]
53+
tips: (string | ErrorWithRange)[]
4754
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy