UNPKG

@whop/iframe

Version:

Powers communication between Whop and your embedded app

84 lines (81 loc) 2.99 kB
import * as zod from 'zod'; import { S as ServerImplementation, w as whopServerSchema, C as ClientSDK } from './whop-server-CCmOBRgb.js'; /** * Create an iframe SDK for the container whop.com app. * This will implement the functions required by client apps. * Do not use this function when building apps */ declare function createSdkHost({ appId, onMessage, remoteWindow, remoteOrigin, }: { appId: string; remoteWindow: Window; remoteOrigin: string; onMessage: ServerImplementation<typeof whopServerSchema, true>; isDevelopment?: boolean; }): ClientSDK<zod.ZodDiscriminatedUnion<"event", [zod.ZodObject<{ event: zod.ZodLiteral<"appPing">; request: zod.ZodLiteral<"app_ping">; response: zod.ZodLiteral<"app_pong">; }, "strip", zod.ZodTypeAny, { event: "appPing"; request: "app_ping"; response: "app_pong"; }, { event: "appPing"; request: "app_ping"; response: "app_pong"; }>, zod.ZodObject<{ event: zod.ZodLiteral<"onColorThemeChange">; request: zod.ZodObject<{ appearance: zod.ZodOptional<zod.ZodEnum<["light", "dark"]>>; accentColor: zod.ZodOptional<zod.ZodString>; dangerColor: zod.ZodOptional<zod.ZodString>; grayColor: zod.ZodOptional<zod.ZodString>; infoColor: zod.ZodOptional<zod.ZodString>; successColor: zod.ZodOptional<zod.ZodString>; warningColor: zod.ZodOptional<zod.ZodString>; }, "strip", zod.ZodTypeAny, { appearance?: "light" | "dark" | undefined; accentColor?: string | undefined; dangerColor?: string | undefined; grayColor?: string | undefined; infoColor?: string | undefined; successColor?: string | undefined; warningColor?: string | undefined; }, { appearance?: "light" | "dark" | undefined; accentColor?: string | undefined; dangerColor?: string | undefined; grayColor?: string | undefined; infoColor?: string | undefined; successColor?: string | undefined; warningColor?: string | undefined; }>; response: zod.ZodVoid; }, "strip", zod.ZodTypeAny, { event: "onColorThemeChange"; request: { appearance?: "light" | "dark" | undefined; accentColor?: string | undefined; dangerColor?: string | undefined; grayColor?: string | undefined; infoColor?: string | undefined; successColor?: string | undefined; warningColor?: string | undefined; }; response?: void | undefined; }, { event: "onColorThemeChange"; request: { appearance?: "light" | "dark" | undefined; accentColor?: string | undefined; dangerColor?: string | undefined; grayColor?: string | undefined; infoColor?: string | undefined; successColor?: string | undefined; warningColor?: string | undefined; }; response?: void | undefined; }>]>, false> & { _cleanupTransport: () => void; }; export { createSdkHost };