Angular 5: Dynamic/extendable HTTP Interceptors

The Angular HTTP interceptors are nice, but I would like to make them slightly more re-useable.

I have a HeaderInterceptor that I want to use to set a header before requests.

I can do this...

@Injectable()
export class HeadersInterceptor implements HttpInterceptor {
    intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
        req = req.clone({headers: req.headers.set('Content-Type', 'application/json')});
        req = req.clone({headers: req.headers.set('Accept', 'application/json')});

        return next.handle(req);
    }
}

But that requires me to either have one god interceptor that has all my headers, or create separate interceptors for each header.

It would be MUCH nicer if I could do this instead:

@Injectable()
export class HeadersInterceptor implements HttpInterceptor {
    key: string;
    value: string;

    constructor(key: string, value: string) {
        this.key = key;
        this.value = value;
    }

    intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
        req = req.clone({headers: req.headers.set(this.key, this.value)});

        return next.handle(req);
    }
}

export function GetHeadersInterceptor(key: string, value: string): HeadersInterceptor {
    return new HeadersInterceptor(key, value);
}

Here's how I'd like to use it:

@NgModule({
    imports: [...],
    providers: [
        {provide: HTTP_INTERCEPTORS, useClass: GetHeadersInterceptor('Accept', 'application/json'), multi: true},
        {provide: HTTP_INTERCEPTORS, useClass: RateLimitInterceptor, multi: true},
    // ...
    ]
})
export class AppModule {}

But when I try that in my AppModule, I get a compilation error. It's too long to show here, but basically says I can't use the returned type or something along those lines. But the types are the same... not sure why it matters that it's coming from a function return.

Anyone know how this can be done in an Angular project, or if it's even possible?