UNPKG

2.49 kBTypeScriptView Raw
1import { SerializeOptions, Serializable, Collection, CollectionBuilder } from './StructureNodes';
2import { SchemaType } from './parts/Schema';
3import { ChildResolver } from './ChildResolver';
4import { DocumentListBuilder } from './DocumentList';
5import { Partial } from './Partial';
6import { ListBuilder } from './List';
7import { EditorBuilder } from './Editor';
8import { ComponentBuilder } from './Component';
9declare type UnserializedListItemChild = Collection | CollectionBuilder | ChildResolver;
10declare type ListItemChild = Collection | ChildResolver | undefined;
11interface ListItemSerializeOptions extends SerializeOptions {
12 titleIsOptional?: boolean;
13}
14interface ListItemDisplayOptions {
15 showIcon?: boolean;
16}
17export interface ListItemInput {
18 id: string;
19 title?: string;
20 icon?: Function;
21 child?: ListItemChild;
22 displayOptions?: ListItemDisplayOptions;
23 schemaType?: SchemaType | string;
24}
25export interface ListItem {
26 id: string;
27 type: string;
28 title?: string;
29 icon?: Function;
30 child?: ListItemChild;
31 displayOptions?: ListItemDisplayOptions;
32 schemaType?: SchemaType;
33}
34export interface UnserializedListItem {
35 id: string;
36 title: string;
37 icon?: Function;
38 child?: UnserializedListItemChild;
39 displayOptions?: ListItemDisplayOptions;
40 schemaType?: SchemaType | string;
41}
42declare type PartialListItem = Partial<UnserializedListItem>;
43export declare class ListItemBuilder implements Serializable {
44 protected spec: PartialListItem;
45 constructor(spec?: ListItemInput);
46 id(id: string): ListItemBuilder;
47 getId(): string | undefined;
48 title(title: string): ListItemBuilder;
49 getTitle(): string | undefined;
50 icon(icon: Function): ListItemBuilder;
51 showIcon(enabled: boolean): ListItemBuilder;
52 getShowIcon(): boolean | undefined;
53 getIcon(): Function | undefined;
54 child(child: UnserializedListItemChild): ListItemBuilder;
55 getChild(): EditorBuilder | import("./StructureNodes").EditorNode | import("./List").List | import("./DocumentList").DocumentList | import("./Component").Component | ListBuilder | DocumentListBuilder | import("./DocumentTypeList").DocumentTypeListBuilder | ComponentBuilder | ChildResolver | undefined;
56 schemaType(schemaType: SchemaType | string): ListItemBuilder;
57 getSchemaType(): string | SchemaType | undefined;
58 serialize(options?: ListItemSerializeOptions): ListItem;
59 clone(withSpec?: PartialListItem): ListItemBuilder;
60}
61export {};