36 lines
1.9 KiB
TypeScript
36 lines
1.9 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;
|
|
/** Default 6: WM-v6 Numeric5; 5 is WM-v5 Numeric5, 2/3/4 use legacy UUID. */
|
|
version?: 2 | 3 | 4 | 5 | 6;
|
|
/** Default "legacy"; v5 also allows "webp-research", v6 also allows "multi-scale". */
|
|
spatialProfile?: "legacy" | "webp-research" | "multi-scale";
|
|
/** Default 0.014 for all versions; explicit values preserved; 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;
|