# TS

This guide explains how to use ADSJS in projects with TS support.

{% hint style="info" %}
This library was designed strictly typed so you'll get many advantages when using it with TypeScript.
{% endhint %}

To add ADSJS into your project run the following command in terminal (from project directory):

```bash
npm install ads-js
```

Then give it a try in your source code:

```typescript
import { SinglyLinkedList } from 'ads-js';
// or
import { SinglyLinkedList } from 'ads-js/lists';

const list = new SinglyLinkedList([1, 2, 3]);
const position = list.getLast();

console.log(position.element);
```

{% hint style="warning" %}
Importing from `'ads-js'` may be redundant in case you tend to use limited functional of the ADSJS in your project. To reduce your build size consider importing from specific aliases instead, like `'ads-js/lists'`.
{% endhint %}

Visit [PUBLIC API](/adsjs/api/how-to-read.md) section to get further details about capabilities of this library.


---

# 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://alex-myznikov.gitbook.io/adsjs/getting-started/ts.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.
