# Interfaces

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

## [Root](#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](#spot)

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

## [Note](#note)

**Generic Type:**

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

| Keys     | Type                | Optional |
| -------- | ------------------- | -------- |
| path     | string              |          |
| name     | string              | +        |
| children | [Notes](#notes)\<C> | +        |

**Usage example:**

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

## [Unit](#unit)

**Generic Type:**

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

| Keys                 | Type                                                  | Optional |
| -------------------- | ----------------------------------------------------- | -------- |
| key in keyof (R & C) | [Spot](#spot) & [PrivateNotesKey](#privatenoteskey-1) |          |

**Usage example:**

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

## �[Units](#units)

**Generic Type:**

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

| Keys           | Type                    | Optional |
| -------------- | ----------------------- | -------- |
| key in keyof R | [Unit](#unit)\<R\[key]> |          |

**Usage example:**

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

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

## [Connector](#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](#connectors)

**Generic Type:**

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

| Keys           | Type                              | Optional |
| -------------- | --------------------------------- | -------- |
| key in keyof R | [Connector](#connector)\<R\[key]> |          |

**Usage example:**

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

## [privateNotesKey](#privatenoteskey)

describes the private key value

**Type:**

```typescript
string | symbol;
```

## [PrivateNotesKey](#privatenoteskey)

extends interfaces by private key property

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

## [DefaultNameOptions](#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](#creatoroptionargs)

describes possible options of root/feature creators

| Keys      | Type                                      | Optional |
| --------- | ----------------------------------------- | -------- |
| key       | [privateNotesKey](#privatenoteskey)       |          |
| routeName | [DefaultNameOptions](#defaultnameoptions) |          |
| nearby    | [Connectors](#connectors)                 |          |
