# Constructor

## `Wrapper()`

Creates a new [`Wrapper`](/wrapper/overview.md) instance with the [`opening`](#opening-opening) and [`closing`](#closing-closing) chars and optional [`text`](#text-text).

{% code title="wrapper.class.ts" %}

```typescript
constructor(opening: Opening, closing: Closing, text: Text = '' as Text) {
  super(opening, closing, text);
}
```

{% endcode %}

### Parameters

#### `opening:`[<mark style="color:green;">`Opening`</mark>](/wrapper/generic-type-variables.md#wrap-opening)

The **opening** chars of a generic type variable [`Opening`](/wrapper/generic-type-variables.md#wrap-opening) placed before the given [`text`](#text-text).

#### `closing:`[<mark style="color:green;">`Closing`</mark>](/wrapper/generic-type-variables.md#closingextendsstring-string)

The **closing** chars of a generic type variable [`Closing`](/wrapper/generic-type-variables.md#wrap-closing) placed after the given [`text`](#text-text).

#### `text:`[<mark style="color:green;">`Text`</mark>](https://wrapper.angular-package.dev/wrapper/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than)

Optional **text** of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than) to wrap by given [`opening`](#opening-opening) and [`closing`](#closing-closing) chars.

### Returns

The **return value** is a new instance of [`Wrapper`](/wrapper/overview.md).

## Example usage

```typescript
// Example usage.
import { Wrapper } from '@angular-package/wrapper';

// Returns Wrapper {'{{}}'} of type Wrapper<"{{", "", "}}">
new Wrapper(`{{`, `}}`);

// Returns Wrapper {'{{variable}}'} of type Wrapper<"{{", "variable", "}}">
new Wrapper(`{{`, `}}`, 'variable');

// Returns Wrapper {'nullnull'} of typr Wrapper<any, "", any>
new Wrapper(null as any, null as any);
```


---

# 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://wrapper.angular-package.dev/wrapper/constructor.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.
