@cloudflare/ai-search-snippet 0.0.30 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.d.ts CHANGED
@@ -7,8 +7,8 @@ export declare class AISearchClient {
7
7
  * Performs a search query with optional streaming
8
8
  */
9
9
  search(query: string, options?: Omit<SearchOptions, 'query'>): Promise<SearchResult[]>;
10
- searchStream(query: string, options?: SearchOptions): AsyncGenerator<SearchResult | SearchError, void, undefined>;
11
- chat(query: string, options?: SearchOptions): AsyncGenerator<ChatTypes, void, undefined>;
10
+ searchStream(query: string, options?: Omit<SearchOptions, 'query'>): AsyncGenerator<SearchResult | SearchError, void, undefined>;
11
+ chat(query: string, options?: ChatOptions): AsyncGenerator<ChatTypes, void, undefined>;
12
12
  /**
13
13
  * Cancels an active request by ID
14
14
  */
@@ -198,12 +198,13 @@ declare class SearchBarSnippet extends HTMLElement {
198
198
  private handleInputKeydownEnter;
199
199
  private handleInputKeydownEscape;
200
200
  private handleSearchButtonClick;
201
- static get observedAttributes(): readonly ["api-url", "placeholder", "max-results", "debounce-ms", "theme", "hide-branding", "show-url", "show-date", "hide-thumbnails", "see-more"];
201
+ static get observedAttributes(): readonly ["api-url", "placeholder", "max-results", "debounce-ms", "theme", "hide-branding", "show-url", "show-date", "hide-thumbnails", "see-more", "request-options"];
202
202
  constructor();
203
203
  connectedCallback(): void;
204
204
  disconnectedCallback(): void;
205
205
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
206
206
  private getProps;
207
+ private getRequestOptions;
207
208
  private initializeClient;
208
209
  private render;
209
210
  private attachEventListeners;
@@ -255,12 +256,13 @@ export declare class SearchModalSnippet extends HTMLElement {
255
256
  private handleBackdropClick;
256
257
  private savedBodyStyles;
257
258
  private savedHtmlOverflow;
258
- static get observedAttributes(): readonly ["api-url", "placeholder", "max-results", "theme", "shortcut", "use-meta-key", "debounce-ms", "hide-branding", "show-url", "show-date", "hide-thumbnails", "see-more"];
259
+ static get observedAttributes(): readonly ["api-url", "placeholder", "max-results", "theme", "shortcut", "use-meta-key", "debounce-ms", "hide-branding", "show-url", "show-date", "hide-thumbnails", "see-more", "request-options"];
259
260
  constructor();
260
261
  connectedCallback(): void;
261
262
  disconnectedCallback(): void;
262
263
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
263
264
  private getProps;
265
+ private getRequestOptions;
264
266
  private initializeClient;
265
267
  private render;
266
268
  private attachGlobalKeyboardShortcut;
@@ -320,6 +322,20 @@ export declare interface SearchOptions {
320
322
  signal?: AbortSignal;
321
323
  /** Maximum search results to request from the API */
322
324
  maxResults?: number;
325
+ /** Additional request fields for search endpoints */
326
+ request?: SearchRequestOptions;
327
+ }
328
+
329
+ /**
330
+ * Additional request fields for search requests
331
+ */
332
+ export declare interface SearchRequestOptions {
333
+ /** Additional JSON fields to merge into the request body */
334
+ body?: Record<string, unknown>;
335
+ /** Additional headers to send with the request */
336
+ headers?: Record<string, string>;
337
+ /** Additional query parameters to append to the request URL */
338
+ queryParams?: Record<string, boolean | number | string | null | undefined>;
323
339
  }
324
340
 
325
341
  /**