跳转到正文

快速入门

GitHub

你可以使用我们的 AI 辅助设置来安装插件。使用以下命令将 Capgo skills 添加到你的 AI 工具中:

终端窗口
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

然后使用以下 prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-textinteraction` plugin in my project.

如果你更想手动设置,请运行以下命令安装插件,并按照下方各平台的说明操作:

终端窗口
bun add @capgo/capacitor-textinteraction
bunx cap sync
import { TextInteraction } from '@capgo/capacitor-textinteraction';
import { TextInteraction } from '@capgo/capacitor-textinteraction';
const result = await TextInteraction.toggle({ enabled: true });
console.log(result);
import { TextInteraction } from '@capgo/capacitor-textinteraction';
const result = await TextInteraction.isEnabled();
console.log(result);
  • 原生同步:运行 bunx cap sync 在插件升级后。
  • 唯一可信来源:信任 src/definitions.ts 在 GitHub 仓库中。

在 Capacitor WebView 上切换文本交互(选择)功能。

⚠️ 禁用文本交互后,所有文本输入控件在禁用期间都将无法使用。 请谨慎使用,并在需要输入文本时重新启用。

仅限 iOS。

import { TextInteraction } from '@capgo/capacitor-textinteraction';
const result = await TextInteraction.toggle({ enabled: true });
console.log(result);
export interface TextInteractionOptions {
/**
* Whether text interaction should be enabled or disabled. Disabling hides the
* magnifier lens reintroduced with iOS 15.
*/
enabled: boolean;
}
export interface TextInteractionResult {
/**
* `true` when the platform supports toggling text interaction (iOS >= 14.5), otherwise `false`.
*/
success: boolean;
/**
* Get the native Capacitor plugin version
*
* @returns {Promise<{ id: string }>} an Promise with version for this device
* @throws An error if the something went wrong
*/
getPluginVersion(): Promise<{ version: string }>;
}

本页面由插件的 src/definitions.ts生成。当上游的公共 API 发生变化时,请重新运行 sync。

如果你正在使用 快速入门 要规划 dashboard 和 API 操作,请将其连接到 使用 @capgo/capacitor-textinteraction 用于“使用 @capgo/capacitor-textinteraction”中的原生能力, API 概览 关于 API Overview 中的实现细节, 简介 关于 Introduction 中的实现细节, API 密钥 有关 API Keys 的实现细节,以及 设备 有关 Devices 的实现细节。