revolist / revogrid

Powerful virtual data grid smartsheet with advanced customization. Best features from excel plus incredible performance 🔋
https://rv-grid.com
MIT License
2.74k stars 171 forks source link

Typescript errors on multiple files #382

Closed florentsuc closed 2 months ago

florentsuc commented 1 year ago

Starting from typescript 4.8.X, multiple typescript definition files are not compiling anymore.

You can reproduce the bug on the lib by updating typescript to 4.8.X.

The following files are not compiling anymore:

- @revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:72:71 -
- @revolist/revogrid/dist/types/plugins/trimmed/trimmed.plugin.d.ts:9:120 

Error examples:

image image

The problem is that typescript version dependency is prefixed by ^ in package.json so if you run npm update it will update typescript to 4.9.X and raise the issue.

Thank you :)

Edit: If anyone is facing the same issue, I disabled the errors by adding this in the tsconfig.json:

"compilerOptions": {
    "skipLibCheck": true
}
kuncevic commented 1 year ago

I do have same issues, my TS version 4.9.4

Error: node_modules/@revolist/revogrid/dist/types/plugins/trimmed/trimmed.plugin.d.ts:9:75 - error TS2344: Type 'T' does not satisfy the constraint 'GDataType'.
  Type 'T' is not assignable to type 'ColumnRegular'.

9 export declare const trimmedPlugin: <T>(store: Observable<DataSourceState<T, any>>) => PluginSubscribe<DataSourceState<T, any>>;
                                                                            ~

  node_modules/@revolist/revogrid/dist/types/plugins/trimmed/trimmed.plugin.d.ts:9:38
    9 export declare const trimmedPlugin: <T>(store: Observable<DataSourceState<T, any>>) => PluginSubscribe<DataSourceState<T, any>>;
                                           ~
    This type parameter might need an `extends RevoGrid.ColumnRegular` constraint.
  node_modules/@revolist/revogrid/dist/types/plugins/trimmed/trimmed.plugin.d.ts:9:38
    9 export declare const trimmedPlugin: <T>(store: Observable<DataSourceState<T, any>>) => PluginSubscribe<DataSourceState<T, any>>;
                                           ~
    This type parameter might need an `extends GDataType` constraint.

Error: node_modules/@revolist/revogrid/dist/types/plugins/trimmed/trimmed.plugin.d.ts:9:120 - error TS2344: Type 'T' does not satisfy the constraint 'GDataType'.

9 export declare const trimmedPlugin: <T>(store: Observable<DataSourceState<T, any>>) => PluginSubscribe<DataSourceState<T, any>>;
                                                                                                                         ~

  node_modules/@revolist/revogrid/dist/types/plugins/trimmed/trimmed.plugin.d.ts:9:38
    9 export declare const trimmedPlugin: <T>(store: Observable<DataSourceState<T, any>>) => PluginSubscribe<DataSourceState<T, any>>;
                                           ~
    This type parameter might need an `extends GDataType` constraint.

Error: node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:65:86 - error TS2344: Type 'T' does not satisfy the constraint 'GDataType'.
  Type 'T' is not assignable to type 'ColumnRegular'.

65 export declare function setSourceByVirtualIndex<T>(store: Observable<DataSourceState<T, any>>, modelByIndex: Record<number, T>): void;
                                                                                        ~

  node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:65:49
    65 export declare function setSourceByVirtualIndex<T>(store: Observable<DataSourceState<T, any>>, modelByIndex: Record<number, T>): void;
                                                       ~
    This type parameter might need an `extends RevoGrid.ColumnRegular` constraint.
  node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:65:49
    65 export declare function setSourceByVirtualIndex<T>(store: Observable<DataSourceState<T, any>>, modelByIndex: Record<number, T>): void;
                                                       ~
    This type parameter might need an `extends GDataType` constraint.

Error: node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:71:87 - error TS2344: Type 'T' does not satisfy the constraint 'GDataType'.
  Type 'T' is not assignable to type 'ColumnRegular'.

71 export declare function setSourceByPhysicalIndex<T>(store: Observable<DataSourceState<T, any>>, modelByIndex: Record<number, T>): void;
                                                                                         ~

  node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:71:50
    71 export declare function setSourceByPhysicalIndex<T>(store: Observable<DataSourceState<T, any>>, modelByIndex: Record<number, T>): void;
                                                        ~
    This type parameter might need an `extends RevoGrid.ColumnRegular` constraint.
  node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:71:50
    71 export declare function setSourceByPhysicalIndex<T>(store: Observable<DataSourceState<T, any>>, modelByIndex: Record<number, T>): void;
                                                        ~
    This type parameter might need an `extends GDataType` constraint.

Error: node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:72:71 - error TS2344: Type 'T' does not satisfy the constraint 'GDataType'.
  Type 'T' is not assignable to type 'ColumnRegular'.

72 export declare function setItems<T>(store: Observable<DataSourceState<T, any>>, items: number[]): void;
                                                                         ~

  node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:72:34
    72 export declare function setItems<T>(store: Observable<DataSourceState<T, any>>, items: number[]): void;
                                        ~
    This type parameter might need an `extends RevoGrid.ColumnRegular` constraint.
  node_modules/@revolist/revogrid/dist/types/store/dataSource/data.store.d.ts:72:34
    72 export declare function setItems<T>(store: Observable<DataSourceState<T, any>>, items: number[]): void;
                                        ~
    This type parameter might need an `extends GDataType` constraint.

Fixed with "skipLibCheck": true but that a bit weird.

revolist commented 2 months ago

Can not reproduce anymore on 4+