Skip to content

console.trace definition is invalid in /lib/lib.dom.d.ts #5433

Closed

Description

console.trace(a,b,c,1,2,3) emits compilation error:

error TS2346: Supplied parameters do not match any signature of call target.

So, let's open the declaraion in /lib/lib.dom.d.ts:

interface Console {
    log(message?: any, ...optionalParams: any[]): void;
//  ......................
    trace(): void;
}

arguments should be the same as in log(message?: any, ...optionalParams: any[])

Activity

  1. mhegazy commented on Oct 28, 2015

    @mhegazy
    Contributor

    Ivan Pesochenko (@wallride) for now you can reopen the interface locally and define the missing signature as such:

    interface Console {
        trace(...args: any[]): void;
    }
  2. wallride commented on Oct 29, 2015

    @wallride
    Author

    Mohamed Hegazy (@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.
    Anyway, i supposed this issue would be useful for the typescript project.

  3. mhegazy commented on Oct 29, 2015

    @mhegazy
    Contributor

    just out of curiosity, what are the errors you were getting from gulp?

  4. wallride commented on Oct 29, 2015

    @wallride
    Author

    Mohamed Hegazy (@mhegazy) , oh just the same as i've written above.
    Although i've optioned gulp-typescript to use TS from require('typescript'). And i've searched-and-replaced every d.ts file around typescript modules. Have no idea why it's still not satisfied. but errors don't block building process. so i move on.

  5. mhegazy commented on Oct 29, 2015

    @mhegazy
    Contributor

    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

  6. wallride commented on Oct 30, 2015

    @wallride
    Author

    Mohamed Hegazy (@mhegazy) Yes, that is a some kind of solution. Thanks!
    And declaration in lib.d.ts should be fixed anyway, i suppose :)

  7. mhegazy commented on Oct 30, 2015

    @mhegazy
    Contributor

    yup. the bug is open, should be fixed in TS1.8, but until then, no need to keep getting errors in your compilation.

  8. mhegazy commented on Dec 8, 2015

    @mhegazy
    Contributor

    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

  9. modified the milestones: , TypeScript 1.8 on Dec 8, 2015
  10. modified the milestones: TypeScript 1.8, on Jan 20, 2016
  11. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions