# 데코레이터

데코레이터(Decorator)는 [**ECMAScript에 새롭게 제안된 기능**](https://github.com/tc39/proposal-decorators#decorators)이며, TypeScript의 실험적 기능으로 **클래스 선언과 멤버에 대한 주석(annotations)과 메타 프로그래밍 구문을 모두 추가 할 수있는 방법**을 제공합니다.

### 데코레이터 사용 설정 <a href="#setting" id="setting"></a>

데코레이터를 TypeScript에서 사용하려면 `tsconfig.json` 설정 `experimentalDecorators` 값을 `true`로 설정해야 합니다. 환경 설정 없이 데코레이터를 사용하려면 컴파일 과정에서 오류 메시지를 출력합니다.

{% code title="tsconfig.json" %}

```javascript
{
  "compilerOptions": {
  ...  
  "experimentalDecorators": true,
  ...
  }
}
```

{% endcode %}

{% hint style="warning" %}
데코레이터는 차후 릴리스 시, 변경 될 수있는 실험 기능입니다.
{% endhint %}

### 참고

{% embed url="<https://github.com/tc39/proposal-decorators#decorators>" %}
ECMAScript TC39 - 클래스 데코레이터 제안입니다.
{% endembed %}

{% embed url="<https://www.typescriptlang.org/docs/handbook/decorators.html>" %}
TypeScript 핸드북 - 데코레이터에 대한 사용법입니다.
{% endembed %}


---

# 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://yamoo9.gitbook.io/typescript/decorator.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.
