Skip to content

Commit bb09115

Browse files
yprestoznck
authored andcommitted
fix: Typings for SFCDescriptor and SFCCustomBlock (#29)
1 parent ada52c6 commit bb09115

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ interface ParseOptions {
3131
}
3232

3333
interface SFCDescriptor {
34-
template?: SFCBlock
35-
script?: SFCBlock
34+
template: SFCBlock | null
35+
script: SFCBlock | null
3636
styles: SFCBlock[]
3737
customBlocks: SFCCustomBlock[]
3838
}
3939

4040
interface SFCCustomBlock {
4141
type: string
4242
content: string
43-
attrs: { [key: string]: string }
43+
attrs: { [key: string]: string | true }
4444
start: number
4545
end: number
46-
map: RawSourceMap
46+
map?: RawSourceMap
4747
}
4848

4949
interface SFCBlock extends SFCCustomBlock {

lib/parse.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export interface ParseOptions {
2323
export interface SFCCustomBlock {
2424
type: string
2525
content: string
26-
attrs: { [key: string]: string }
26+
attrs: { [key: string]: string | true }
2727
start: number
2828
end: number
29-
map: RawSourceMap
29+
map?: RawSourceMap
3030
}
3131

3232
export interface SFCBlock extends SFCCustomBlock {
@@ -37,8 +37,8 @@ export interface SFCBlock extends SFCCustomBlock {
3737
}
3838

3939
export interface SFCDescriptor {
40-
template?: SFCBlock
41-
script?: SFCBlock
40+
template: SFCBlock | null
41+
script: SFCBlock | null
4242
styles: SFCBlock[]
4343
customBlocks: SFCCustomBlock[]
4444
}

0 commit comments

Comments
 (0)