調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
Blockly のインターフェース
Blockly では、インターフェースは、デフォルト オブジェクトを置き換えるためにオブジェクトが実装する必要がある関数を記述します。
インターフェースを実装するために特定のクラスを継承する必要はありません。適切な機能を提供し、インターフェースのコメントに説明されている要件を遵守している限り、内部でできることは何でも構いません。ただし、プラグインの一般的なパターンは、デフォルト クラスを拡張し、変更する関数のみをオーバーライドすることです。
タイプ チェッカーに、特定のインターフェースを実装することを示すには、クラスに @implements {InterfaceName}
アノテーションを付けます。
Blockly のインターフェースは core/interfaces で定義されています。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2022-12-05 UTC。
[null,null,["最終更新日 2022-12-05 UTC。"],[[["Blockly interfaces define functions objects must implement to replace default functionality."],["Implementing an interface doesn't require class inheritance, but adhering to function definitions and requirements is crucial."],["Annotate your class with `@implements {InterfaceName}` to indicate interface implementation to the type checker."],["While flexibility exists in implementation, extending the default class and overriding specific functions is a common pattern for plugins."],["Blockly's interface definitions are located in the `core/interfaces` directory of the repository."]]],[]]