Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
blockly > fieldRegistry > kaydol
FieldRegistry.register() işlevi
Bir alan türü kaydeder. FieldRegistry.fromJson, uygun alan türünü bulmak için bu kayıt defterini kullanır.
İmza:
export declare function register(type: string, fieldClass: RegistrableField): void;
Parametreler
Parametre |
Tür |
Açıklama |
tür |
dize |
JSON tanımında kullanılan alan türü adı. |
fieldClass |
RegistrableField |
Alanın bir örneğini oluşturabilen bir fromJson işlevi içeren alan sınıfı. |
Şunu döndürür:
geçersiz
İstisnalar
Tür adı boşsa, alan zaten kayıtlıysa veya FieldClass, fromJson işlevi içeren bir nesne değilse {Error}.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-25 UTC."],[],["The `fieldRegistry.register()` function registers a field type for use with `fieldRegistry.fromJson`. It takes two parameters: `type` (a string representing the field type name) and `fieldClass` (a class with a `fromJson` function for constructing field instances). It returns void. The function throws an error if the type is empty, the field is already registered, or the class is invalid. It enables the system to find the appropriate field type during JSON parsing.\n"]]