Skip to content

Navigation Menu

Sign in
Sign up

Typescript definitions not working #35

Open

Description

I'm trying to use your library with Typescript (v 3.6) and it fails to compile my project. I think the problem is that the provided definitions in index.d.ts:

  1. are using default parameters in function definitions
  2. using puppeteer as dev dependency, even though it should be a dependency

At least that's what I've got from the quick scanning of the following error log

node_modules/node-warc/index.d.ts:2:23 - error TS2688: Cannot find type definition file for 'puppeteer'.
2 /// <reference types="puppeteer" />
 ~~~~~~~~~
node_modules/node-warc/index.d.ts:8:29 - error TS2307: Cannot find module 'puppeteer'.
8 import * as puppeteer from 'puppeteer'
 ~~~~~~~~~~~
node_modules/node-warc/index.d.ts:221:41 - error TS1015: Parameter cannot have question mark and initializer.
221 constructor (page?: puppeteer.Page, requestEvent?: string = 'request');
 ~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:221:41 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
221 constructor (page?: puppeteer.Page, requestEvent?: string = 'request');
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:222:35 - error TS1015: Parameter cannot have question mark and initializer.
222 attach (page: puppeteer.Page, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:222:35 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
222 attach (page: puppeteer.Page, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:223:35 - error TS1015: Parameter cannot have question mark and initializer.
223 detach (page: puppeteer.Page, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:223:35 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
223 detach (page: puppeteer.Page, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:251:35 - error TS1015: Parameter cannot have question mark and initializer.
251 constructor (page?: CRIEPage, requestEvent?: string = 'request');
 ~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:251:35 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
251 constructor (page?: CRIEPage, requestEvent?: string = 'request');
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:252:29 - error TS1015: Parameter cannot have question mark and initializer.
252 attach (page: CRIEPage, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:252:29 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
252 attach (page: CRIEPage, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:253:29 - error TS1015: Parameter cannot have question mark and initializer.
253 detach (page: CRIEPage, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~
node_modules/node-warc/index.d.ts:253:29 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
253 detach (page: CRIEPage, requestEvent?: string = 'request'): void;
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /