UNPKG

1.01 kBTypeScriptView Raw
1/** @deprecated use CreateNewItem */
2export declare type ICreateNewItem = CreateNewItem;
3/**
4 * The reserved type of the "Create Item" option in item lists. This is intended
5 * not to conflict with any custom item type `T` that might be used in item
6 * list.
7 */
8export interface CreateNewItem {
9 __blueprintCreateNewItemBrand: "blueprint-create-new-item";
10}
11/** Returns an instance of a "Create Item" object. */
12export declare function getCreateNewItem(): CreateNewItem;
13/**
14 * Type guard returning `true` if the provided item (e.g. the current
15 * `activeItem`) is a "Create Item" option.
16 */
17export declare function isCreateNewItem<T>(item: T | CreateNewItem | null | undefined): item is CreateNewItem;
18/**
19 * Returns the type of the the current active item. This will be a no-op unless
20 * the `activeItem` is `undefined` or a "Create Item" option, in which case
21 * `null` will be returned instead.
22 */
23export declare function getActiveItem<T>(activeItem: T | CreateNewItem | null | undefined): T | null;