Answers for "Generic type 'ModuleWithProviders<T>' requires 1 type argument(s)."

2

Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

// make your index.d.ts file to be like this

import { ModuleWithProviders, Provider } from '@angular/core';
import * as ɵngcc0 from '@angular/core';
export * from './src/jwt.interceptor';
export * from './src/jwthelper.service';
export * from './src/jwtoptions.token';
export interface JwtModuleOptions {
    jwtOptionsProvider?: Provider;
    config?: {
        tokenGetter?: () => string | null | Promise<string | null>;
        headerName?: string;
        authScheme?: string;
        whitelistedDomains?: Array<string | RegExp>;
        blacklistedRoutes?: Array<string | RegExp>;
        throwNoTokenError?: boolean;
        skipWhenExpired?: boolean;
    };
}
export declare class JwtModule {
    constructor(parentModule: JwtModule);
    static forRoot(options: JwtModuleOptions): ModuleWithProviders<JwtModule>;
    static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<JwtModule, [{ optional: true; skipSelf: true; }]>;
    static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<JwtModule, never, never, never>;
    static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<JwtModule>;
}
 
//# sourceMappingURL=index.d.ts.map
Posted by: Guest on August-12-2021
0

Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

// Add in app.module.ts

declare module "@angular/core" {
  interface ModuleWithProviders<T = any> {
    ngModule: Type<T>;
    providers?: Provider[];
  }
}

// OR add in tsconfig.app.json
"skipLibCheck": true;

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": [],
    "skipLibCheck": true
  },
      .....
Posted by: Guest on December-10-2020

Code answers related to "Generic type 'ModuleWithProviders<T>' requires 1 type argument(s)."

Code answers related to "TypeScript"

Browse Popular Code Answers by Language