# Interfaces

| Title                                                            | Description                                         |
| ---------------------------------------------------------------- | --------------------------------------------------- |
| [Root](/docs/api/interfaces.md#root)                             | Inserts 'root' route into the note                  |
| [Spot](/docs/api/interfaces.md#spot)                             | Describes an enhanced route                         |
| [Note](/docs/api/interfaces.md#note)                             | Describes a route note                              |
| [Unit](/docs/api/interfaces.md#unit)                             | Describes a processed routes                        |
| [Units](/docs/api/interfaces.md#units)                           | Describes a bunch of units                          |
| [Connector](/docs/api/interfaces.md#connector)                   | Describes not connected (unprocessed) unit          |
| [Connectors](/docs/api/interfaces.md#connectors)                 | Describes a bunch of connectors                     |
| [privateNotesKey](/docs/api/interfaces.md#privatenoteskey)       | Describes a possible key value                      |
| [PrivateNotesKey](/docs/api/interfaces.md#privatenoteskey)       | Describes additional (optional) key prop            |
| [DefaultNameOptions](/docs/api/interfaces.md#defaultnameoptions) | Describes route name options (root and wildcard)    |
| [CreatorOptionArgs](/docs/api/interfaces.md#creatoroptionargs)   | Describes possible option args in creator functions |

## [Root](/docs/api/interfaces.md#root)

**Generic Type:**

```typescript
<C = {}>
```

| Keys | Type                          | Optional |
| ---- | ----------------------------- | -------- |
| root | RootNote (internal interface) | +        |

Declares a type which describes default`root` route

**Usage example:**

```typescript
export interface AboutNotes extends Root {
    person: Note;
}

// or if there is only one 'root' path

export type AboutNotes = Root;
```

## �[Spot](/docs/api/interfaces.md#spot)

| **K**eys | Type      | Optional |
| -------- | --------- | -------- |
| id       | number    |          |
| parentId | number    |          |
| state    | string\[] |          |
| name     | string    |          |
| path     | string    |          |

## [Note](/docs/api/interfaces.md#note)

**Generic Type:**

```typescript
<C = {}>
```

| Keys     | Type                                       | Optional |
| -------- | ------------------------------------------ | -------- |
| path     | string                                     |          |
| name     | string                                     | +        |
| children | [Notes](/docs/api/interfaces.md#notes)\<C> | +        |

**Usage example:**

```typescript
export interface AppNotes {
    root: Note<ChildNotes>
    location: Note;
};
```

## [Unit](/docs/api/interfaces.md#unit)

**Generic Type:**

```typescript
<R = any, C = {}>
```

| Keys                 | Type                                                                                                | Optional |
| -------------------- | --------------------------------------------------------------------------------------------------- | -------- |
| key in keyof (R & C) | [Spot](/docs/api/interfaces.md#spot) & [PrivateNotesKey](/docs/api/interfaces.md#privatenoteskey-1) |          |

**Usage example:**

```typescript
export const appUnit: Unit<AppNotes, AppChildNotes> = 
    createRoot<AppNotes, AppChildNotes>(routes);
```

## �[Units](/docs/api/interfaces.md#units)

**Generic Type:**

```typescript
<R = any>
```

| Keys           | Type                                           | Optional |
| -------------- | ---------------------------------------------- | -------- |
| key in keyof R | [Unit](/docs/api/interfaces.md#unit)\<R\[key]> |          |

**Usage example:**

```typescript
export interface Hub {
  app: AppNotes & AppChildNotes;
  about: AboutNotes;
}

export const hub: Units<Hub> = getRegisteredUnits<Hub>();
```

## [Connector](/docs/api/interfaces.md#connector)

**Generic Type:**

```typescript
<R = any, C = any>
```

**Type:**

```typescript
(
  parentStructure: Structure,
  alternativeName?: string
) => Unit<R, C>;
```

**Usage example:**

```typescript
export const aboutConnector: Connector<AboutNotes, AboutChildNotes> = 
    createFeature<AboutNotes, AboutChildNotes>(aboutRoutes);
```

## [Connectors](/docs/api/interfaces.md#connectors)

**Generic Type:**

```typescript
<R = any>
```

| Keys           | Type                                                     | Optional |
| -------------- | -------------------------------------------------------- | -------- |
| key in keyof R | [Connector](/docs/api/interfaces.md#connector)\<R\[key]> |          |

**Usage example:**

```typescript
createRoot(appRoutes, { 
  /**
  * nearby prop accepts connectors
  */
  nearby: {
    location: locationConnector
  }
});
```

## [privateNotesKey](/docs/api/interfaces.md#privatenoteskey)

describes the private key value

**Type:**

```typescript
string | symbol;
```

## [PrivateNotesKey](/docs/api/interfaces.md#privatenoteskey)

extends interfaces by private key property

| Keys  | Type            | Optional |
| ----- | --------------- | -------- |
| \_key | privateNotesKey |          |

## [DefaultNameOptions](/docs/api/interfaces.md#defaultrouteoptions)

provides an opportunity to change the default route names for some paths

| Keys     | Type   | Optional |
| -------- | ------ | -------- |
| root     | string | +        |
| wildcard | string | +        |

**Usage example:**

```typescript
createRoot(routes, {
    routeName: { 
        root: 'home',
        wildcard: 'notFound'
    } 
  }
);
```

## [CreatorOptionArgs](/docs/api/interfaces.md#creatoroptionargs)

describes possible options of root/feature creators

| Keys      | Type                                                             | Optional |
| --------- | ---------------------------------------------------------------- | -------- |
| key       | [privateNotesKey](/docs/api/interfaces.md#privatenoteskey)       |          |
| routeName | [DefaultNameOptions](/docs/api/interfaces.md#defaultnameoptions) |          |
| nearby    | [Connectors](/docs/api/interfaces.md#connectors)                 |          |


---

# 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://routeshub.gitbook.io/docs/api/interfaces.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.
