# @birchui/angular API reference

> Angular components for Birch UI

```bash
npm install @birchui/angular
```

## @birchui/angular

### injectBirchWidget

Kind: function. Import from `@birchui/angular`.

```ts
function injectBirchWidget<TOptions extends object, TEvents extends object, TWidget extends Widget<TOptions, TEvents>>(definition: WidgetDefinition<TOptions, TEvents, TWidget>, outputs: WidgetOutputs<TEvents>, options: () => TOptions): BirchWidgetRef<TWidget>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `definition` | `WidgetDefinition<TOptions, TEvents, TWidget>` |  |
| `outputs` | `WidgetOutputs<TEvents>` |  |
| `options` | `() => TOptions` |  |

### withOverrides

Kind: function. Import from `@birchui/angular`.

```ts
function withOverrides<TOptions extends object>(base: Partial<TOptions> | undefined, overrides: Partial<TOptions>): TOptions
```

| Parameter | Type | Description |
| --- | --- | --- |
| `base` | `Partial<TOptions> \| undefined` |  |
| `overrides` | `Partial<TOptions>` |  |

### BirchGridComponent

Kind: class. Import from `@birchui/angular`.

```ts
class BirchGridComponent<TRow = RowData> implements WidgetOutputs<GridEvents<TRow>>
new BirchGridComponent()
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly options` | `InputSignal<Partial<GridOptions<TRow>> \| undefined>` |  |
| `readonly columns` | `InputSignal<ColumnDef<TRow>[] \| undefined>` |  |
| `readonly rows` | `InputSignal<TRow[] \| undefined>` |  |
| `readonly theme` | `InputSignal<(string & {}) \| "auto" \| "light" \| "dark" \| undefined>` |  |
| `readonly quickFilter` | `InputSignal<string \| undefined>` |  |
| `readonly licenseKey` | `InputSignal<string \| undefined>` |  |
| `readonly ready` | `OutputEmitterRef<{ api: GridApi<TRow>; }>` |  |
| `readonly cellClick` | `OutputEmitterRef<CellEvent<TRow>>` |  |
| `readonly cellDoubleClick` | `OutputEmitterRef<CellEvent<TRow>>` |  |
| `readonly cellKeyDown` | `OutputEmitterRef<CellEvent<TRow>>` |  |
| `readonly cellValueChanged` | `OutputEmitterRef<CellValueChangedEvent<TRow>>` |  |
| `readonly rowClick` | `OutputEmitterRef<{ row: TRow \| undefined; displayRow: DisplayRow<TRow>; rowIndex: number; event: MouseEvent; }>` |  |
| `readonly selectionChanged` | `OutputEmitterRef<{ selected: TRow[]; }>` |  |
| `readonly sortChanged` | `OutputEmitterRef<{ sort: SortItem[]; }>` |  |
| `readonly filterChanged` | `OutputEmitterRef<{ filterModel: Record<string, FilterModel>; quickFilter: string; }>` |  |
| `readonly columnResized` | `OutputEmitterRef<{ colId: string; width: number; }>` |  |
| `readonly columnMoved` | `OutputEmitterRef<{ colId: string; toIndex: number; }>` |  |
| `readonly columnPinned` | `OutputEmitterRef<{ colId: string; pinned: "left" \| "right" \| null; }>` |  |
| `readonly columnVisible` | `OutputEmitterRef<{ colId: string; hidden: boolean; }>` |  |
| `readonly columnStateChanged` | `OutputEmitterRef<{ state: ColumnState[]; }>` |  |
| `readonly modelUpdated` | `OutputEmitterRef<{ rowCount: number; displayRowCount: number; }>` |  |
| `readonly focusChanged` | `OutputEmitterRef<{ cell: CellPosition \| null; }>` |  |
| `readonly viewportScroll` | `OutputEmitterRef<{ top: number; left: number; }>` |  |
| `readonly pageChanged` | `OutputEmitterRef<{ page: number; pageCount: number; }>` |  |
| `readonly rowExpanded` | `OutputEmitterRef<{ rowId: string; expanded: boolean; }>` |  |
| `readonly editStart` | `OutputEmitterRef<CellPosition>` |  |
| `readonly editStop` | `OutputEmitterRef<CellPosition & { cancelled: boolean; }>` |  |
| `readonly columnGroupOpened` | `OutputEmitterRef<{ groupId: string; open: boolean; }>` |  |
| `readonly stateChanged` | `OutputEmitterRef<{ state: GridState; }>` |  |
| `readonly rowDragStart` | `OutputEmitterRef<RowDragStartEvent<TRow>>` |  |
| `readonly rowDragEnd` | `OutputEmitterRef<RowDragEndEvent<TRow>>` |  |
| `readonly findChanged` | `OutputEmitterRef<FindChangedEvent<TRow>>` |  |
| `readonly printStarted` | `OutputEmitterRef<Record<string, never>>` |  |
| `readonly printFinished` | `OutputEmitterRef<Record<string, never>>` |  |
| `api` | `GridApi<TRow> \| undefined` |  |

### BirchWidgetRef

Kind: interface. Import from `@birchui/angular`.

```ts
interface BirchWidgetRef<TWidget>
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly instance` | `TWidget \| undefined` |  |

### WidgetEventName

Kind: type. Import from `@birchui/angular`.

```ts
type WidgetEventName<TEvents extends object> = Extract<keyof TEvents, string>;
```

### WidgetOutputs

Kind: type. Import from `@birchui/angular`.

```ts
type WidgetOutputs<TEvents extends object> = {
  readonly [K in WidgetEventName<TEvents>]: OutputEmitterRef<TEvents[K]>;
};
```
