types: fix error inference for public compile method

This commit is contained in:
Evan You 2019-10-09 11:30:56 -04:00
parent f97d6e7d63
commit b255f42ab3

View File

@ -1,8 +1,8 @@
import { import {
ErrorCodes, ErrorCodes,
CoreCompilerError,
createCompilerError, createCompilerError,
defaultOnError defaultOnError,
CompilerError
} from './errors' } from './errors'
import { import {
assert, assert,
@ -38,7 +38,7 @@ export interface ParserOptions {
// The full set is https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references // The full set is https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references
namedCharacterReferences?: { [name: string]: string | undefined } namedCharacterReferences?: { [name: string]: string | undefined }
onError?: (error: CoreCompilerError) => void onError?: (error: CompilerError) => void
} }
export const defaultParserOptions: Required<ParserOptions> = { export const defaultParserOptions: Required<ParserOptions> = {