Skip to content
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

Best Practies #23

Open
basarat opened this issue Jul 12, 2014 · 3 comments
Open

Best Practies #23

basarat opened this issue Jul 12, 2014 · 3 comments

Comments

@basarat
Copy link
Member

basarat commented Jul 12, 2014

Another one

Prefer func() style function declarations on interfaces instead of func:Function as they allow overriding i.e. DO

interface Foo{
    take():number;
    take(num:number):void;
}

instead of

interface Foo {
    take: () => number;
    // No way to define this now, 
    take(num: number): void; // Error : duplicate identifier
}
@vvakame
Copy link
Member

vvakame commented Jul 30, 2014

How to debug .d.ts. (Type annotation is being used as intended.)

If you write .d.ts(callee).
try write testcast(caller) without type annotations and compile with --noImplicitAny.

e.g. http://goo.gl/4A24hk

microsoft/TypeScript#305


https://twitter.com/vvakame/statuses/494322013809307650
https://twitter.com/vvakame/statuses/494322400322797569

@SynerG
Copy link

SynerG commented Nov 5, 2015

The Best Practices guide (repo file: /src/documents/guides/best-practices.html.md.eco) states at the beginning:

"As much as it hurts to say it, TypeScript v1.0 is not flawless. There are certain minor flaws / shortcomings in the language which have implicatations for how typings are created. Here we will detail those limitations, how they can be worked around at present"

As TypeScript is currently at v1.6.2, the guide should probably be updated. I wonder if the flaws presented in the guide are still present.

Please, fix also the typo in the title of the issue to be able to find it using the search engine.

@Engid
Copy link

Engid commented Jul 6, 2018

Typescript is up to 2.9 now, so the page is definitely out of date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants