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

fix types #826

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

fix types #826

wants to merge 4 commits into from

Conversation

DetachHead
Copy link

@DetachHead DetachHead commented May 20, 2022

add "types" property to package.json

since types wasn't in package.json you couldn't actually use the globally declared postman types:

error TS2688: Cannot find type definition file for 'postman-sandbox'.
  The file is in the program because:
    Entry point of type library 'postman-sandbox' specified in compilerOptions

  tsconfig.postman.json:5:19
    5         "types": ["postman-sandbox"]
                        ~~~~~~~~~~~~~~~~~
    File is entry point of type library specified here.

add dependencies for missing types

there are types used in index.d.ts that are not listed as dependencies which causes compile errors. i was able to fix some of them but i have no idea where the types for these are supposed to come from:

node_modules/postman-sandbox/types/index.d.ts:73:29 - error TS2304: Cannot find name 'EventEmitter'.

73         constructor(bridge: EventEmitter, execution: Execution, onRequest: (...params: any[]) => any, cookieStore: any);
                               ~~~~~~~~~~~~

node_modules/postman-sandbox/types/index.d.ts:73:54 - error TS2304: Cannot find name 'Execution'.

73         constructor(bridge: EventEmitter, execution: Execution, onRequest: (...params: any[]) => any, cookieStore: any);
                                                        ~~~~~~~~~

node_modules/postman-sandbox/types/index.d.ts:165:41 - error TS2304: Cannot find name 'Uniscope'.

165     function raiseAssertionEvent(scope: Uniscope, execution: Execution, pmapi: any): void;
                                            ~~~~~~~~

node_modules/postman-sandbox/types/index.d.ts:165:62 - error TS2304: Cannot find name 'Execution'.

165     function raiseAssertionEvent(scope: Uniscope, execution: Execution, pmapi: any): void;
                                                                 ~~~~~~~~~

fix required parameter following optional parameter

node_modules/postman-sandbox/types/index.d.ts:32:40 - error TS1016: A required parameter cannot follow an optional parameter.

32     getAll(url: string, options?: any, callback: (...params: any[]) => any): void;
                                          ~~~~~~~~

remove @types/postman-collection

postman-collection now has types in it, so the outdated types in @types/postman-collection package is no longer necessary (after postmanlabs/postman-collection#1271 is merged)

however the types in postman-collection seem to be missingstuff like PropertyDefinition? https://github.com/DefinitelyTyped/DefinitelyTyped/blob/c432b1015151bc90947ea2ac3b1a50a86734ad0b/types/postman-collection/index.d.ts#L45

edit: i have no idea what's up with the postman-collections types as both versions of the types seem to have their own issues postmanlabs/postman-collection#602

@DetachHead
Copy link
Author

the ci failure appears to be a problem with the runner

image

@meg2208
Copy link

meg2208 commented Nov 29, 2022

Is it possible to get this merged?

@DetachHead
Copy link
Author

i've resolved the conflicts. hopefully someone reviews it soon

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