revogrid icon indicating copy to clipboard operation
revogrid copied to clipboard

Typescript errors on multiple files

Open florentsuc opened this issue 2 years ago • 1 comments

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
}

florentsuc avatar Jan 26 '23 16:01 florentsuc

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.

kuncevic avatar Mar 24 '23 13:03 kuncevic

Can not reproduce anymore on 4+

revolist avatar Jul 11 '24 16:07 revolist