> For the complete documentation index, see [llms.txt](https://yamoo9.gitbook.io/typescript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yamoo9.gitbook.io/typescript/decorator.md).

# 데코레이터

데코레이터(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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://yamoo9.gitbook.io/typescript/decorator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
