UNPKG

@foxpage/foxpage-node-sdk

Version:

foxpage node sdk

68 lines (67 loc) 2.19 kB
import { Application, FoxpageRequestOptions, Page, ParsedDSL } from '@foxpage/foxpage-types'; /** * render to html by pageId * @param pageId page id * @param appId application id * @returns html string */ export declare const renderToHtmlByPageId: (pageId: string, appId: string, opt: FoxpageRequestOptions) => Promise<string | null>; /** * render by pageId * @param pageId page id * @param appId application id * @returns html string */ export declare const renderByPageId: (pageId: string, appId: string, opt: FoxpageRequestOptions) => Promise<{ html: string | null; dsl: import("@foxpage/foxpage-types").ContextPage | undefined; vars: Record<string, unknown> & { has?: ((key: string) => boolean) | undefined; }; contextValue: import("@foxpage/foxpage-types").Context; }>; /** * render to html by page info * @param page page info * @param app app * @returns html */ export declare function renderToHtmlByPage(page: Page, app: Application | string, opt: FoxpageRequestOptions & { ignoreParse?: boolean; }): Promise<{ html: string | null; dsl: import("@foxpage/foxpage-types").ContextPage | undefined; vars: Record<string, unknown> & { has?: ((key: string) => boolean) | undefined; }; contextValue: import("@foxpage/foxpage-types").Context; }>; /** * render to html by dsl * @param dsl * @param app * @param opt * @returns */ export declare function renderToHtmlByDSL(dsl: ParsedDSL, app: Application | string, opt: FoxpageRequestOptions & { ignoreParse?: boolean; errorThrow?: boolean; }): Promise<{ html: string | null; }>; /** * render html by file id and locale * @param fileId file id * @param locale locale * @param appId application id * @param opt options * @returns */ export declare const renderToHtmlByFileIdAndLocale: (fileId: string, locale: string | undefined, appId: string, opt: FoxpageRequestOptions) => Promise<{ html: string | null; dsl: import("@foxpage/foxpage-types").ContextPage | undefined; vars: Record<string, unknown> & { has?: ((key: string) => boolean) | undefined; }; contextValue: import("@foxpage/foxpage-types").Context; }>;