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

# Typescript: Annotations

> CDKTN Core API Reference for Annotations in Typescript.

Includes API for attaching annotations such as warning messages to constructs.

## Methods <a name="Methods" id="Methods" />

| **Name**                                                            | **Description**                                                      |
| ------------------------------------------------------------------- | -------------------------------------------------------------------- |
| <code><a href="#cdktn.Annotations.addError">addError</a></code>     | Adds an \{ "error": \< message > } metadata entry to this construct. |
| <code><a href="#cdktn.Annotations.addInfo">addInfo</a></code>       | Adds an info metadata entry to this construct.                       |
| <code><a href="#cdktn.Annotations.addWarning">addWarning</a></code> | Adds a warning metadata entry to this construct.                     |

***

### `addError` <a name="addError" id="cdktn.Annotations.addError" />

```typescript theme={null}
public addError(message: string): void
```

Adds an \{ "error": \< message > } metadata entry to this construct.

The toolkit will fail synthesis when errors are reported.

#### `message`<sup>Required</sup> <a name="message" id="cdktn.Annotations.addError.parameter.message" />

* *Type:* string

The error message.

***

### `addInfo` <a name="addInfo" id="cdktn.Annotations.addInfo" />

```typescript theme={null}
public addInfo(message: string): void
```

Adds an info metadata entry to this construct.

The CLI will display the info message when apps are synthesized.

#### `message`<sup>Required</sup> <a name="message" id="cdktn.Annotations.addInfo.parameter.message" />

* *Type:* string

The info message.

***

### `addWarning` <a name="addWarning" id="cdktn.Annotations.addWarning" />

```typescript theme={null}
public addWarning(message: string): void
```

Adds a warning metadata entry to this construct.

The CLI will display the warning when an app is synthesized.
In a future release the CLI might introduce a --strict flag which
will then fail the synthesis if it encounters a warning.

#### `message`<sup>Required</sup> <a name="message" id="cdktn.Annotations.addWarning.parameter.message" />

* *Type:* string

The warning message.

***

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                            | **Description**                                    |
| --------------------------------------------------- | -------------------------------------------------- |
| <code><a href="#cdktn.Annotations.of">of</a></code> | Returns the annotations API for a construct scope. |

***

### `of` <a name="of" id="cdktn.Annotations.of" />

```typescript theme={null}
import { Annotations } from 'cdktn'

Annotations.of(scope: IConstruct)
```

Returns the annotations API for a construct scope.

#### `scope`<sup>Required</sup> <a name="scope" id="cdktn.Annotations.of.parameter.scope" />

* *Type:* constructs.IConstruct

The scope.

***
