> ## Documentation Index
> Fetch the complete documentation index at: https://forest-chore-open-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Autocompletion

> Enable TypeScript autocompletion and type safety for your Forest Node.js back-end

<Info>
  **Node.js only** - This page covers TypeScript autocompletion setup for the Node.js agent. For information about Forest data types, see [Data Types](/get-started/connect/data-types).
</Info>

The Forest Node.js back-end, built entirely in TypeScript, provides comprehensive autocompletion capabilities for collection names, field names, and handler parameters.

## Generating a Typing File

The back-end can generate a typing file based on your data models. This file is auto-generated and should not be manually edited.

### Configuration Options

Two configuration options control typing file generation:

* **`typingsPath`**: Specifies the location where the typing file will be created
* **`typingsMaxDepth`**: Controls the maximum introspection depth for relationships

## TypeScript Usage

In TypeScript projects, import and template the generated schema:

```typescript theme={null}
import { createAgent } from '@forestadmin/agent';
import { Schema } from './typings';
import transactions from './customization/transactions';

await createAgent<Schema>({
  // ...
  typingsPath: './typings.ts',
  typingsMaxDepth: 5,
})
  .customizeCollection('transactions', transactions)
  .mountOnStandaloneServer(3000)
  .start();
```

The `customizeCollection` method and handler parameters receive strong typing through the Schema template.

## JavaScript Usage

JavaScript developers can leverage JSDoc syntax to maintain autocomplete capabilities:

### Main Back-end File

```javascript theme={null}
const { createAgent } = require('@forestadmin/agent');

/**
 * @typedef {import('@forestadmin/agent').Agent} Agent
 * @typedef {import('../typings').Schema} Schema
 */

/**
 * @type {Agent<Schema>}
 */
const agent = createAgent({
  typingsPath: './typings.ts',
  typingsMaxDepth: 5,
});
```

### Customization Files

In separate customization files, JSDoc type annotations preserve autocompletion:

```javascript theme={null}
/**
 * @param {CollectionCustomizer<Schema, 'transactions'>} transactions
 */
module.exports = transactions => {
  transactions.removeField('amountInEur');
};
```
