Blockly가 2025년 11월 10일에 Raspberry Pi Foundation으로 이전되었습니다. 블로그 게시물과 FAQ를 읽어보세요.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
차단 > IConnectionChecker
IConnectionChecker 인터페이스
연결 유형 확인 로직의 클래스입니다.
서명:
export interface IConnectionChecker
메서드
| 메서드 |
설명 |
| canConnect(a, b, isDragging, opt_distance) |
현재 연결이 대상 연결과 연결될 수 있는지 확인합니다. |
| canConnectWithReason(a, b, isDragging, opt_distance) |
현재 연결이 대상 연결과 연결될 수 있는지 확인하고 문제가 있으면 오류 코드를 반환합니다. |
| doDragChecks(a, b, distance) |
드래그하여 연결할 수 있는지 확인하세요. |
| doSafetyChecks(a, b) |
지정된 연결이 안전한지 확인합니다. 즉, Blockly의 기본적인 가정을 위반하지 않는지 (예: 자체 연결 없음) 확인합니다. |
| doTypeChecks(a, b) |
이 연결이 값 유형 시스템과 관련하여 다른 연결과 호환되는지 확인하세요. 예: Square_root("Hello")와 호환되지 않습니다. |
| getErrorMessage(errorCode, a, b) |
연결 오류 코드를 문자열로 변환하는 도우미 메서드입니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],["The `IConnectionChecker` interface defines methods for validating connections in a visual programming environment. It allows checking if two connections (`a` and `b`) can connect, with or without error codes using `canConnect` and `canConnectWithReason`. Dragging connections are validated via `doDragChecks`. `doSafetyChecks` verifies the safety of a connection, while `doTypeChecks` confirms compatibility based on value types. `getErrorMessage` converts error codes into user-friendly messages.\n"]]