# TypeScriptSymbolParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/backend/typescript-symbol.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/backend/typescript-symbol.parser.ts#L41)

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(_config: ParserConfig)` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |
| `version` | `any` |
| `supportedPatterns` | `any` |

## Where it refuses work

- `TypeScriptSymbolParser` stops the work with an early return when `!/\.(tsx?|mjs|cjs|js)$/.test(filePath)`.
- `TypeScriptSymbolParser` stops the work with an early return when `/\.(d|spec|test|stories)\.(tsx?|mjs|cjs|js)$/.test(filePath)`.
- `TypeScriptSymbolParser` stops the work with an early return when `/\.min\.js$/.test(filePath)`.
- `TypeScriptSymbolParser` stops the work with an early return when `/(^|\/)(__tests__|__mocks__|node_modules|dist|build|coverage|vendor)\//.test(filePath)`.
- `TypeScriptSymbolParser` stops the work with an early return when `!fileContent.trim()`.
- `TypeScriptSymbolParser` stops the work with an early return when `!this.isExported(stmt) && !cjsEligible`.

## When something fails

- `TypeScriptSymbolParser` handles failure in 2 places: it logs it and continues in 1, and turns it into a return value in 1.
