34 lines
1.7 KiB
TypeScript
34 lines
1.7 KiB
TypeScript
import type { ReactNode } from "react";
|
|
|
|
export type WatermarkStatus = "loading" | "ready" | "error" | "disabled";
|
|
export interface ForensicWatermarkProps {
|
|
/** Stable function that returns the current bearer token (never encoded into the image). */
|
|
getAccessToken: () => string | null | Promise<string | null>;
|
|
enabled?: boolean;
|
|
/** Defaults to the current-user endpoint on api.d.aiengines.ir. */
|
|
userUrl?: string;
|
|
/** SDK format: v3 (luma/FEC) by default; v2 retains the historical chroma renderer. */
|
|
version?: 2 | 3;
|
|
/** Default 0.03 for v3, 0.014 for v2; must satisfy 0 < opacity <= 0.08. */
|
|
opacity?: number;
|
|
/** Change on user switch to remove the old canvas and reload identity. */
|
|
sessionKey?: string | number | null;
|
|
onReady?: () => void;
|
|
onError?: (error: unknown) => void;
|
|
onStatusChange?: (status: WatermarkStatus) => void;
|
|
}
|
|
/** Standalone React component, with no requirement for BiProvider or Keycloak. */
|
|
export declare function ForensicWatermark(props: ForensicWatermarkProps): null;
|
|
|
|
export interface WatermarkProps extends Omit<ForensicWatermarkProps, "getAccessToken" | "onStatusChange"> {
|
|
/** Optional when <Keycloak /> is present. External getter is used only if Keycloak has no usable token. */
|
|
getAccessToken?: ForensicWatermarkProps["getAccessToken"];
|
|
/** Alias of getAccessToken, matching other modular UI Kit providers. */
|
|
getToken?: ForensicWatermarkProps["getAccessToken"];
|
|
/** Default false: allow host content while the watermark loads or if it fails. */
|
|
blockUntilReady?: boolean;
|
|
children?: ReactNode;
|
|
}
|
|
/** Marker component; declare directly under <BiProvider>, not inside application pages. */
|
|
export declare function Watermark(props: WatermarkProps): null;
|