@mxlabs/okxnotify
Version:
OKX notification package with Feishu, Cloudflare Workers, and Gemini AI agent integration - Complete bundle
71 lines (70 loc) • 2 kB
TypeScript
export interface IBrowserRenderResponse {
success: boolean;
result: string;
}
export declare const handleRenderResponse: (data: IBrowserRenderResponse) => string;
export interface IBrowserRenderScrapeResult {
results: Array<{
selector: string;
results: Array<{
text: string;
html: string;
attributes?: Array<Record<string, string>>;
height?: number;
width?: number;
top?: number;
left?: number;
}>;
}>;
}
export interface IBrowserRenderJSONParams {
/** 请求的url */
url: string;
/** 提示词 */
prompt: string;
/** 响应格式 */
response_format?: {
type: 'json_schema';
json_schema: {
type: 'object';
properties: {
products: {
type: 'array';
items: {
type: 'object';
properties: Record<string, unknown>;
};
};
};
};
};
}
/**
* 获取bitget wallet 钱包的defi活动
* @param params 提示词
* @returns 浏览器渲染的json
*/
export declare const fetchBrowserRenderJSON: (params: IBrowserRenderJSONParams) => Promise<any>;
/**
* 获取浏览器渲染的html,同时通过rejectResourceTypes过滤掉不需要的资源
* @param params
* @returns
*/
export declare const fetchBrowserRenderContent: (params: {
url: string;
rejectResourceTypes?: ["stylesheet" | "image" | "media" | "font" | "script"][];
waitForSelector?: {
selector: string;
};
}) => Promise<string>;
/**
* 获取指定页面指定元素的内容
* @param params 包含url和elements选择器数组
* @returns Cloudflare Browser Render API返回的内容
*/
export declare const fetchBrowserRenderScrape: (params: {
url: string;
elements: Array<{
selector: string;
}>;
}) => Promise<IBrowserRenderScrapeResult["results"]>;