Type Alias: McpedlCategory
McpedlCategory =
"downloading"
|"mods"
|"maps"
|"textures"
|"shaders"
Defined in: src/mcpedl-search/mcpedl.ts:7
Overview
The McpedlCategory
type alias represents the supported content categories available on the MCPEDL platform. Developers can utilize this type to manage and categorize content efficiently within their applications interacting with MCPEDL.
Supported Categories
"downloading"
: Indicates contents currently in the process of being downloaded."mods"
: Refers to modifications that enhance gameplay or add new features."maps"
: Represents creative worlds and levels made by users."textures"
: Denotes graphical enhancements or replacements for in-game assets."shaders"
: Pertains to advanced visual effects that improve the gameโs lighting and shading.
Usage
When defining variables or parameters related to MCPEDL content, you can leverage the McpedlCategory
type to ensure that only valid category strings are used.
Example
function filterContentByCategory(category: McpedlCategory) {
switch (category) {
case "downloading":
// Handle downloading content
break;
case "mods":
// Handle mods content
break;
case "maps":
// Handle maps content
break;
case "textures":
// Handle textures content
break;
case "shaders":
// Handle shaders content
break;
default:
throw new Error("Invalid category");
}
}
Remarks
Using the McpedlCategory
type enhances code clarity and maintainability by enforcing specific content categories, reducing the likelihood of errors associated with invalid values.
Last updated on