Skip to content

Fix typings for SFCDescriptor and SFCCustomBlock #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ interface ParseOptions {
}

interface SFCDescriptor {
template?: SFCBlock
script?: SFCBlock
template: SFCBlock | null
script: SFCBlock | null
styles: SFCBlock[]
customBlocks: SFCCustomBlock[]
}

interface SFCCustomBlock {
type: string
content: string
attrs: { [key: string]: string }
attrs: { [key: string]: string | true }
start: number
end: number
map: RawSourceMap
map?: RawSourceMap
}

interface SFCBlock extends SFCCustomBlock {
Expand Down
8 changes: 4 additions & 4 deletions lib/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export interface ParseOptions {
export interface SFCCustomBlock {
type: string
content: string
attrs: { [key: string]: string }
attrs: { [key: string]: string | true }
start: number
end: number
map: RawSourceMap
map?: RawSourceMap
}

export interface SFCBlock extends SFCCustomBlock {
Expand All @@ -37,8 +37,8 @@ export interface SFCBlock extends SFCCustomBlock {
}

export interface SFCDescriptor {
template?: SFCBlock
script?: SFCBlock
template: SFCBlock | null
script: SFCBlock | null
styles: SFCBlock[]
customBlocks: SFCCustomBlock[]
}
Expand Down