> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wyrly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript configuration

> Wyrly の標準デコレーターモデル向けに TypeScript を設定します。

Wyrly は TypeScript の標準デコレーター向けに設計されています。

`reflect-metadata`、`emitDecoratorMetadata`、parameter decorators は必要ありません。

## 推奨設定

TypeScript プロジェクトでは標準デコレーターを使います。

```json theme={null}
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "experimentalDecorators": false,
    "emitDecoratorMetadata": false,
    "strict": true
  }
}
```

正確な `module` と `moduleResolution` の値は runtime や build tool によって変わりますが、
legacy decorator metadata を有効にすることは避けてください。

## Deno

Deno 2.x をお使いの場合は JSR からインストールします。

```sh theme={null}
deno add jsr:@wyrly/core
```

その後、`@wyrly/core` から import します。

```ts theme={null}
import { createContainer, Injectable, token } from "@wyrly/core";
```

## Node.js and Bun

Node.js と Bun をお使いの場合は npm からインストールします。

```sh theme={null}
npm install @wyrly/core
```

可能な限り ESM を使います。

```json theme={null}
{
  "type": "module"
}
```

## reflect-metadata の設定は不要

これは追加しないでください。

```ts theme={null}
import "reflect-metadata";
```

Wyrly は実行時にパラメーターの型を読み取りません。依存関係はトークンと `deps` で明示的に宣言します。
