import { z } from "zod"; import { FieldData, GenericPortalData, GetResponse, ListParams, Query, GetResponseOne, FMRecord } from "./client-types.js"; declare const ZodOptions: z.ZodObject<{ scriptName: z.ZodString; layout: z.ZodOptional; }, "strip", z.ZodTypeAny, { scriptName: string; layout?: string | undefined; }, { scriptName: string; layout?: string | undefined; }>; export type ClientObjectProps = z.infer; declare class FileMakerError extends Error { readonly code: string; constructor(code: string, message: string); } /** * A client intended to be used in a webviewer. This client uses the `fm-webviewer-fetch` package to make requests. * It requires that you have a script in your FM file that passes the parameter to the `Execute Data API` script step * and returns the result back to the webviewer, according to the `fm-webviewer-fetch` spec. * @link https://fm-webviewer-fetch.proofgeist.com/ */ declare function DataApi(input: Opts, zodTypes?: { fieldData: z.AnyZodObject; portalData?: z.AnyZodObject; }): { list: { (): Promise>; (args: Opts["layout"] extends string ? ListParams & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : ListParams & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }): Promise>; }; listAll: { (): Promise[]>; (args: Opts["layout"] extends string ? ListParams & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : ListParams & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }): Promise[]>; }; get: (args: Opts["layout"] extends string ? (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & { recordId: number | string; }) & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & { recordId: number | string; }) & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }) => Promise>; find: (args: Opts["layout"] extends string ? (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & { /** * If true, a find that returns no results will retun an empty array instead of throwing an error. * @default false */ ignoreEmptyResult?: boolean; } & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & { /** * If true, a find that returns no results will retun an empty array instead of throwing an error. * @default false */ ignoreEmptyResult?: boolean; } & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }) => Promise>; findOne: (args: Opts["layout"] extends string ? (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }) => Promise>; findFirst: (args: Opts["layout"] extends string ? (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & { /** * If true, a find that returns no results will retun an empty array instead of throwing an error. * @default false */ ignoreEmptyResult?: boolean; } & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & { /** * If true, a find that returns no results will retun an empty array instead of throwing an error. * @default false */ ignoreEmptyResult?: boolean; } & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }) => Promise>; findAll: (args: Opts["layout"] extends string ? (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & Partial<{ /** * The layout to use for the request. */ layout: string; }> & { fetch?: RequestInit; } : (import("./client-types.js").ScriptParams & import("./client-types.js").PortalRangesParams & { "layout.response"?: string; dateformats?: "US" | "file_locale" | "ISO8601"; } & import("./client-types.js").RangeParams & { sort?: import("./client-types.js").Sort | import("./client-types.js").Sort[] | undefined; } & { query: Query | Query[]; timeout?: number; }) & { /** * The layout to use for the request. */ layout: string; } & { fetch?: RequestInit; }) => Promise[]>; }; export default DataApi; export { DataApi, FileMakerError };