mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 03:32:22 +08:00
fix(js-sdk): infer keyword collision
This commit is contained in:
parent
d497284b40
commit
d30356a22c
|
@ -1,5 +1,5 @@
|
|||
import axios, { type AxiosResponse, type AxiosRequestHeaders } from "axios";
|
||||
import type { infer as ZodInfer, ZodSchema } from "zod";
|
||||
import type * as zt from "zod";
|
||||
import { zodToJsonSchema } from "zod-to-json-schema";
|
||||
import { WebSocket } from "isows";
|
||||
import { TypedEventTarget } from "typescript-event-target";
|
||||
|
@ -83,7 +83,7 @@ export interface CrawlScrapeOptions {
|
|||
timeout?: number;
|
||||
}
|
||||
|
||||
export interface ScrapeParams<LLMSchema extends ZodSchema> extends CrawlScrapeOptions {
|
||||
export interface ScrapeParams<LLMSchema extends zt.ZodSchema> extends CrawlScrapeOptions {
|
||||
extract?: {
|
||||
prompt?: string;
|
||||
schema?: LLMSchema;
|
||||
|
@ -200,10 +200,10 @@ export default class FirecrawlApp {
|
|||
* @param params - Additional parameters for the scrape request.
|
||||
* @returns The response from the scrape operation.
|
||||
*/
|
||||
async scrapeUrl<T extends ZodSchema>(
|
||||
async scrapeUrl<T extends zt.ZodSchema>(
|
||||
url: string,
|
||||
params?: ScrapeParams<T>
|
||||
): Promise<ScrapeResponse<ZodInfer<T>> | ErrorResponse> {
|
||||
): Promise<ScrapeResponse<zt.infer<T>> | ErrorResponse> {
|
||||
const headers: AxiosRequestHeaders = {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${this.apiKey}`,
|
||||
|
|
Loading…
Reference in New Issue
Block a user