1+ import type { CodeBuilderOptions } from './helpers/code-builder.js' ;
12import type { ReducedHelperObject } from './helpers/reducer.js' ;
23import type { ClientId , TargetId } from './targets/index.js' ;
34import type { Param , PostDataCommon , Request as NpmHarRequest } from 'har-format' ;
45import type { UrlWithParsedQuery } from 'node:url' ;
6+ import type { Merge } from 'type-fest' ;
57
68import { format as urlFormat , parse as urlParse } from 'node:url' ;
79
@@ -25,6 +27,8 @@ type PostDataBase = PostDataCommon & {
2527 text ?: string ;
2628} ;
2729
30+ export type { Client } from './targets/index.js' ;
31+
2832export type HarRequest = Omit < NpmHarRequest , 'postData' > & { postData : PostDataBase } ;
2933
3034export interface RequestExtras {
@@ -58,6 +62,8 @@ interface HarEntry {
5862 } ;
5963}
6064
65+ export type Options = Merge < CodeBuilderOptions , Record < string , any > > ;
66+
6167export interface HTTPSnippetOptions {
6268 harIsAlreadyEncoded ?: boolean ;
6369}
@@ -318,13 +324,13 @@ export class HTTPSnippet {
318324 } ;
319325 }
320326
321- convert ( targetId : TargetId , clientId ?: ClientId , options ?: any ) {
327+ convert ( targetId : TargetId , clientId ?: ClientId , options ?: Options ) {
322328 if ( ! this . initCalled ) {
323329 this . init ( ) ;
324330 }
325331
326332 if ( ! options && clientId ) {
327- options = clientId ;
333+ options = { clientId } ;
328334 }
329335
330336 const target = targets [ targetId ] ;
@@ -337,13 +343,13 @@ export class HTTPSnippet {
337343 return results ;
338344 }
339345
340- installation ( targetId : TargetId , clientId ?: ClientId , options ?: any ) {
346+ installation ( targetId : TargetId , clientId ?: ClientId , options ?: Options ) {
341347 if ( ! this . initCalled ) {
342348 this . init ( ) ;
343349 }
344350
345351 if ( ! options && clientId ) {
346- options = clientId ;
352+ options = { clientId } ;
347353 }
348354
349355 const target = targets [ targetId ] ;
0 commit comments