DataTables merge namespaces

DataTables merge namespaces

sadeghbarati5sadeghbarati5 Posts: 19Questions: 2Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown: Property 'responsive' does not exist on type 'Api<any>'.
Description of problem: Typescript Merging namespace is not working


I'm using only datatables.net sources type not @types/datatables.net package

these are third-party type packages:

"@types/datatables.net": "^1.10.22",
"@types/datatables.net-autofill": "^2.2.1",
"@types/datatables.net-buttons": "^1.4.7",
"@types/datatables.net-colreorder": "^1.4.2",
"@types/datatables.net-fixedcolumns": "^3.3.1",
"@types/datatables.net-fixedheader": "^3.1.5",
"@types/datatables.net-keytable": "^2.5.1",
"@types/datatables.net-rowgroup": "^1.1.2",
"@types/datatables.net-rowreorder": "^1.1.3",
"@types/datatables.net-scroller": "^1.4.1",
"@types/datatables.net-select": "^1.2.7",

//

"@types/datatables.net-responsive": "not-exist",
"@types/datatables.net-searchbuilder": "not-exist",
"@types/datatables.net-searchpanes": "not-exist",
"@types/datatables.net-staterestore": "not-exist",

if I use these packages, available packages interface and namespaces merged together but with some error for non-existence package type like responsive

https://www.typescriptlang.org/docs/handbook/module-resolution.html
https://www.typescriptlang.org/docs/handbook/declaration-merging.html
https://stackoverflow.com/questions/48704150/how-to-configure-tsconfig-json-for-typings-not-in-types


if I use datatables.net types in types/types.d.ts with
1. /// <reference types="..." /> in index.d.ts
2. or import types with import in index.ts
3. type in tsconfig

namespace and interface will not be merged together and only last imported type will be include

Replies

Sign In or Register to comment.