# Generic type variables

### `Range<`<mark style="color:green;background-color:green;">`Min`</mark>`,`<mark style="color:green;">`Max`</mark>`,`<mark style="color:green;">`Step`</mark>`>`

#### <mark style="color:green;">`Min`</mark>`extends`[<mark style="color:green;">`number`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#number)

​A generic type variable constrained by the [`number`](https://www.typescriptlang.org/docs/handbook/basic-types.html#number), by default of the value **captured** from the supplied [`min`](/range-1/range/constructor.md#min-min) indicates the minimum range type of a new [`Range`](/range-1/range/overview.md) instance.

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

```typescript
class Range<
  Min extends number, // <--- Declare generic type variable Min.
  Max extends number,
  Step extends number = 1
> {
  constructor(
    min: Min, // <--- Capture generic type variable Min.
    max: Max,
    value?: number,
    step: Step = 1 as Step
  ) { }
}
```

{% endcode %}

### `Range<`<mark style="color:green;">`Min`</mark>`,`<mark style="color:green;background-color:green;">`Max`</mark>`,`<mark style="color:green;">`Step`</mark>`>`

#### <mark style="color:green;">`Max`</mark>`extends`[<mark style="color:green;">`number`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#number)

A generic type variable constrained by the [`number`](https://www.typescriptlang.org/docs/handbook/basic-types.html#number), by default of the value **captured** from the supplied [`max`](/range-1/range/constructor.md#max-max) indicates the maximum range type of a new [`Range`](/range-1/range/overview.md) instance.

```typescript
class Range<
  Min extends number,
  Max extends number, // <--- Declare generic type variable Max.
  Step extends number = 1
> {
  constructor(
    min: Min,
    max: Max, // <--- Capture generic type variable Max.
    value?: number,
    step: Step = 1 as Step
  ) {}
}
```

### `Range<`<mark style="color:green;">`Min`</mark>`,`<mark style="color:green;">`Max`</mark>`,`<mark style="color:green;background-color:green;">`Step`</mark>`>`

#### <mark style="color:green;">`Step`</mark>`extends`[<mark style="color:green;">`number`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#number)`= 1`

A generic type variable constrained by the [`number`](https://www.typescriptlang.org/docs/handbook/basic-types.html#number), by default of the value equal to `1`, optionally **captured** from the supplied [`step`](/range-1/range/constructor.md#step-step) indicates the range step type of a new [`Range`](/range-1/range/overview.md) instance.

```typescript
class Range<
  Min extends number,
  Max extends number,
  Step extends number = 1 // <--- Declare generic type variable Step.
> {
  constructor(
    min: Min,
    max: Max,
    value?: number,
    step: Step = 1 as Step // <--- Capture generic type variable Step.
  ) { }
}
```


---

# 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://docs.angular-package.dev/range-1/range/generic-type-variables.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.
