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

Typescript definitions not working #35

Open
comatory opened this issue Sep 15, 2019 · 0 comments
Open

Typescript definitions not working #35

comatory opened this issue Sep 15, 2019 · 0 comments

Comments

@comatory
Copy link

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;
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

N0taN3rd added a commit that referenced this issue Dec 22, 2019
Corrected readme example maybe per #36
Added utility methods to warc records and capturers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant