/** * `LicenseService`: per-`DockviewComponent` license gate (the enterprise module). * * The whole package is enterprise, so its mere presence means enterprise is in * use: this service validates the key on construction and, unless a valid key * is set, renders a small inline-styled corner watermark and logs one console * warning. Features are never disabled; the watermark is the enforcement. * * Zero core footprint: the `ServiceCollection` slot is declaration-merged onto * `dockview` (never declared in `dockview-core`), the watermark anchors to the * existing generic `rootElement`, the watermark is styled inline (no core SCSS), * and all contracts live in this package. */ import { DockviewIDisposable as IDisposable } from 'dockview'; import { LicenseState } from './licenseValidator'; declare module 'dockview' { interface ServiceCollection { licenseService?: ILicenseService; } } /** Narrow host surface, satisfied structurally by `DockviewComponent`. */ export interface ILicenseHost { /** Generic shell-element anchor (DockviewComponent's existing `rootElement`). */ readonly rootElement: HTMLElement; } export interface ILicenseService extends IDisposable { readonly state: LicenseState; readonly isValid: boolean; /** Re-read the key + re-evaluate the watermark (after a late setLicenseKey). */ refresh(): void; } export interface LicenseServiceOptions { /** * Injectable dockview release date for deterministic tests. Defaults to the * baked-in `DOCKVIEW_RELEASE_DATE`. Enforcement is version-based, so this is * the build's publish date, not the current wall-clock time. */ releaseDate?: () => Date; } export declare class LicenseService implements ILicenseService { private readonly host; private readonly options; private _state; private _watermark; private _caption; constructor(host: ILicenseHost, options?: LicenseServiceOptions); get state(): LicenseState; get isValid(): boolean; refresh(): void; dispose(): void; private releaseDate; private evaluate; private warnBadState; private watermarkText; private renderWatermark; private removeWatermark; } export declare const LicenseModule: import("dockview").DockviewModule;