import { z } from "zod"; import type { WidgetActionResult as ProtoWidgetActionResult, WidgetConfig as ProtoWidgetConfig, WidgetGetWidgetsOutput as ProtoGetWidgetsOutput, WidgetNameDescI18n as ProtoNameDescI18n } from "../gen/channel/app/sdk/v1/extension.js"; type ProtoBacked = T & Proto; /** * Widget scope - where the widget is displayed */ export declare const WidgetScope: z.ZodEnum<["front", "desk"]>; export type WidgetScope = z.infer; /** * Widget type - how the widget behaves */ export declare const WidgetType: z.ZodEnum<["wam", "snippet"]>; export type WidgetType = z.infer; /** * I18n name/description pair */ export declare const NameDescI18nSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>; export type NameDescI18n = ProtoBacked, ProtoNameDescI18n>; /** * Widget metadata schema returned from extension.widget.metadata.getWidgets. * * This matches Channel App platform's metadata registration contract. Snippet widgets * that rely on `snippetApiUrl` should use the dedicated snippet registration * APIs instead of metadata discovery. */ export declare const WidgetConfigSchema: z.ZodUnion<[z.ZodObject<{ name: z.ZodString; /** * App function invoked when the widget is opened or triggered. */ actionFunctionName: z.ZodString; /** * System version used when invoking widget functions */ systemVersion: z.ZodOptional; /** * Default widget title displayed by AppStore/Desk. */ defaultName: z.ZodOptional; /** * Default widget description displayed by AppStore/Desk. */ defaultDescription: z.ZodOptional; /** * i18n default name/description map keyed by language code. */ defaultNameDescI18nMap: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>>>; } & { scope: z.ZodEnum<["front", "desk"]>; widgetType: z.ZodOptional>; }, "strip", z.ZodTypeAny, { name: string; scope: "front" | "desk"; actionFunctionName: string; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; widgetType?: "wam" | undefined; }, { name: string; scope: "front" | "desk"; actionFunctionName: string; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; widgetType?: "wam" | undefined; }>, z.ZodObject<{ name: z.ZodString; /** * App function invoked when the widget is opened or triggered. */ actionFunctionName: z.ZodString; /** * System version used when invoking widget functions */ systemVersion: z.ZodOptional; /** * Default widget title displayed by AppStore/Desk. */ defaultName: z.ZodOptional; /** * Default widget description displayed by AppStore/Desk. */ defaultDescription: z.ZodOptional; /** * i18n default name/description map keyed by language code. */ defaultNameDescI18nMap: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>>>; } & { scope: z.ZodLiteral<"desk">; widgetType: z.ZodLiteral<"snippet">; }, "strip", z.ZodTypeAny, { name: string; scope: "desk"; actionFunctionName: string; widgetType: "snippet"; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; }, { name: string; scope: "desk"; actionFunctionName: string; widgetType: "snippet"; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; }>]>; export type WidgetConfig = ProtoBacked, ProtoWidgetConfig>; /** * Metadata response schema for widget registration */ export declare const GetWidgetsOutputSchema: z.ZodObject<{ widgets: z.ZodArray; /** * Default widget title displayed by AppStore/Desk. */ defaultName: z.ZodOptional; /** * Default widget description displayed by AppStore/Desk. */ defaultDescription: z.ZodOptional; /** * i18n default name/description map keyed by language code. */ defaultNameDescI18nMap: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>>>; } & { scope: z.ZodEnum<["front", "desk"]>; widgetType: z.ZodOptional>; }, "strip", z.ZodTypeAny, { name: string; scope: "front" | "desk"; actionFunctionName: string; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; widgetType?: "wam" | undefined; }, { name: string; scope: "front" | "desk"; actionFunctionName: string; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; widgetType?: "wam" | undefined; }>, z.ZodObject<{ name: z.ZodString; /** * App function invoked when the widget is opened or triggered. */ actionFunctionName: z.ZodString; /** * System version used when invoking widget functions */ systemVersion: z.ZodOptional; /** * Default widget title displayed by AppStore/Desk. */ defaultName: z.ZodOptional; /** * Default widget description displayed by AppStore/Desk. */ defaultDescription: z.ZodOptional; /** * i18n default name/description map keyed by language code. */ defaultNameDescI18nMap: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; description?: string | undefined; }, { name: string; description?: string | undefined; }>>>; } & { scope: z.ZodLiteral<"desk">; widgetType: z.ZodLiteral<"snippet">; }, "strip", z.ZodTypeAny, { name: string; scope: "desk"; actionFunctionName: string; widgetType: "snippet"; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; }, { name: string; scope: "desk"; actionFunctionName: string; widgetType: "snippet"; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; }>]>, "many">; }, "strip", z.ZodTypeAny, { widgets: ({ name: string; scope: "front" | "desk"; actionFunctionName: string; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; widgetType?: "wam" | undefined; } | { name: string; scope: "desk"; actionFunctionName: string; widgetType: "snippet"; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; })[]; }, { widgets: ({ name: string; scope: "front" | "desk"; actionFunctionName: string; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; widgetType?: "wam" | undefined; } | { name: string; scope: "desk"; actionFunctionName: string; widgetType: "snippet"; systemVersion?: string | undefined; defaultName?: string | undefined; defaultDescription?: string | undefined; defaultNameDescI18nMap?: Record | undefined; })[]; }>; export type GetWidgetsOutput = ProtoBacked, ProtoGetWidgetsOutput>; /** * Widget action result schema — matches AppStore action payloads. */ export declare const WidgetActionResultSchema: z.ZodObject<{ type: z.ZodString; attributes: z.ZodOptional>; }, "strict", z.ZodTypeAny, { type: string; attributes?: Record | undefined; }, { type: string; attributes?: Record | undefined; }>; export type WidgetActionResult = ProtoBacked, ProtoWidgetActionResult>; export {}; //# sourceMappingURL=widget.d.ts.map