Skip to content

Class: CatalogCategory#

Common.Catalog.CatalogCategory

Hierarchy#

CatalogCategory

Table of contents#

Constructors#

Properties#

Methods#

Constructors#

constructor#

new CatalogCategory()

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).constructor

Properties#

apiVersion#

Readonly Abstract apiVersion: string

The version of category that you are wanting to declare.

Currently supported values:

  • "catalog.k8slens.dev/v1alpha1"

filters#

Protected Readonly filters: ObservableSet<AddMenuFilter>


kind#

Readonly Abstract kind: string

The kind of item you wish to declare.

Currently supported values:

  • "CatalogCategory"

metadata#

Readonly Abstract metadata: CatalogCategoryMetadata

The data about the category itself


spec#

Readonly Abstract spec: CatalogCategorySpec

The most important part of a category, as it is where entity versions are declared.

Methods#

addListener#

addListener<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).addListener


addMenuFilter#

addMenuFilter(fn): Disposer

Add a filter for menu items of catalogAddMenu

Parameters#

Name Type Description
fn AddMenuFilter The function that should return a truthy value if that menu item should be displayed

Returns#

Disposer

A function to remove that filter


emit#

emit<E>(event, ...args): boolean

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
...args Arguments<CatalogCategoryEvents[E]>

Returns#

boolean

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).emit


eventNames#

eventNames(): (string | symbol)[]

Returns#

(string | symbol)[]

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).eventNames


filteredItems#

filteredItems(menuItems): CatalogEntityAddMenu[]

Filter menuItems according to the Category's set filters

Parameters#

Name Type Description
menuItems CatalogEntityAddMenu[] menu items to filter

Returns#

CatalogEntityAddMenu[]

filtered menu items


getBadge#

getBadge(): ReactNode

Get the badge of this category. Defaults to no badge. The badge is displayed next to the Category name in the Catalog Category menu

Returns#

ReactNode


getId#

getId(): string

Get the ID of this category

Returns#

string


getMaxListeners#

getMaxListeners(): number

Returns#

number

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).getMaxListeners


getName#

getName(): string

Get the name of this category

Returns#

string


listenerCount#

listenerCount<E>(event): number

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E

Returns#

number

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).listenerCount


listeners#

listeners<E>(event): Function[]

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E

Returns#

Function[]

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).listeners


off#

off<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).off


on#

on<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).on


once#

once<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).once


prependListener#

prependListener<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).prependListener


prependOnceListener#

prependOnceListener<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).prependOnceListener


rawListeners#

rawListeners<E>(event): Function[]

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E

Returns#

Function[]

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).rawListeners


removeAllListeners#

removeAllListeners<E>(event?): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event? E

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).removeAllListeners


removeListener#

removeListener<E>(event, listener): CatalogCategory

Type parameters#

Name Type
E extends keyof CatalogCategoryEvents

Parameters#

Name Type
event E
listener CatalogCategoryEvents[E]

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).removeListener


setMaxListeners#

setMaxListeners(maxListeners): CatalogCategory

Parameters#

Name Type
maxListeners number

Returns#

CatalogCategory

Inherited from#

(EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>).setMaxListeners


parseId#

Static parseId(id): Object

Parse a category ID into parts.

Parameters#

Name Type Description
id string The id of a category is parse

Returns#

Object

The group and kind parts of the ID

Name Type
group? string
kind? string