Skip to content

[Doc Review] cancel type mismatch and missing ToolbarButton docs #48

@Tom-Dynamsoft

Description

@Tom-Dynamsoft

Documentation Issue: cancel button type and missing ToolbarButton interface docs

Category: Accuracy + Completeness
Severity: Error + Warning
Found by: docs-updater review mode (2026-02-25)
SDK: MRZ Scanner JavaScript Edition
Finding IDs: A3, C6

Problem

  1. The cancel property in MRZResultViewToolbarButtonsConfig is documented as ToolbarButtonConfig, but in the SDK source it is ToolbarButton (the full interface with id, onClick, and isDisabled properties).
  2. The ToolbarButton interface is not documented anywhere in the API reference — only ToolbarButtonConfig is documented.

Location

  • Docs file: api/mrz-scanner.md — MRZResultViewToolbarButtonsConfig section
  • Source: dist/mrz-scanner.d.ts

Expected (from source)

interface MRZResultViewToolbarButtonsConfig {
  cancel?: ToolbarButton;   // Full ToolbarButton, not ToolbarButtonConfig
  rescan?: ToolbarButtonConfig;
  done?: ToolbarButtonConfig;
}

interface ToolbarButton {
  id: string;
  icon: string;
  label: string;
  onClick?: () => void | Promise<void>;
  className?: string;
  isDisabled?: boolean;
  isHidden?: boolean;
}

Actual (in docs)

cancel typed as ToolbarButtonConfig, and ToolbarButton interface is not documented.

Recommended Fix

  1. Change the type of cancel from ToolbarButtonConfig to ToolbarButton.
  2. Add a new documentation section for the ToolbarButton interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationreview-findingFinding from automated documentation review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions