@swishapp/browser
Version:
JS library to integrate Swish into a browser environment.
35 lines (34 loc) • 895 B
TypeScript
import type { SwishClientConfig } from "@swishapp/api-client";
import type { SwishApp } from "./swish";
export interface SwishAppOptions {
loadProfile?: () => Promise<string | null> | string | null;
storeProfile?: (profile: string) => Promise<void> | void;
deleteProfile?: () => Promise<void> | void;
proxy: {
baseUrl: string;
};
swishApi?: SwishClientConfig;
ui?: SwishUiOptions;
storefront?: {
host?: string;
version?: string;
accessToken?: string;
};
}
export interface SwishUiOptions {
host?: string;
manifest?: () => SwishUiManifest | Promise<SwishUiManifest>;
}
export interface SwishUiManifest {
elements: Record<string, string>;
version: string;
}
export interface SwishUiElementSpec {
script: string;
template: string;
}
declare global {
interface Window {
swish: SwishApp;
}
}