Stay organized with collections
Save and categorize content based on your preferences.
blockly > registry > getAllItems
registry.getAllItems() function
Returns a map of items registered with the given type.
Signature:
export declare function getAllItems<T>(type: string | Type<T>, opt_cased?: boolean, opt_throwIfMissing?: boolean): {
[key: string]: T | null | (new (...p1: any[]) => T);
} | null;
Parameters
Parameter |
Type |
Description |
type |
string | Type<T> |
The type of the plugin. (e.g. Category) |
opt_cased |
boolean |
(Optional) Whether or not to return a map with cased keys (rather than caseless keys). False by default. |
opt_throwIfMissing |
boolean |
(Optional) Whether or not to throw an error if we are unable to find the object. False by default. |
Returns:
{ [key: string]: T | null | (new (...p1: any[]) => T); } | null
A map of objects with the given type, or null if none exists.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["`registry.getAllItems()` retrieves a collection of registered items of a specified type, organized in a map format."],["The function allows filtering by type, case sensitivity of keys, and error handling for missing objects, with optional parameters for customization."],["Returned items can be class instances, constructor functions, or null values, depending on the registry's content and the specified type."]]],["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"]]