-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
console.trace definition is invalid in /lib/lib.dom.d.ts #5433
Comments
@wallride for now you can reopen the interface locally and define the missing signature as such: interface Console {
trace(...args: any[]): void;
} |
@mhegazy, thanks for your reply! It was the first thing i've done. :) But transpiling via gulp-typescript still throws warnings. Though i've fixed every interface i could find. |
just out of curiosity, what are the errors you were getting from gulp? |
@mhegazy , oh just the same as i've written above. |
but you do not need to replace the definition in lib.d.ts, you can just augment it. so in one of your files, just add the new definition.. here is what i mean in the playground: http://www.typescriptlang.org/Playground#src=interface%20Console%20%7B%0D%0A%20%20%20%20trace(...args%3A%20any%5B%5D)%3A%20void%3B%0D%0A%7D%0D%0A%0D%0Aconsole.trace(%22message%22)%3B%20%2F%2F%20OK%0D%0A |
@mhegazy Yes, that is a some kind of solution. Thanks! |
yup. the bug is open, should be fixed in TS1.8, but until then, no need to keep getting errors in your compilation. |
PRs are welcomed. here is some documentation for adding new types to lib.d.ts: https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes |
console.trace(a,b,c,1,2,3)
emits compilation error:So, let's open the declaraion in /lib/lib.dom.d.ts:
arguments should be the same as in
log(message?: any, ...optionalParams: any[])
The text was updated successfully, but these errors were encountered: