TDataRow Type
The base type for a single row of data throughout the Katlux provider system. It is a plain key-value map with no required fields, letting you use any data shape without defining a strict interface.
TDataRow is the element type in pageData and rows arrays returned by providers and APIs.
import type { TDataRow } from '@katlux/providers'
// TDataRow is simply: { [key: string]: any }
// Any plain object satisfies it.
// 1. Any object is a valid TDataRow
const userRow: TDataRow = { id: 1, name: 'Alice', role: 'admin', active: true }
const productRow: TDataRow = { id: 'sku-001', title: 'Widget', price: 9.99 }
// 2. Access fields by key (no TypeScript errors)
console.log(userRow['name']) // 'Alice'
console.log(userRow['role']) // 'admin'
// 3. Rows in provider pageData
import { CAPIFlatServerDataProvider } from '@katlux/providers'
const provider = new CAPIFlatServerDataProvider()
// pageData is Ref<TDataRow[]>
provider.pageData.value.forEach((row: TDataRow) => {
console.log(row['id'], row['name'])
})
// 4. If you want typed rows, cast or define a typed wrapper
interface User extends TDataRow {
id: number
name: string
role: string
}
const typedRows = provider.pageData.value as User[]
typedRows.forEach(user => console.log(user.name))
// 5. Used in IDataFilter field
import type { IDataFilter } from '@katlux/providers'
import { EDataFilterOperator } from '@katlux/providers'
const filter: IDataFilter = {
operator: EDataFilterOperator.Equal,
field: { role: 'admin' }, // TDataRow — any plain object
active: true
}
// Full definition
export type TDataRow = { [key: string]: any }TDataRow is an index signature type — it accepts any string key with any value. It is used as the element type of: