We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was trying to write a proper type for our compile function (once it becomes async):
async
export function compile<T extends CompileOptions>(src: string, options?: T): Promise< if T extends { ast: true } CivetAST else if T extends { sourceMap: true } code: string sourceMap: SourceMap else string >
The current compilation has multiple bugs:
export function compile<T extends CompileOptions>(src: string, options?: T): Promise< (T extends { ast: true }? CivetAST : (T extends { sourceMap: true }? {code: string}:never)), {sourceMap: SourceMap}, else, string >
It's missing two close parentheses, and it says else, instead of the second :.
else,
:
Also, it would be nice to be able to write else if here.
else if
Related, it's not possible to have a newline after : in a ?: type:
?:
type CompileOutput<T extends CompileOptions> = T extends { ast: true } ? CivetAST : T extends { sourceMap: true } ? { code: string, sourceMap: SourceMap, } : string
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was trying to write a proper type for our compile function (once it becomes
async
):The current compilation has multiple bugs:
It's missing two close parentheses, and it says
else,
instead of the second:
.Also, it would be nice to be able to write
else if
here.Related, it's not possible to have a newline after
:
in a?:
type:The text was updated successfully, but these errors were encountered: