Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in node_modules/angular-skyhook-multi-backend/ambient.d.ts(26,47): error TS7031: Binding element 'boolean' implicitly has an 'any' type. #5

Closed
punxrok opened this issue Jun 21, 2018 · 6 comments

Comments

@punxrok
Copy link

punxrok commented Jun 21, 2018

I am trying to integrate angular-skyhook into my angular project (based on https://github.com/ngx-rocket/starter-kit).

When I try to start my development server I get the following error:

ERROR in node_modules/angular-skyhook-multi-backend/ambient.d.ts(26,47): error TS7031: Binding element 'boolean' implicitly has an 'any' type.

I'm using the latest version of angular-skyhook (1.0.7).

My current workaround is setting "noImplicitAny": false in tsconfig.

module declaration:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BuilderComponent } from './builder.component';
import { BuilderRoutingModule } from '@app/builder/builder-routing.module';
import { TranslateModule } from '@ngx-translate/core';
import { CoreModule } from '@app/core';
import { SharedModule } from '@app/shared';
import {DndModule} from '@beyerleinf/ngx-dnd';
import {FormsModule} from '@angular/forms';
import {SkyhookDndModule} from 'angular-skyhook';
import { createDefaultMultiBackend} from 'angular-skyhook-multi-backend';
import { default as HTML5Backend } from 'react-dnd-html5-backend';
import { SortableComponent } from './sortable/sortable.component';
import {CardComponent, CardInnerDirective} from './card/card.component';




@NgModule({
  imports: [
    CommonModule,
    TranslateModule,
    CoreModule,
    SharedModule,
    FormsModule,
    BuilderRoutingModule,
    DndModule.forRoot(),
    // SkyhookDndModule.forRoot( {backend: HTML5Backend}),
    SkyhookDndModule.forRoot({ backendFactory: createDefaultMultiBackend }),
  ],
  declarations: [
    BuilderComponent,
    SortableComponent,
    CardInnerDirective,
    CardComponent
  ]
})
export class BuilderModule { }

ambient.d.ts:

declare module "dnd-multi-backend" {
    export interface Transition {
        event: string;
        check: (event: Event) => boolean;
    }
    export type Backend = any;
    export type BackendTransition = {
        backend: any;
        transition: Transition;
    };
    const MultiBackend: (
        transition: { backends: BackendTransition[] }
    ) => Backend;
    export default MultiBackend;
    export const createTransition: (
        event: string,
        check: (event: Event) => boolean
    ) => Transition;
    export const HTML5DragTransition: Transition;
    export const TouchTransition: Transition;
    export const MouseTransition: Transition;
}

declare module "react-dnd-touch-backend" {
    import { Backend } from "dnd-multi-backend";
    **const TouchBackend: ({ enableMouseEvents: boolean }) => Backend;**
    export default TouchBackend;
}
@cormacrelf
Copy link
Owner

I’m quite sure the library itself is compiled with noImplicitAny: true. I’m going to need your TypeScript version, because I do want to know what versions work and what ones don’t.

It looks like this problem: microsoft/TypeScript#9657 but I haven’t worked out why it compiles with ngc and TS 2.7.

@punxrok
Copy link
Author

punxrok commented Jun 21, 2018

My TypeScript version is 2.7.2 my IDE is WebStorm.

@cormacrelf
Copy link
Owner

cormacrelf commented Jun 21, 2018 via email

@cormacrelf
Copy link
Owner

(Also maybe skipLibCheck: true would help. Maybe. I think it’s on by default for @angular/cli projects, maybe not for your template.)

@cormacrelf
Copy link
Owner

multi backend 1.0.8 published

@punxrok
Copy link
Author

punxrok commented Jun 26, 2018

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants