Skip to content

Commit 4c8ba70

Browse files
committed
fix more type errors
1 parent 1458242 commit 4c8ba70

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

examples/vue/sub-components/src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ const expanded = ref<ExpandedState>({})
107107
const rerender = () => {
108108
data.value = defaultData
109109
}
110+
110111
const table = tableHelper.useTable({
111112
// features and row models are already defined in the tableHelper
112113
get data() {

packages/angular-table/src/createTableHelper.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import {
2-
constructTableHelper,
3-
TableHelperOptions,
4-
} from './constructTableHelper'
1+
import { constructTableHelper } from './constructTableHelper'
52
import { injectTable } from './injectTable'
3+
import type { TableHelperOptions } from './constructTableHelper'
64
import type { Signal } from '@angular/core'
75
import type {
86
RowData,
@@ -12,7 +10,7 @@ import type {
1210
TableOptions,
1311
} from '@tanstack/table-core'
1412

15-
type TableHelper<
13+
export type TableHelper<
1614
TFeatures extends TableFeatures,
1715
TData extends RowData = any,
1816
> = Omit<TableHelper_Core<TFeatures, TData>, 'tableCreator'> & {

packages/angular-table/src/flex-render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class FlexRenderDirective<TProps extends NonNullable<unknown>>
7070

7171
if ('table' in this.props) {
7272
this.experimentalReactivity =
73-
(this.props.table as Partial<Table<any, any>>).options
73+
(this.props.table as Partial<Table<any, any>>)['options']
7474
?.enableExperimentalReactivity ?? false
7575
}
7676

packages/angular-table/tests/createTableHelper.test-d.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
createTableHelper,
55
stockFeatures,
66
} from '../src'
7-
import type { ColumnDef, StockTableFeatures, Table, TableHelper } from '../src'
7+
import type { TableHelper } from '../src/createTableHelper'
8+
import type { ColumnDef, StockFeatures, Table } from '../src'
89

910
test('infer data type from TData', () => {
1011
type TestDataType = { firstName: string; lastName: string; age: number }
@@ -18,11 +19,11 @@ test('infer data type from TData', () => {
1819
})
1920

2021
expectTypeOf<typeof tableHelper>().toEqualTypeOf<
21-
TableHelper<Required<StockTableFeatures>, TestDataType>
22+
TableHelper<Required<StockFeatures>, TestDataType>
2223
>()
2324

2425
expectTypeOf<(typeof tableHelper)['features']>().toEqualTypeOf<
25-
Required<StockTableFeatures>
26+
Required<StockFeatures>
2627
>()
2728

2829
const columns = [
@@ -48,7 +49,7 @@ test('infer data type given by injectTable', () => {
4849
})
4950

5051
expectTypeOf<typeof tableHelper>().toEqualTypeOf<
51-
TableHelper<Required<StockTableFeatures>, any>
52+
TableHelper<Required<StockFeatures>, any>
5253
>()
5354

5455
const injectTable = tableHelper.injectTable
@@ -58,6 +59,6 @@ test('infer data type given by injectTable', () => {
5859
}))
5960

6061
expectTypeOf<typeof table>().toEqualTypeOf<
61-
Table<Required<StockTableFeatures>, TestDataType>
62+
Table<Required<StockFeatures>, TestDataType>
6263
>()
6364
})

0 commit comments

Comments
 (0)