# @birchui/migrate API reference

> Migrate AG Grid and MUI X Data Grid code to Birch UI Grid

```bash
npm install @birchui/migrate
```

## @birchui/migrate

### code

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

```ts
function code(source: string, form: CodeForm = 'expression', extras: CodeExtras = {}): CodeRef
```

| Parameter | Type | Description |
| --- | --- | --- |
| `source` | `string` |  |
| `form?` | `CodeForm` |  |
| `extras?` | `CodeExtras` |  |

### convertAgGridColumnDefs

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

```ts
function convertAgGridColumnDefs(colDefs: readonly unknown[] | unknown, options: ConvertOptions = {}): ColumnConversion
```

| Parameter | Type | Description |
| --- | --- | --- |
| `colDefs` | `readonly unknown[] \| unknown` |  |
| `options?` | `ConvertOptions` |  |

### convertAgGridFilterModel

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

```ts
function convertAgGridFilterModel(model: unknown): { filterModel: Record<string, FilterModel>; warnings: MigrationWarning[]; }
```

| Parameter | Type | Description |
| --- | --- | --- |
| `model` | `unknown` |  |

### convertAgGridOptions

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

```ts
function convertAgGridOptions(gridOptions: unknown, options: ConvertOptions = {}): OptionsConversion & { imports: string[] }
```

| Parameter | Type | Description |
| --- | --- | --- |
| `gridOptions` | `unknown` |  |
| `options?` | `ConvertOptions` |  |

### convertMuiColumns

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

```ts
function convertMuiColumns(columns: readonly unknown[] | unknown, options: ConvertOptions = {}): ColumnConversion
```

| Parameter | Type | Description |
| --- | --- | --- |
| `columns` | `readonly unknown[] \| unknown` |  |
| `options?` | `ConvertOptions` |  |

### convertMuiFilterModel

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

```ts
function convertMuiFilterModel(model: unknown, columnTypes: Readonly<Record<string, string>> = {}): MuiFilterResult & { warnings: MigrationWarning[] }
```

| Parameter | Type | Description |
| --- | --- | --- |
| `model` | `unknown` |  |
| `columnTypes?` | `Readonly<Record<string, string>>` |  |

### convertMuiProps

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

```ts
function convertMuiProps(props: unknown, options: ConvertOptions = {}): OptionsConversion
```

| Parameter | Type | Description |
| --- | --- | --- |
| `props` | `unknown` |  |
| `options?` | `ConvertOptions` |  |

### convertSnippet

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

```ts
function convertSnippet(source: string, from: MigrationSource = 'ag-grid'): SnippetConversion
```

| Parameter | Type | Description |
| --- | --- | --- |
| `source` | `string` |  |
| `from?` | `MigrationSource` |  |

### formatMarker

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

```ts
function formatMarker(note: Note): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `note` | `Note` |  |

### isCodeRef

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

```ts
function isCodeRef(value: unknown): value is CodeRef
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` |  |

### mapAgGridApiCall

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

```ts
function mapAgGridApiCall(method: string): ApiCallMapping | null
```

| Parameter | Type | Description |
| --- | --- | --- |
| `method` | `string` |  |

### mapAgGridEvent

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

```ts
function mapAgGridEvent(name: string): EventMapping | null
```

| Parameter | Type | Description |
| --- | --- | --- |
| `name` | `string` |  |

### mapAgGridModule

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

```ts
function mapAgGridModule(name: string): ModuleMapping
```

| Parameter | Type | Description |
| --- | --- | --- |
| `name` | `string` |  |

### mapMuiApiCall

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

```ts
function mapMuiApiCall(method: string): ApiCallMapping | null
```

| Parameter | Type | Description |
| --- | --- | --- |
| `method` | `string` |  |

### mapMuiEvent

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

```ts
function mapMuiEvent(name: string): EventMapping | null
```

| Parameter | Type | Description |
| --- | --- | --- |
| `name` | `string` |  |

### parseDeclarations

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

```ts
function parseDeclarations(text: string, options: ParseLiteralOptions = {}): LiteralDeclaration[]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `options?` | `ParseLiteralOptions` |  |

### parseLiteral

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

```ts
function parseLiteral(text: string, options: ParseLiteralOptions = {}): unknown
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `options?` | `ParseLiteralOptions` |  |

### printValue

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

```ts
function printValue(value: unknown, options: PrintOptions = {}): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` |  |
| `options?` | `PrintOptions` |  |

### rewriteCallback

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

```ts
function rewriteCallback(source: string, spec: CallbackSpec): RewriteResult
```

| Parameter | Type | Description |
| --- | --- | --- |
| `source` | `string` |  |
| `spec` | `CallbackSpec` |  |

### stripCode

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

```ts
function stripCode(value: unknown): unknown
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` |  |

### themeFromAg

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

```ts
function themeFromAg(value: unknown): string | null
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` |  |

### LiteralSyntaxError

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

```ts
class LiteralSyntaxError extends Error
new LiteralSyntaxError(message: string, text: string, offset: number)
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly offset` | `number` |  |
| `readonly line` | `number` |  |
| `readonly column` | `number` |  |

### AG_GRID_API_METHODS

Kind: const. Import from `@birchui/migrate`.

```ts
const AG_GRID_API_METHODS: readonly string[]
```

### AG_GRID_EVENT_NAMES

Kind: const. Import from `@birchui/migrate`.

```ts
const AG_GRID_EVENT_NAMES: readonly string[]
```

### AG_GRID_MODULE_NAMES

Kind: const. Import from `@birchui/migrate`.

```ts
const AG_GRID_MODULE_NAMES: readonly string[]
```

### MUI_API_METHODS

Kind: const. Import from `@birchui/migrate`.

```ts
const MUI_API_METHODS: readonly string[]
```

### MUI_EVENT_NAMES

Kind: const. Import from `@birchui/migrate`.

```ts
const MUI_EVENT_NAMES: readonly string[]
```

### PRO_MODULES

Kind: const. Import from `@birchui/migrate`.

```ts
const PRO_MODULES: readonly ["RowGroupingModule", "AggregationModule", "TreeDataModule", "PivotModule", "RangeSelectionModule", "ClipboardModule", "FillHandleModule", "MasterDetailModule", "StatusBarModule", "ExcelModule"]
```

### ApiCallMapping

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

```ts
interface ApiCallMapping
```

| Property | Type | Description |
| --- | --- | --- |
| `source` | `string` |  |
| `target` | `string \| null` |  |
| `template` | `string \| null` |  |
| `templateEach?` | `string` |  |
| `module?` | `ProModuleName` |  |
| `severity` | `MigrationSeverity` |  |
| `note?` | `string` |  |
| `docsUrl` | `string` |  |

### CallbackSpec

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

```ts
interface CallbackSpec
```

| Property | Type | Description |
| --- | --- | --- |
| `label` | `string` |  |
| `params` | `readonly SourceParam[]` |  |
| `targets` | `readonly TargetParam[]` |  |
| `allowBare?` | `boolean` |  |

### CodeRef

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

```ts
interface CodeRef
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly kind` | `'code'` |  |
| `readonly source` | `string` |  |
| `readonly form` | `CodeForm` |  |
| `readonly jsx?` | `boolean` |  |
| `readonly indent?` | `string` |  |
| `readonly bound?` | `unknown` |  |

### ColumnConversion

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

```ts
interface ColumnConversion
```

| Property | Type | Description |
| --- | --- | --- |
| `columns` | `ColumnOrGroup[]` |  |
| `modules` | `string[]` |  |
| `warnings` | `MigrationWarning[]` |  |
| `gridOptions` | `Partial<GridOptions>` |  |

### ColumnDef

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

```ts
interface ColumnDef
```

| Property | Type | Description |
| --- | --- | --- |
| `id?` | `Value<string>` |  |
| `field?` | `Value<string>` |  |
| `header?` | `Value<string>` |  |
| `headerTooltip?` | `Value<string>` |  |
| `type?` | `Value<ColumnType>` |  |
| `width?` | `Value<number>` |  |
| `minWidth?` | `Value<number>` |  |
| `maxWidth?` | `Value<number>` |  |
| `flex?` | `Value<number>` |  |
| `pinned?` | `Value<'left' \| 'right' \| null>` |  |
| `hidden?` | `Value<boolean>` |  |
| `sortable?` | `Value<boolean>` |  |
| `resizable?` | `Value<boolean>` |  |
| `reorderable?` | `Value<boolean>` |  |
| `filter?` | `Value<boolean \| FilterKind>` |  |
| `editable?` | `boolean \| Callback` |  |
| `editor?` | `EditorKind \| Callback` |  |
| `options?` | `Value<readonly unknown[]>` |  |
| `valueGetter?` | `Callback` |  |
| `valueSetter?` | `Callback` |  |
| `valueParser?` | `Callback` |  |
| `format?` | `Callback` |  |
| `cell?` | `Callback` |  |
| `cellClass?` | `string \| Callback` |  |
| `headerClass?` | `Value<string>` |  |
| `align?` | `Value<'left' \| 'center' \| 'right'>` |  |
| `comparator?` | `Callback` |  |
| `aggFunc?` | `AggFuncName \| Callback` |  |
| `rowGroup?` | `Value<boolean>` |  |
| `rowGroupIndex?` | `Value<number>` |  |
| `pivot?` | `Value<boolean>` |  |
| `pivotIndex?` | `Value<number>` |  |
| `meta?` | `Value<Record<string, unknown>>` |  |

### ColumnGroupDef

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

```ts
interface ColumnGroupDef
```

| Property | Type | Description |
| --- | --- | --- |
| `id?` | `Value<string>` |  |
| `header` | `Value<string>` |  |
| `headerTooltip?` | `Value<string>` |  |
| `headerClass?` | `Value<string>` |  |
| `children` | `ColumnOrGroup[]` |  |

### ConvertOptions

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

```ts
interface ConvertOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `mode?` | `'runtime' \| 'source'` |  |
| `path?` | `string` |  |
| `includeModules?` | `boolean` |  |
| `createGrid?` | `(container: HTMLElement, options: Record<string, unknown>) => GridHandle` |  |
| `eventProps?` | `boolean` |  |
| `onReference?` | `(name: string, kind: string, rewrite: (source: string) => RewriteResult) => boolean` |  |

### EventMapping

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

```ts
interface EventMapping
```

| Property | Type | Description |
| --- | --- | --- |
| `source` | `string` |  |
| `sourceProp` | `string` |  |
| `target` | `string \| null` |  |
| `targetProp` | `string \| null` |  |
| `severity` | `MigrationSeverity` |  |
| `note?` | `string` |  |
| `docsUrl` | `string` |  |

### GridHandle

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

```ts
interface GridHandle
```

| Property | Type | Description |
| --- | --- | --- |
| `destroy` | `() => void` |  |
| `setRows?` | `(rows: unknown[]) => void` |  |

### GridOptions

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

```ts
interface GridOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `columns?` | `Value<ColumnOrGroup[]>` |  |
| `rows?` | `unknown` |  |
| `getRowId?` | `Callback` |  |
| `rowHeight?` | `Value<number> \| Callback` |  |
| `headerHeight?` | `Value<number>` |  |
| `floatingFilters?` | `boolean` |  |
| `quickFilter?` | `Value<string>` |  |
| `sort?` | `Value<SortItem[]>` |  |
| `multiSort?` | `boolean` |  |
| `filterModel?` | `Value<Record<string, FilterModel>>` |  |
| `rowSelection?` | `Value<'single' \| 'multiple' \| false>` |  |
| `checkboxSelection?` | `boolean` |  |
| `pagination?` | `Value<boolean \| { pageSize: unknown; page?: unknown }>` |  |
| `theme?` | `Value<string>` |  |
| `density?` | `Value<'compact' \| 'normal' \| 'comfortable'>` |  |
| `defaultColumn?` | `Value<Partial<ColumnDef>>` |  |
| `modules?` | `unknown[]` |  |
| `licenseKey?` | `Value<string>` |  |
| `overscanRows?` | `Value<number>` |  |
| `overscanColumns?` | `Value<number>` |  |
| `rowClass?` | `Callback` |  |
| `ariaLabel?` | `Value<string>` |  |
| `emptyMessage?` | `Value<string>` |  |
| `locale?` | `Value<string>` |  |
| `stripes?` | `boolean` |  |
| `groupBy?` | `Value<string[]>` |  |
| `groupDefaultExpanded?` | `Value<number>` |  |
| `groupPanel?` | `boolean` |  |
| `groupColumn?` | `Value<Partial<ColumnDef>>` |  |
| `groupTotals?` | `boolean` |  |
| `treeData?` | `Value<boolean>` |  |
| `getDataPath?` | `Callback` |  |
| `getParentId?` | `Callback` |  |
| `pivot?` | `Value<PivotOptions>` |  |
| `rangeSelection?` | `boolean` |  |
| `fillHandle?` | `boolean` |  |
| `clipboard?` | `boolean` |  |
| `statusBar?` | `boolean \| StatusBarOptions` |  |
| `masterDetail?` | `MasterDetailOptions` |  |
| `rowModel?` | `'client' \| 'server'` |  |
| `datasource?` | `unknown` |  |

### LiteralDeclaration

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

```ts
interface LiteralDeclaration
```

| Property | Type | Description |
| --- | --- | --- |
| `name` | `string \| null` |  |
| `value` | `unknown` |  |
| `start` | `number` |  |
| `end` | `number` |  |

### MasterDetailOptions

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

```ts
interface MasterDetailOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `render` | `Callback` |  |
| `height?` | `Value<number> \| Callback` |  |
| `isExpandable?` | `Callback` |  |

### MigrationWarning

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

```ts
interface MigrationWarning
```

| Property | Type | Description |
| --- | --- | --- |
| `code` | `string` |  |
| `severity` | `MigrationSeverity` |  |
| `path` | `string` |  |
| `message` | `string` |  |
| `docsUrl` | `string` |  |

### ModuleMapping

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

```ts
interface ModuleMapping
```

| Property | Type | Description |
| --- | --- | --- |
| `source` | `string` |  |
| `modules` | `ProModuleName[]` |  |
| `severity` | `MigrationSeverity` |  |
| `note` | `string` |  |
| `docsUrl` | `string` |  |

### MuiFilterResult

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

```ts
interface MuiFilterResult
```

| Property | Type | Description |
| --- | --- | --- |
| `filterModel` | `Record<string, FilterModel>` |  |
| `quickFilter?` | `string` |  |

### OptionsConversion

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

```ts
interface OptionsConversion
```

| Property | Type | Description |
| --- | --- | --- |
| `options` | `GridOptions` |  |
| `modules` | `string[]` |  |
| `warnings` | `MigrationWarning[]` |  |
| `events` | `Record<string, Callback>` |  |

### ParseLiteralOptions

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

```ts
interface ParseLiteralOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `allowExpressions?` | `boolean` |  |

### PivotOptions

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

```ts
interface PivotOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `enabled?` | `boolean` |  |
| `rows?` | `string[]` |  |
| `columns?` | `string[]` |  |
| `values?` | `PivotValue[]` |  |
| `totals?` | `boolean` |  |

### PivotValue

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

```ts
interface PivotValue
```

| Property | Type | Description |
| --- | --- | --- |
| `colId` | `string` |  |
| `aggFunc?` | `AggFuncName \| Callback` |  |

### PrintOptions

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

```ts
interface PrintOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `indent?` | `string` |  |
| `indentUnit?` | `string` |  |
| `printWidth?` | `number` |  |
| `prefixLength?` | `number` |  |
| `singleLine?` | `boolean` |  |
| `notes?` | `boolean` |  |

### SnippetConversion

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

```ts
interface SnippetConversion
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `SnippetKind` |  |
| `from` | `MigrationSource` |  |
| `name` | `string \| null` |  |
| `output` | `string` |  |
| `value` | `unknown` |  |
| `events` | `Record<string, unknown>` |  |
| `modules` | `string[]` |  |
| `warnings` | `MigrationWarning[]` |  |

### SortItem

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

```ts
interface SortItem
```

| Property | Type | Description |
| --- | --- | --- |
| `colId` | `string` |  |
| `dir` | `'asc' \| 'desc'` |  |

### SourceParam

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

```ts
interface SourceParam
```

| Property | Type | Description |
| --- | --- | --- |
| `to?` | `number` |  |
| `members?` | `Readonly<Record<string, MemberTarget>>` |  |
| `keep?` | `readonly string[]` |  |
| `inline?` | `string` |  |

### StatusBarOptions

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

```ts
interface StatusBarOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `rowCount?` | `boolean` |  |
| `selectedCount?` | `boolean` |  |
| `aggregates?` | `AggFuncName[]` |  |

### AggFuncName

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

```ts
type AggFuncName = 'sum' | 'avg' | 'min' | 'max' | 'count' | 'first' | 'last' | 'distinct';
```

### AnyFunction

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

```ts
type AnyFunction = (...args: any[]) => unknown;
```

### Callback

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

```ts
type Callback = AnyFunction | CodeRef;
```

### CodeForm

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

```ts
type CodeForm = 'function' | 'method' | 'reference' | 'expression' | 'spread';
```

### ColumnOrGroup

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

```ts
type ColumnOrGroup = ColumnDef | ColumnGroupDef;
```

### ColumnType

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

```ts
type ColumnType = 'text' | 'number' | 'date' | 'boolean';
```

### EditorKind

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

```ts
type EditorKind = 'text' | 'number' | 'select' | 'checkbox' | 'date';
```

### FilterKind

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

```ts
type FilterKind = 'text' | 'number' | 'date' | 'set' | 'boolean';
```

### FilterModel

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

```ts
type FilterModel =
  | { type: 'text'; op: string; value?: unknown }
  | { type: 'number'; op: string; value?: unknown; valueTo?: unknown }
  | { type: 'date'; op: string; value?: unknown; valueTo?: unknown }
  | { type: 'set'; values: readonly unknown[] }
  | { type: 'boolean'; value: boolean }
  | { type: 'custom'; test: Callback };
```

### MemberTarget

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

```ts
type MemberTarget = { param: number } | { path: string } | { expr: string };
```

### MigrationSeverity

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

```ts
type MigrationSeverity = 'info' | 'warning' | 'manual';
```

### MigrationSource

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

```ts
type MigrationSource = 'ag-grid' | 'mui';
```

### ProModuleName

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

```ts
type ProModuleName = (typeof PRO_MODULES)[number];
```

### RewriteResult

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

```ts
type RewriteResult = { ok: true; source: string; changed: boolean } | { ok: false; reason: string };
```

### SnippetKind

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

```ts
type SnippetKind = 'columns' | 'options';
```

### Value

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

```ts
type Value<T> = T | CodeRef;
```

## @birchui/migrate/codemod

### detectSource

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function detectSource(text: string, fileName: string): { from: MigrationSource | null; framework: Framework | null }
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `fileName` | `string` |  |

### estimateMinutes

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function estimateMinutes(file: Pick<FileMigration, 'changed' | 'warnings'>): number
```

| Parameter | Type | Description |
| --- | --- | --- |
| `file` | `Pick<FileMigration, 'changed' \| 'warnings'>` |  |

### expandGlobs

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function expandGlobs(patterns: readonly string[], cwd: string): string[]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `patterns` | `readonly string[]` |  |
| `cwd` | `string` |  |

### formatEffort

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function formatEffort(minutes: number): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `minutes` | `number` |  |

### globToRegExp

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function globToRegExp(glob: string): RegExp
```

| Parameter | Type | Description |
| --- | --- | --- |
| `glob` | `string` |  |

### migrateFiles

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function migrateFiles(paths: readonly string[], options: MigrateFilesOptions = {}): FileMigration[]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `paths` | `readonly string[]` |  |
| `options?` | `MigrateFilesOptions` |  |

### migrateSource

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function migrateSource(text: string, fileName: string, options: MigrateOptions = {}): FileMigration
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `fileName` | `string` |  |
| `options?` | `MigrateOptions` |  |

### renderReport

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function renderReport(files: readonly FileMigration[], options: { date?: string; relative?: (file: string) => string } = {}): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `files` | `readonly FileMigration[]` |  |
| `options?` | `{ date?: string; relative?: (file: string) => string }` |  |

### summarize

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function summarize(files: readonly FileMigration[]): MigrationSummary
```

| Parameter | Type | Description |
| --- | --- | --- |
| `files` | `readonly FileMigration[]` |  |

### unifiedDiff

Kind: function. Import from `@birchui/migrate/codemod`.

```ts
function unifiedDiff(before: string, after: string, options: DiffOptions = {}): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `before` | `string` |  |
| `after` | `string` |  |
| `options?` | `DiffOptions` |  |

### SUPPORTED_EXTENSIONS

Kind: const. Import from `@birchui/migrate/codemod`.

```ts
const SUPPORTED_EXTENSIONS: RegExp
```

### DiffOptions

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface DiffOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `oldName?` | `string` |  |
| `newName?` | `string` |  |
| `context?` | `number` |  |

### FileMigration

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface FileMigration
```

| Property | Type | Description |
| --- | --- | --- |
| `file` | `string` |  |
| `from` | `MigrationSource \| null` |  |
| `framework` | `Framework \| null` |  |
| `original` | `string` |  |
| `output` | `string` |  |
| `changed` | `boolean` |  |
| `items` | `MigrationItem[]` |  |
| `warnings` | `FileWarning[]` |  |
| `related` | `RelatedFile[]` |  |
| `error?` | `string` |  |

### FileWarning

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface FileWarning extends MigrationWarning
```

| Property | Type | Description |
| --- | --- | --- |
| `file` | `string` |  |
| `line` | `number` |  |
| `code` | `string` | Inherited from MigrationWarning. |
| `severity` | `MigrationSeverity` | Inherited from MigrationWarning. |
| `path` | `string` | Inherited from MigrationWarning. |
| `message` | `string` | Inherited from MigrationWarning. |
| `docsUrl` | `string` | Inherited from MigrationWarning. |

### MigrateFilesOptions

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface MigrateFilesOptions extends MigrateOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `write?` | `boolean` |  |
| `framework?` | `Framework` |  |
| `from?` | `MigrationSource \| undefined` | Inherited from MigrateOptions. |
| `readFile?` | `((path: string) => string \| null) \| undefined` | Inherited from MigrateOptions. |

### MigrateOptions

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface MigrateOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `from?` | `MigrationSource` |  |
| `framework?` | `Framework` |  |
| `readFile?` | `(path: string) => string \| null` |  |

### MigrationItem

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface MigrationItem
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `ItemKind` |  |
| `label` | `string` |  |
| `line` | `number` |  |

### MigrationSummary

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface MigrationSummary
```

| Property | Type | Description |
| --- | --- | --- |
| `scanned` | `number` |  |
| `changed` | `number` |  |
| `converted` | `number` |  |
| `manual` | `number` |  |
| `warnings` | `number` |  |
| `info` | `number` |  |
| `minutes` | `number` |  |
| `errors` | `number` |  |

### RelatedFile

Kind: interface. Import from `@birchui/migrate/codemod`.

```ts
interface RelatedFile
```

| Property | Type | Description |
| --- | --- | --- |
| `file` | `string` |  |
| `original` | `string` |  |
| `output` | `string` |  |

### Framework

Kind: type. Import from `@birchui/migrate/codemod`.

```ts
type Framework = 'react' | 'vue' | 'angular' | 'js';
```

### ItemKind

Kind: type. Import from `@birchui/migrate/codemod`.

```ts
type ItemKind =
  'import' | 'grid' | 'columns' | 'options' | 'api' | 'event' | 'template' | 'modules' | 'license' | 'style' | 'type';
```
