Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

How to $ExpectType against an imported value? #114

Open
JoshuaKGoldberg opened this issue Apr 4, 2018 · 1 comment
Open

How to $ExpectType against an imported value? #114

JoshuaKGoldberg opened this issue Apr 4, 2018 · 1 comment

Comments

@JoshuaKGoldberg
Copy link

import { Browser } from "puppeteer";

// $ExpectType Browser
browser;

Feels like this should be documented.

@thw0rted
Copy link

See #57. I haven't used this syntax extensively but it surprised me as well. I expected it to work like expectType from tsd, where the token you're passing as the expectation exists in "type space", so that you can write import type { Foo as Bar } from "baz"; expectType<Bar>(f());. You can't do that, it just looks at the name TS assigns to the type, as a string.

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

No branches or pull requests

2 participants