Angular 11 + Angular-clickgrid@2.25.0 + 构建错误

如何解决Angular 11 + Angular-clickgrid@2.25.0 + 构建错误

我已经在 Angular 11 项目中安装了最新版本的 angular-slickgrid。在 ng build 之后,我开始在 d.ts 文件中收到这些错误。 你能帮我做同样的事情吗?

以下是构建的日志:

ng build
✔ Browser application bundle generation complete.

Error: node_modules/angular-slickgrid/app/modules/angular-slickgrid/services/graphql.service.d.ts:18:5 - error TS2416: Property 'init' in type 'GraphqlService' is not assignable to the same property in base type 'BackendService'.
Type '(serviceOptions?: GraphqlServiceOption | undefined,pagination?: Pagination | undefined,grid?: any) => void' is not assignable to type '(serviceOptions?: BackendServiceOption | undefined,grid?: any) => void'.
Types of parameters 'serviceOptions' and 'serviceOptions' are incompatible.
Type 'BackendServiceOption | undefined' is not assignable to type 'GraphqlServiceOption | undefined'.
Property 'datasetName' is missing in type 'BackendServiceOption' but required in type 'GraphqlServiceOption'.

18 init(serviceOptions?: GraphqlServiceOption,pagination?: Pagination,grid?: any): void;
~~~~

node_modules/angular-slickgrid/app/modules/angular-slickgrid/models/graphqlServiceOption.interface.d.ts:14:5
14 datasetName: string;
~~~~~~~~~~~
'datasetName' is declared here.
node_modules/angular-slickgrid/app/modules/angular-slickgrid/services/graphql.service.d.ts:54:5 - error TS2416: Property 'processOnPaginationChanged' in type 'GraphqlService' is not assignable to the same property in base type 'BackendService'.
Type '(event: Event,args: PaginationChangedArgs) => string' is not assignable to type '(event: Event | undefined,args: PaginationChangedArgs) => string'.
Types of parameters 'event' and 'event' are incompatible.
Type 'Event | undefined' is not assignable to type 'Event'.
Type 'undefined' is not assignable to type 'Event'.

54 processOnPaginationChanged(event: Event,args: PaginationChangedArgs): string;
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/services/grid-odata.service.d.ts:21:5 - error TS2416: Property 'init' in type 'GridOdataService' is not assignable to the same property in base type 'BackendService'.
Type '(serviceOptions: Partial,grid?: any) => void'.
Types of parameters 'serviceOptions' and 'serviceOptions' are incompatible.
Type 'BackendServiceOption | undefined' is not assignable to type 'Partial'.
Type 'undefined' is not assignable to type 'Partial'.

21 init(serviceOptions: Partial,grid?: any): void;
~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/services/grid-odata.service.d.ts:42:5 - error TS2416: Property 'processOnPaginationChanged' in type 'GridOdataService' is not assignable to the same property in base type 'BackendService'.
Type '(event: Event,args: PaginationChangedArgs) => string'.
Types of parameters 'event' and 'event' are incompatible.
Type 'Event | undefined' is not assignable to type 'Event'.
Type 'undefined' is not assignable to type 'Event'.

42 processOnPaginationChanged(event: Event,args: PaginationChangedArgs): string;
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/models/graphqlServiceApi.interface.d.ts:7:18 - error TS2430: Interface 'GraphqlServiceApi' incorrectly extends interface 'BackendServiceApi'.
The types of 'service.init' are incompatible between these types.
Type '(serviceOptions?: GraphqlServiceOption | undefined,grid?: any) => void'.

7 export interface GraphqlServiceApi extends BackendServiceApi {
~~~~~~~~~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/models/odataServiceApi.interface.d.ts:4:18 - error TS2430: Interface 'OdataServiceApi' incorrectly extends interface 'BackendServiceApi'.
The types of 'service.init' are incompatible between these types.
Type '(serviceOptions: Partial,grid?: any) => void'.
[0m
4 export interface OdataServiceApi extends BackendServiceApi {
~~~~~~~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/autoCompleteFilter.d.ts:64:5 - error TS2416: Property 'setValues' in type 'AutoCompleteFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: string | number | boolean | Date | SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | ... 20 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

64 setValues(values: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/compoundDateFilter.d.ts:48:5 - error TS2416: Property 'setValues' in type 'CompoundDateFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: string | number | boolean | Date | SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | ... 20 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

48 setValues(values: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/compoundInputFilter.d.ts:43:5 - error TS2416: Property 'setValues' in type 'CompoundInputFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | "*z" | "EQ" | "GE" | "GT" | "NE" | "LE" | ... 14 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'SearchTerm[]'.
Type 'undefined' is not assignable to type 'SearchTerm[]'.

43 setValues(values: SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/compoundSliderFilter.d.ts:43:5 - error TS2416: Property 'setValues' in type 'CompoundSliderFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: string | number | boolean | Date | SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | ... 20 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

43 setValues(values: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/inputFilter.d.ts:37:5 - error TS2416: Property 'setValues' in type 'InputFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: SearchTerm,operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | "*z" | "EQ" | "GE" | "GT" | "NE" | "LE" | ... 14 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'SearchTerm'.
Type 'undefined' is not assignable to type 'SearchTerm'.

37 setValues(values: SearchTerm,operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/selectFilter.d.ts:52:5 - error TS2416: Property 'init' in type 'SelectFilter' is not assignable to the same property in base type 'Filter'.
Type '(args: FilterArguments,isFilterFirstRender: boolean) => Promise' is not assignable to type '(args: FilterArguments,isFilterFirstRender?: boolean | undefined) => void'.
Types of parameters 'isFilterFirstRender' and 'isFilterFirstRender' are incompatible.
Type 'boolean | undefined' is not assignable to type 'boolean'.
Type 'undefined' is not assignable to type 'boolean'.

52 init(args: FilterArguments,isFilterFirstRender: boolean): Promise;
~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/selectFilter.d.ts:67:5 - error TS2416: Property 'setValues' in type 'SelectFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: string | number | boolean | Date | SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | ... 20 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

67 setValues(values: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/nativeSelectFilter.d.ts:40:5 - error TS2416: Property 'setValues' in type 'NativeSelectFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: string | number | boolean | Date | SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | ... 20 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

40 setValues(values: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/dateRangeFilter.d.ts:50:5 - error TS2416: Property 'setValues' in type 'DateRangeFilter' is not assignable to the same property in base type 'Filter'.
Type '(searchTerms: SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | "*z" | "EQ" | "GE" | "GT" | "NE" | "LE" | ... 14 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'searchTerms' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'SearchTerm[]'.
Type 'undefined' is not assignable to type 'SearchTerm[]'.

50 setValues(searchTerms: SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/sliderFilter.d.ts:41:5 - error TS2416: Property 'setValues' in type 'SliderFilter' is not assignable to the same property in base type 'Filter'.
Type '(values: string | number | boolean | Date | SearchTerm[],operator?: "" | "" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | "a" | ... 20 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'values' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

41 setValues(values: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;
~~~~~~~~~
node_modules/angular-slickgrid/app/modules/angular-slickgrid/filters/sliderRangeFilter.d.ts:53:5 - error TS2416: Property 'setValues' in type 'SliderRangeFilter' is not assignable to the same property in base type 'Filter'.
Type '(searchTerms: string | number | boolean | Date | SearchTerm[],operator?: "" | "*" | "LT" | OperatorType | "<>" | "!=" | "=" | "==" | ">" | ">=" | "<" | "<=" | ... 21 more ... | undefined) => void' is not assignable to type '(values: string | number | boolean | Date | SearchTerm[] | undefined) => void'.
Types of parameters 'searchTerms' and 'values' are incompatible.
Type 'string | number | boolean | Date | SearchTerm[] | undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.
Type 'undefined' is not assignable to type 'string | number | boolean | Date | SearchTerm[]'.

53 setValues(searchTerms: SearchTerm | SearchTerm[],operator?: OperatorType | OperatorString): void;

解决方法

显然 slickgrid 代码在 angular 严格模式 https://angular.io/guide/strict-mode 下不能很好地工作。您可能希望在 tsconfig.json 中禁用它。

"strict": false
,

请注意,我是 Angular-Slickgrid 的作者

@riteshk 提出的另一个答案在当时是正确的。然而,我最近确实在最新版本的 Angular-Slickgrid version 2.26.1 中推动了一个修复(付出了很多努力)。 Angular-Slickgrid 现在构建时启用了严格模式,因此这不再是问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res