# 3rd-party types

One can usually obtain types from 3rd party libraries through the following means:

* The library itself publishes `.d.ts` definitions along with the package, referencing it on the `typings` key of package.json;
* Someone publishes types for the library at the *DefinitelyTyped* repository, available through npm `@types/<lib>`;
* There are methods for manually declaring a 3rd party library's types inside the consumer project;

What if the library does not have types?

* The library will be imported as `any` but you can continue to use it as-is;
* If `noImplicitAny`is turned on, a `declare "library"` entry must be declared in a global file;

3rd party typescript types are also used to power JS type completion in VS Code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wkrueger.gitbook.io/typescript/3rd-party-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
