import detailsInterfaces = require("./detailsInterfaces"); import rp = require("raml-1-parser"); import hl = rp.hl; import lowLevel = rp.ll; import commonInterfaces = require("../common/commonInterfaces"); export declare function getDefaultValue(node: hl.IHighLevelNode, property: hl.IProperty): boolean; export declare function hasDefault(property: hl.IProperty): boolean; export interface InternalItem extends detailsInterfaces.DetailsItem { setParent(parent: detailsInterfaces.DetailsItem): any; item(name: string): detailsInterfaces.DetailsItem; clearErrors(): void; } /** * Abstract item implementation. */ export declare abstract class Item implements InternalItem { private title; private description; private parent; private error; constructor(title: string, description?: string); /** * Sets node value. * @param value */ abstract setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; needsSeparateLabel(): boolean; add(i: detailsInterfaces.DetailsItem): void; getParent(): detailsInterfaces.DetailsItem; setParent(parent: detailsInterfaces.DetailsItem): void; getRoot(): any; setDescription(desc: string): void; setTitle(t: string): void; item(name: string): detailsInterfaces.DetailsItem; setError(text: string): void; clearErrors(): void; /** * Node title. */ getTitle(): string; /** * Node description */ getDescription(): string; /** * Error, associated with the node. */ getError(): string; /** * Node children. */ getChildren(): detailsInterfaces.DetailsItem[]; /** * Node type name */ abstract getType(): detailsInterfaces.DetailsItemType; /** * Converts this node and its subnodes to JSON, recursivelly. */ abstract toJSON(): detailsInterfaces.DetailsItemJSON; /** * Returns item ID. */ abstract getId(): string; } /** * Item responsible for a single property value. */ export declare abstract class PropertyItem extends Item { property: hl.IProperty; protected node: hl.IHighLevelNode; constructor(property: hl.IProperty, node: hl.IHighLevelNode); getDefaultValue(): boolean; hasDefault(): boolean; setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; getValue(): string; toJSON(): detailsInterfaces.DetailsValuedItemJSON; /** * Returns item ID. */ getId(): string; /** * Node type name */ abstract getType(): detailsInterfaces.DetailsItemType; } /** * Complex item, containing several items from a single category. */ export declare class Category extends Item { _children: InternalItem[]; add(i: InternalItem): void; getChildren(): detailsInterfaces.DetailsItem[]; plainChildren(): InternalItem[]; categories(): InternalItem[]; item(name: string): detailsInterfaces.DetailsItem; clearErrors(): void; update(i: Item): void; getType(): detailsInterfaces.DetailsItemType; toJSON(): detailsInterfaces.DetailsValuedItemJSON; /** * Returns item ID. */ getId(): string; setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; } /** * Root item. */ export declare class TopLevelNode extends Category { protected node: hl.IHighLevelNode; getType(): detailsInterfaces.DetailsItemType; subCategoryByNameOrCreate(name: string): Item; addItemToCategory(name: string, it: InternalItem): void; constructor(node: hl.IHighLevelNode); dispose(): void; update(i: Item): void; } export declare class StructuredField extends PropertyItem { private stvalue; getType(): detailsInterfaces.DetailsItemType; constructor(pr: hl.IProperty, node: hl.IHighLevelNode, stvalue: hl.IStructuredValue); getValue(): string; getChildren(): detailsInterfaces.DetailsItem[]; } export declare class JSONSchemaField extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; needsSeparateLabel(): boolean; } export declare class TreeField extends Item { private input; private node; getType(): detailsInterfaces.DetailsItemType; findKeyValue(): { key: string; value: string; }; getTitle(): string; getValue(): string; toJSON(): detailsInterfaces.DetailsItemJSON; constructor(input: lowLevel.ILowLevelASTNode); getChildren(): detailsInterfaces.DetailsItem[]; getId(): string; setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; } export declare class XMLSchemaField extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; needsSeparateLabel(): boolean; } export declare class SelectBox extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; calculateOptions(): string[]; toJSON(): detailsInterfaces.DetailsItemWithOptionsJSON; } export declare class TypeSelectBox extends SelectBox { getType(): detailsInterfaces.DetailsItemType; } export declare var valueOptions: (x: rp.ds.rt.nominalInterfaces.IProperty, node: rp.hl.IHighLevelNode) => string[]; export declare class SimpleMultiEditor extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; getValue(): string; setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; } export declare class CheckBoxField extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; getValue(): string; toUIValue(value: string): any; } export declare class MarkdownField extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; needsSeparateLabel(): boolean; } export declare class TypeDisplayItem extends PropertyItem { getType(): detailsInterfaces.DetailsItemType; constructor(node: hl.IHighLevelNode); getTitle(): string; } export declare class LowLevelTreeField extends PropertyItem { private lowLevel; constructor(pr: hl.IProperty, node: hl.IHighLevelNode, lowLevel: lowLevel.ILowLevelASTNode, title?: string); getValue(): string; getChildren(): detailsInterfaces.DetailsItem[]; getType(): detailsInterfaces.DetailsItemType; toJSON(): detailsInterfaces.DetailsValuedItemJSON; } export declare class ExampleField extends PropertyItem { property: hl.IProperty; protected node: hl.IHighLevelNode; private text; constructor(property: hl.IProperty, node: hl.IHighLevelNode, text: string, title?: string); getType(): detailsInterfaces.DetailsItemType; setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; } export declare class XMLExampleField extends PropertyItem { property: hl.IProperty; protected node: hl.IHighLevelNode; private text; constructor(property: hl.IProperty, node: hl.IHighLevelNode, text: string, title?: string); getType(): detailsInterfaces.DetailsItemType; setValue(value: string | number | boolean): commonInterfaces.IChangedDocument; } export declare class AttributeTextField extends PropertyItem { property: hl.IProperty; protected node: hl.IHighLevelNode; constructor(property: hl.IProperty, node: hl.IHighLevelNode); getType(): detailsInterfaces.DetailsItemType; } export declare abstract class ActionItem implements InternalItem { private title; private description; private parent; private error; /** * Returns details item subtype. */ abstract getSubType(): detailsInterfaces.ActionItemSubType; /** * Returns item ID. */ abstract getId(): string; /** * Runs the action. */ abstract run(): commonInterfaces.IChangedDocument; /** * Converts this node and its subnodes to JSON, recursivelly. */ toJSON(): detailsInterfaces.DetailsActionItemJSON; constructor(title: string, description?: string); /** * Node type name */ getType(): detailsInterfaces.DetailsItemType; needsSeparateLabel(): boolean; add(i: Item): void; getParent(): detailsInterfaces.DetailsItem; setParent(parent: Item): void; getRoot(): any; setDescription(desc: string): void; setTitle(t: string): void; item(name: string): detailsInterfaces.DetailsItem; setError(text: string): void; clearErrors(): void; /** * Node title. */ getTitle(): string; /** * Node description */ getDescription(): string; /** * Error, associated with the node. */ getError(): string; /** * Node children. */ getChildren(): detailsInterfaces.DetailsItem[]; } export declare class InsertActionItem extends ActionItem { private value; private property; private node; constructor(value: string, property: hl.IProperty, node: hl.IHighLevelNode); /** * Returns details item subtype. */ getSubType(): detailsInterfaces.ActionItemSubType; /** * Returns item ID. */ getId(): string; run(): { uri: string; text: string; }; } export declare class DeleteActionItem extends ActionItem { private node; constructor(node: hl.IHighLevelNode); /** * Returns details item subtype. */ getSubType(): detailsInterfaces.ActionItemSubType; /** * Returns item ID. */ getId(): string; run(): { uri: string; text: string; }; }