-
Notifications
You must be signed in to change notification settings - Fork 0
Category
hhh edited this page Feb 5, 2022
·
1 revision
/**
* Type of category tags.
*/
type CategoryTag = string | symbol;
/**
* Type of category records.
*/
type CategoryRecord = [CategoryTag, number];
/**
* Type of `Category` namespace.
*/
interface CategoryNamespace {
/**
* Max count of categories. (32)
*/
readonly MAX_COUNT: number;
/**
* Full category mask. (0xFFFF_FFFF)
*/
readonly FULL_MASK: number;
/**
* Category registry.
* (Used by `Category.for` & `Category.tagFor`.)
*/
registry: CategoryRecord[];
/**
* Current count of categories.
*/
count: number;
/**
* Get next category.
*/
readonly next: () => number;
/**
* Get a tagged category.
*/
readonly for: (tag: CategoryTag) => number;
/**
* Get the tag of specific category.
*/
readonly tagFor: (category: number) => CategoryTag | undefined;
}
/**
* Category-related APIs.
*/
const Category: CategoryNamespace;