/** biome-ignore-all lint/performance/noBarrelFile: This doesn't really have the aspects of being a barrel file. */ import type { Request as NpmHarRequest, Param, PostDataCommon } from 'har-format'; import type { Merge } from 'type-fest'; import type { CodeBuilderOptions } from './helpers/code-builder.js'; import type { ReducedHelperObject } from './helpers/reducer.js'; import { type UrlWithParsedQuery } from './helpers/url.js'; import type { ClientId, TargetId } from './targets/index.js'; export { availableTargets, extname } from './helpers/utils.js'; export { addClientPlugin, addTarget, addTargetClient } from './targets/index.js'; export type { ClientId, TargetId } from './targets/index.js'; /** is this wrong? yes. according to the spec (http://www.softwareishard.com/blog/har-12-spec/#postData) it's technically wrong since `params` and `text` are (by the spec) mutually exclusive. However, in practice, this is not what is often the case. * * In general, this library takes a _descriptive_ rather than _perscriptive_ approach (see https://amyrey.web.unc.edu/classes/ling-101-online/tutorials/understanding-prescriptive-vs-descriptive-grammar/). * * Then, in addition to that, it really adds to complexity with TypeScript (TypeScript takes this constraint very very seriously) in a way that's not actually super useful. So, we treat this object as though it could have both or either of `params` and/or `text`. */ type PostDataBase = PostDataCommon & { params?: Param[]; text?: string; }; export type { Client } from './targets/index.js'; export type HarRequest = Omit & { postData: PostDataBase; }; export interface RequestExtras { allHeaders: ReducedHelperObject; cookiesObj: ReducedHelperObject; fullUrl: string; headersObj: ReducedHelperObject; postData: PostDataBase & { boundary?: string; jsonObj?: ReducedHelperObject; paramsObj?: ReducedHelperObject; }; queryObj: ReducedHelperObject; uriObj: UrlWithParsedQuery; } export type Request = HarRequest & RequestExtras; interface Entry { request: Partial; } interface HarEntry { log: { creator: { name: string; version: string; }; entries: Entry[]; version: string; }; } export type Options = Merge>; export interface HTTPSnippetOptions { harIsAlreadyEncoded?: boolean; } export declare class HTTPSnippet { initCalled: boolean; entries: Entry[]; requests: Request[]; options: HTTPSnippetOptions; constructor(input: HarEntry | HarRequest, opts?: HTTPSnippetOptions); init(): HTTPSnippet; prepare(harRequest: HarRequest, options: HTTPSnippetOptions): Request & { allHeaders: Record; fullUrl: string; url: string; uriObj: { query: ReducedHelperObject; search: string; path: string | null; auth: string | null; hash: string | null; host: string | null; hostname: string | null; href: string; pathname: string | null; protocol: string | null; slashes: boolean | null; port: string | null; }; }; convert(targetId: TargetId, clientId?: ClientId, options?: Options): (string | false)[]; installation(targetId: TargetId, clientId?: ClientId, options?: Options): (string | false)[]; } //# sourceMappingURL=index.d.ts.map