Message API/docs/components/placement/api

API References

Technical reference for placement-related viewer messages.

Stamp Control

Use `stampControl` to open or close the viewer stamp placement UI, and use `uploadStamp` when the host needs to add remote stamp URLs into the active viewer session.

interface StampControlMessage {
  type: 'stampControl';
  payload: {
    command: 'open' | 'close';
    requestId?: string;
  };
}

interface UploadStampMessage {
  type: 'uploadStamp';
  payload: {
    requestId?: string;
    urls: string[];
    openStampPanel?: boolean;
  };
}

interface UploadStampResultEvent {
  type: 'uploadStampResult';
  payload: {
    requestId?: string;
    success?: boolean;
    opened?: boolean;
    results?: Array<{
      source?: string;
      success?: boolean;
      error?: string;
      stamp?: Record<string, unknown>;
    }>;
  };
}
Stamp Control

Symbols Control

Use `symbolsControl` to open, close, or toggle the viewer symbols panel and listen for `symbolsControlResult` to observe the applied state.

interface SymbolsControlMessage {
  type: 'symbolsControl';
  payload: {
    command: 'open' | 'close' | 'toggle';
    requestId?: string;
  };
}

interface SymbolsControlResultEvent {
  type: 'symbolsControlResult';
  payload: {
    success?: boolean;
    requestId?: string;
    command?: 'open' | 'close' | 'toggle' | string;
    opened?: boolean;
    error?: string;
  };
}
Symbols Control