react-native-mask-segment-c.../docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/api/index.md
a1518 bea6de3767 Add Docusaurus documentation site with i18n support
- Docusaurus 3.7.0 with both English and Chinese (zh-CN) locales
- Full API reference split into structured pages
- Homepage with hero, feature cards, and quick start section
- GitHub Actions workflow for auto-deployment to GitHub Pages

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 23:25:56 -07:00

2.1 KiB

id title
index API 参考

📖 API 参考

导入

import MaskSegmentCanvas, {
  type MaskSegmentCanvasRef,
  type MaskSegmentCanvasProps,
  type MaskSegmentSession,
  type MaskSegmentWatchState,
  type MaskSegmentWatchDetail,
  type BgrColor,
  type MaskSemanticColor,
  type PaintCallbackPayload,
  type PaintedRegionRecord,
  type PipelineConfig,
  type MaskSegmentConfig,
  type PaintConfig,
  type InteractionConfig,
  type SavePaintResult,
  MASK_SEMANTIC_COLORS,
  BASEBOARD_SEMANTIC_NAME,
  prewarmPngBgrCacheAsync,
  DEFAULT_PIPELINE_CONFIG,
  DEFAULT_MASK_CONFIG,
  DEFAULT_PAINT_CONFIG,
  DEFAULT_INTERACTION_CONFIG,
} from 'react-native-mask-segment-canvas';
分类 名称
组件 MaskSegmentCanvas(默认导出)
Ref / Props 类型 MaskSegmentCanvasRef, MaskSegmentCanvasProps
会话 / 回调类型 MaskSegmentSession, PaintCallbackPayload, PaintedRegionRecord, SavePaintResult
Watch 类型 MaskSegmentWatchState, MaskSegmentWatchDetail
配置类型 PipelineConfig, MaskSegmentConfig, PaintConfig, InteractionConfig
语义颜色 MASK_SEMANTIC_COLORS, BASEBOARD_SEMANTIC_NAME
工具函数 prewarmPngBgrCacheAsync
运行时默认值 DEFAULT_*_CONFIG

Props 概览

分类 描述
图像与初始化 originUrl, maskUrl, initialSession, initialPaintColor
语义颜色与轮廓 semanticColors, regionOutlineColor
maskConfig 分割和语义区域配置
pipelineConfig 分辨率和处理管线配置
paintConfig 上色渲染和纹理混合配置
interactionConfig 触摸交互和命中测试配置
UI 控件与样式 可见性开关、自定义渲染器、样式
回调 onWatch, onPaintCallback, onError
Ref 方法 通过 ref 调用的命令式方法
存储约定 会话持久化和 PNG 导出