Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > rejestr > getAllItems
Funkcja enroll.getAllItems()
Zwraca mapę elementów zarejestrowanych o podanym typie.
Podpis:
export declare function getAllItems<T>(type: string | Type<T>, opt_cased?: boolean, opt_throwIfMissing?: boolean): {
[key: string]: T | null | (new (...p1: any[]) => T);
} | null;
Parametry
Parametr |
Typ |
Opis |
typ |
ciąg znaków | Typ<T> |
Typ wtyczki. (np. Kategoria) |
opt_cased |
wartość logiczna |
(Opcjonalnie) Określa, czy zwrócić mapę z kluczami z wielkością liter (a nie z kluczami bez wielkości liter). Domyślna wartość to fałsz. |
opt_throwIfMissing |
wartość logiczna |
(Opcjonalnie) Określa, czy zgłosić błąd, jeśli nie możemy znaleźć obiektu. Domyślna wartość to fałsz. |
Zwroty:
{ [klucz: ciąg znaków]: T | null | (new (...p1: any[]) => T); } | wartość null
Mapa obiektów o danym typie lub wartości null, jeśli nie istnieje.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[],["The `registry.getAllItems()` function retrieves registered items of a specified type. It accepts a `type` (string or Type\u003cT\u003e) parameter to define the item category. Optional parameters include `opt_cased` for case-sensitive keys and `opt_throwIfMissing` to throw an error if no items are found. The function returns a map where keys are strings and values are items of the specified type, or it returns null if no items exist.\n"]]