import { SvelteComponent } from 'svelte';
import { JSONValue as JSONValue$1, JSONPath as JSONPath$1, JSONPatchDocument, JSONPointer } from 'immutable-json-patch';
import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
import Ajv, { Options } from 'ajv';

type TextContent = {
    text: string;
} | {
    json: undefined;
    text: string;
};
type JSONContent = {
    json: JSONValue$1;
} | {
    json: JSONValue$1;
    text: undefined;
};
type Content = JSONContent | TextContent;
type JSONParser = JSON;
interface JSONPathParser {
    parse: (pathStr: string) => JSONPath$1;
    stringify: (path: JSONPath$1) => string;
}
interface VisibleSection {
    start: number;
    end: number;
}
declare enum Mode {
    text = "text",
    tree = "tree",
    table = "table"
}
declare enum SelectionType {
    after = "after",
    inside = "inside",
    key = "key",
    value = "value",
    multi = "multi",
    text = "text"
}
declare enum CaretType {
    after = "after",
    key = "key",
    value = "value",
    inside = "inside"
}
interface CaretPosition {
    path: JSONPath$1;
    type: CaretType;
}
interface DocumentState {
    expandedMap: JSONPointerMap<boolean>;
    enforceStringMap: JSONPointerMap<boolean>;
    visibleSectionsMap: JSONPointerMap<VisibleSection[]>;
    selection: JSONSelection | null;
    sortedColumn: SortedColumn | null;
}
interface JSONPatchResult {
    json: JSONValue$1;
    previousJson: JSONValue$1;
    undo: JSONPatchDocument;
    redo: JSONPatchDocument;
}
type AfterPatchCallback = (patchedJson: JSONValue$1, patchedState: DocumentState) => {
    json?: JSONValue$1;
    state?: DocumentState;
} | undefined;
interface MultiSelection {
    type: SelectionType.multi;
    anchorPath: JSONPath$1;
    focusPath: JSONPath$1;
}
interface AfterSelection {
    type: SelectionType.after;
    path: JSONPath$1;
}
interface InsideSelection {
    type: SelectionType.inside;
    path: JSONPath$1;
}
interface KeySelection {
    type: SelectionType.key;
    path: JSONPath$1;
    edit?: boolean;
}
interface ValueSelection {
    type: SelectionType.value;
    path: JSONPath$1;
    edit?: boolean;
}
type JSONSelection = MultiSelection | AfterSelection | InsideSelection | KeySelection | ValueSelection;
interface TextSelection {
    type: SelectionType.text;
    ranges: {
        anchor: number;
        head: number;
    }[];
    main: number;
}
type JSONEditorSelection = JSONSelection | TextSelection;
type JSONPointerMap<T> = Record<JSONPointer, T>;
type ClipboardValues = Array<{
    key: string;
    value: JSONValue$1;
}>;
interface MenuButton {
    type: 'button';
    onClick: () => void;
    icon?: IconDefinition;
    text?: string;
    title?: string;
    className?: string;
    disabled?: boolean;
}
interface MenuDropDownButton {
    type: 'dropdown-button';
    main: MenuButton;
    width?: string;
    items: MenuButton[];
}
interface MenuLabel {
    type: 'label';
    text: string;
}
interface MenuSeparator {
    type: 'separator';
}
interface MenuSpace {
    type: 'space';
}
type MenuItem = MenuButton | MenuSeparator | MenuSpace;
type ContextMenuColumn = {
    type: 'column';
    items: Array<MenuButton | MenuDropDownButton | MenuLabel | MenuSeparator>;
};
type ContextMenuRow = {
    type: 'row';
    items: Array<MenuButton | MenuDropDownButton | ContextMenuColumn>;
};
type ContextMenuItem = MenuButton | MenuDropDownButton | MenuSeparator | ContextMenuRow;
interface MessageAction {
    text: string;
    title: string;
    icon?: IconDefinition;
    onClick?: () => void;
    onMouseDown?: () => void;
    disabled?: boolean;
}
declare enum ValidationSeverity {
    info = "info",
    warning = "warning",
    error = "error"
}
interface ValidationError {
    path: JSONPath$1;
    message: string;
    severity: ValidationSeverity;
}
interface NestedValidationError extends ValidationError {
    isChildError?: boolean;
}
type Validator = (json: JSONValue$1) => ValidationError[];
interface ParseError {
    position: number | null;
    line: number | null;
    column: number | null;
    message: string;
}
interface ContentParseError {
    parseError: ParseError;
    isRepairable: boolean;
}
interface ContentValidationErrors {
    validationErrors: ValidationError[];
}
type ContentErrors = ContentParseError | ContentValidationErrors;
interface RichValidationError extends ValidationError {
    line: number | null;
    column: number | null;
    from: number | null;
    to: number | null;
    actions: Array<{
        name: string;
        apply: () => void;
    }> | null;
}
interface TextLocation {
    path: JSONPath$1;
    line: number;
    column: number;
    from: number;
    to: number;
}
interface Section {
    start: number;
    end: number;
}
interface QueryLanguage {
    id: string;
    name: string;
    description: string;
    createQuery: (json: JSONValue$1, queryOptions: QueryLanguageOptions) => string;
    executeQuery: (json: JSONValue$1, query: string, parser: JSONParser) => JSONValue$1;
}
interface QueryLanguageOptions {
    filter?: {
        path?: string[];
        relation?: '==' | '!=' | '<' | '<=' | '>' | '>=';
        value?: string;
    };
    sort?: {
        path?: string[];
        direction?: 'asc' | 'desc';
    };
    projection?: {
        paths?: string[][];
    };
}
type OnChangeQueryLanguage = (queryLanguageId: string) => void;
interface OnChangeStatus {
    contentErrors: ContentErrors | null;
    patchResult: JSONPatchResult | null;
}
type OnChange = ((content: Content, previousContent: Content, status: OnChangeStatus) => void) | null;
type OnJSONSelect = (selection: JSONSelection) => void;
type OnSelect = (selection: JSONEditorSelection | null) => void;
type OnPatch = (operations: JSONPatchDocument, afterPatch?: AfterPatchCallback) => void;
type OnChangeText = (updatedText: string, afterPatch?: AfterPatchCallback) => void;
type OnSort = (params: {
    operations: JSONPatchDocument;
    rootPath: JSONPath$1;
    itemPath: JSONPath$1;
    direction: 1 | -1;
}) => void;
type OnFind = (findAndReplace: boolean) => void;
type OnPaste = (pastedText: string) => void;
type OnPasteJson = (pastedJson: {
    path: JSONPath$1;
    contents: JSONValue$1;
}) => void;
type OnExpand = (path: JSONPath$1) => boolean;
type OnRenderValue = (props: RenderValueProps) => RenderValueComponentDescription[];
type OnClassName = (path: JSONPath$1, value: JSONValue$1) => string | undefined;
type OnChangeMode = (mode: Mode) => void;
type OnContextMenu = (contextMenuProps: AbsolutePopupOptions) => void;
type RenderMenuContext = {
    mode: 'tree' | 'text' | 'table';
    modal: boolean;
};
type OnRenderMenu = (items: MenuItem[], context: RenderMenuContext) => MenuItem[] | undefined;
type OnRenderMenuWithoutContext = (items: MenuItem[]) => MenuItem[] | undefined;
type OnError = (error: Error) => void;
type OnFocus = () => void;
type OnBlur = () => void;
type OnSortModal = (props: SortModalCallback) => void;
type OnTransformModal = (props: TransformModalCallback) => void;
type OnJSONEditorModal = (props: JSONEditorModalCallback) => void;
type FindNextInside = (path: JSONPath$1) => JSONSelection | null;
interface SearchResult {
    items: ExtendedSearchResultItem[];
    itemsMap: JSONPointerMap<ExtendedSearchResultItem[]>;
    activeItem: ExtendedSearchResultItem | undefined;
    activeIndex: number | -1;
}
declare enum SearchField {
    key = "key",
    value = "value"
}
interface SearchResultItem {
    path: JSONPath$1;
    field: SearchField;
    fieldIndex: number;
    start: number;
    end: number;
}
interface ExtendedSearchResultItem extends SearchResultItem {
    active: boolean;
}
interface ValueNormalization {
    escapeValue: (unescapedValue: unknown) => string;
    unescapeValue: (escapedValue: string) => string;
}
type PastedJson = {
    contents: JSONValue$1;
    path: JSONPath$1;
} | undefined;
type EscapeValue = (value: JSONValue$1) => string;
type UnescapeValue = (escapedValue: string) => string;
interface DragInsideProps {
    json: JSONValue$1;
    selection: JSONSelection;
    deltaY: number;
    items: Array<{
        path: JSONPath$1;
        height: number;
    }>;
}
type DragInsideAction = {
    beforePath: JSONPath$1;
    offset: number;
} | {
    append: true;
    offset: number;
};
interface RenderedItem {
    path: JSONPath$1;
    height: number;
}
interface HistoryItem {
    undo: {
        patch: JSONPatchDocument | undefined;
        json: JSONValue$1 | undefined;
        text: string | undefined;
        state: DocumentState;
        textIsRepaired: boolean;
    };
    redo: {
        patch: JSONPatchDocument | undefined;
        json: JSONValue$1 | undefined;
        text: string | undefined;
        state: DocumentState;
        textIsRepaired: boolean;
    };
}
type InsertType = 'value' | 'object' | 'array' | 'structure';
interface PopupEntry {
    id: number;
    component: typeof SvelteComponent;
    props: Record<string, unknown>;
    options: AbsolutePopupOptions;
}
interface AbsolutePopupOptions {
    anchor?: Element;
    position?: 'top' | 'left';
    left?: number;
    top?: number;
    width?: number;
    height?: number;
    offsetTop?: number;
    offsetLeft?: number;
    showTip?: boolean;
    closeOnOuterClick?: boolean;
    onClose?: () => void;
}
interface JSONEditorPropsOptional {
    content?: Content;
    readOnly?: boolean;
    indentation?: number | string;
    tabSize?: number;
    mode?: Mode;
    mainMenuBar?: boolean;
    navigationBar?: boolean;
    statusBar?: boolean;
    askToFormat?: boolean;
    escapeControlCharacters?: boolean;
    escapeUnicodeCharacters?: boolean;
    flattenColumns?: true;
    parser?: JSONParser;
    validator?: Validator | null;
    validationParser?: JSONParser;
    pathParser?: JSONPathParser;
    queryLanguages?: QueryLanguage[];
    queryLanguageId?: string;
    onChangeQueryLanguage?: OnChangeQueryLanguage;
    onChange?: OnChange;
    onRenderValue?: OnRenderValue;
    onClassName?: OnClassName;
    onRenderMenu?: OnRenderMenu;
    onChangeMode?: OnChangeMode;
    onError?: OnError;
    onFocus?: OnFocus;
    onBlur?: OnBlur;
}
interface JSONEditorContext {
    readOnly: boolean;
    parser: JSONParser;
    normalization: ValueNormalization;
    getJson: () => JSONValue$1 | undefined;
    getDocumentState: () => DocumentState;
    findElement: (path: JSONPath$1) => Element | null;
    findNextInside: FindNextInside;
    focus: () => void;
    onPatch: (operations: JSONPatchDocument, afterPatch?: AfterPatchCallback) => JSONPatchResult;
    onSelect: OnJSONSelect;
    onFind: OnFind;
    onPasteJson: (newPastedJson: PastedJson) => void;
    onRenderValue: OnRenderValue;
}
interface TreeModeContext extends JSONEditorContext {
    getJson: () => JSONValue$1 | undefined;
    getDocumentState: () => DocumentState;
    findElement: (path: JSONPath$1) => Element | null;
    onInsert: (type: InsertType) => void;
    onExpand: (path: JSONPath$1, expanded: boolean, recursive?: boolean) => void;
    onExpandSection: (path: JSONPath$1, section: Section) => void;
    onContextMenu: OnContextMenu;
    onClassName: OnClassName;
    onDrag: (event: Event) => void;
    onDragEnd: () => void;
}
interface RenderValuePropsOptional {
    path?: JSONPath$1;
    value?: JSONValue$1;
    readOnly?: boolean;
    enforceString?: boolean;
    selection?: JSONSelection | null;
    searchResultItems?: SearchResultItem[];
    isEditing?: boolean;
    parser?: JSONParser;
    normalization?: ValueNormalization;
    onPatch?: TreeModeContext['onPatch'];
    onPasteJson?: OnPasteJson;
    onSelect?: OnJSONSelect;
    onFind?: OnFind;
    findNextInside?: FindNextInside;
    focus?: () => void;
}
interface RenderValueProps extends RenderValuePropsOptional {
    path: JSONPath$1;
    value: JSONValue$1;
    readOnly: boolean;
    enforceString: boolean;
    selection: JSONSelection | null;
    searchResultItems: SearchResultItem[] | undefined;
    isEditing: boolean;
    parser: JSONParser;
    normalization: ValueNormalization;
    onPatch: TreeModeContext['onPatch'];
    onPasteJson: OnPasteJson;
    onSelect: OnJSONSelect;
    onFind: OnFind;
    findNextInside: FindNextInside;
    focus: () => void;
}
interface JSONNodeProp {
    key: string;
    value: JSONValue$1;
    path: JSONPath$1;
    expandedMap: JSONPointerMap<boolean> | undefined;
    enforceStringMap: JSONPointerMap<boolean> | undefined;
    visibleSectionsMap: JSONPointerMap<VisibleSection[]> | undefined;
    validationErrorsMap: JSONPointerMap<NestedValidationError> | undefined;
    keySearchResultItemsMap: ExtendedSearchResultItem[] | undefined;
    valueSearchResultItemsMap: JSONPointerMap<ExtendedSearchResultItem[]> | undefined;
    selection: JSONSelection | null;
}
interface JSONNodeItem {
    index: number;
    value: JSONValue$1;
    path: JSONPath$1;
    expandedMap: JSONPointerMap<boolean> | undefined;
    enforceStringMap: JSONPointerMap<boolean> | undefined;
    visibleSectionsMap: JSONPointerMap<VisibleSection[]> | undefined;
    validationErrorsMap: JSONPointerMap<NestedValidationError> | undefined;
    searchResultItemsMap: JSONPointerMap<ExtendedSearchResultItem[]> | undefined;
    selection: JSONSelection | null;
}
interface DraggingState {
    initialTarget: Element;
    initialClientY: number;
    initialContentTop: number;
    selectionStartIndex: number;
    selectionItemsCount: number;
    items: RenderedItem[];
    offset: number;
    didMoveItems: boolean;
}
interface RenderValueComponentDescription {
    component: typeof SvelteComponent<RenderValuePropsOptional>;
    props: Record<string, unknown>;
}
interface TransformModalOptions {
    id?: string;
    rootPath?: JSONPath$1;
    onTransform?: (state: {
        operations: JSONPatchDocument;
        json: JSONValue$1;
        transformedJson: JSONValue$1;
    }) => void;
    onClose?: () => void;
}
interface TransformModalCallback {
    id: string;
    rootPath: JSONPath$1;
    json: JSONValue$1;
    onTransform: (operations: JSONPatchDocument) => void;
    onClose: () => void;
}
interface SortModalCallback {
    id: string;
    json: JSONValue$1;
    rootPath: JSONPath$1;
    onSort: OnSort;
    onClose: () => void;
}
interface JSONEditorModalCallback {
    content: Content;
    path: JSONPath$1;
    onPatch: OnPatch;
    onClose: () => void;
}
declare enum SortDirection {
    asc = "asc",
    desc = "desc"
}
interface TableCellIndex {
    rowIndex: number;
    columnIndex: number;
}
interface SortedColumn {
    path: JSONPath$1;
    sortDirection: SortDirection;
}
type JSONSchema = Record<string, unknown>;
type JSONSchemaDefinitions = Record<string, JSONSchema>;
type JSONSchemaEnum = Array<unknown>;

declare const __propDef$6: {
    props: {
        content?: Content | undefined;
        selection?: JSONEditorSelection | null | undefined;
        readOnly?: boolean | undefined;
        indentation?: string | number | undefined;
        tabSize?: number | undefined;
        mode?: Mode | undefined;
        mainMenuBar?: boolean | undefined;
        navigationBar?: boolean | undefined;
        statusBar?: boolean | undefined;
        askToFormat?: boolean | undefined;
        escapeControlCharacters?: boolean | undefined;
        escapeUnicodeCharacters?: boolean | undefined;
        flattenColumns?: boolean | undefined;
        parser?: JSON | undefined;
        validator?: Validator | null | undefined;
        validationParser?: JSON | undefined;
        pathParser?: JSONPathParser | undefined;
        queryLanguages?: QueryLanguage[] | undefined;
        queryLanguageId?: string | undefined;
        onChangeQueryLanguage?: OnChangeQueryLanguage | undefined;
        onChange?: OnChange | undefined;
        onSelect?: OnSelect | undefined;
        onRenderValue?: OnRenderValue | undefined;
        onClassName?: OnClassName | undefined;
        onRenderMenu?: OnRenderMenu | undefined;
        onChangeMode?: OnChangeMode | undefined;
        onError?: OnError | undefined;
        onFocus?: OnFocus | undefined;
        onBlur?: OnBlur | undefined;
        get?: (() => Content) | undefined;
        set?: ((newContent: Content) => Promise<void>) | undefined;
        update?: ((updatedContent: Content) => Promise<void>) | undefined;
        patch?: ((operations: JSONPatchDocument) => Promise<JSONPatchResult>) | undefined;
        select?: ((newSelection: JSONEditorSelection | null) => Promise<void>) | undefined;
        expand?: ((callback?: OnExpand) => Promise<void>) | undefined;
        transform?: ((options: TransformModalOptions) => void) | undefined;
        validate?: (() => ContentErrors | null) | undefined;
        acceptAutoRepair?: (() => Promise<Content>) | undefined;
        scrollTo?: ((path: JSONPath$1) => Promise<void>) | undefined;
        findElement?: ((path: JSONPath$1) => Element | null) | undefined;
        focus?: (() => Promise<void>) | undefined;
        refresh?: (() => Promise<void>) | undefined;
        updateProps?: ((props: JSONEditorPropsOptional) => Promise<void>) | undefined;
        destroy?: (() => Promise<void>) | undefined;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type JsonEditorProps = typeof __propDef$6.props;
type JsonEditorEvents = typeof __propDef$6.events;
type JsonEditorSlots = typeof __propDef$6.slots;
declare class JsonEditor extends SvelteComponent<JsonEditorProps, JsonEditorEvents, JsonEditorSlots> {
    get get(): () => Content;
    get set(): (newContent: Content) => Promise<void>;
    get update(): (updatedContent: Content) => Promise<void>;
    get patch(): (operations: JSONPatchDocument) => Promise<JSONPatchResult>;
    get select(): (newSelection: JSONEditorSelection | null) => Promise<void>;
    get expand(): (callback?: OnExpand | undefined) => Promise<void>;
    get transform(): (options: TransformModalOptions) => void;
    get validate(): () => ContentErrors | null;
    get acceptAutoRepair(): () => Promise<Content>;
    get scrollTo(): (path: JSONPath$1) => Promise<void>;
    get findElement(): (path: JSONPath$1) => Element | null;
    get focus(): () => Promise<void>;
    get refresh(): () => Promise<void>;
    get updateProps(): (props: JSONEditorPropsOptional) => Promise<void>;
    get destroy(): () => Promise<void>;
}

declare const __propDef$5: {
    props: {
        path: JSONPath$1;
        value: JSONValue$1;
        readOnly: boolean;
        onPatch: OnPatch;
        focus: () => void;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type BooleanToggleProps = typeof __propDef$5.props;
type BooleanToggleEvents = typeof __propDef$5.events;
type BooleanToggleSlots = typeof __propDef$5.slots;
declare class BooleanToggle extends SvelteComponent<BooleanToggleProps, BooleanToggleEvents, BooleanToggleSlots> {
}

declare const __propDef$4: {
    props: {
        path: JSONPath$1;
        value: string;
        readOnly: boolean;
        onPatch: OnPatch;
        focus: () => void;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type ColorPickerProps = typeof __propDef$4.props;
type ColorPickerEvents = typeof __propDef$4.events;
type ColorPickerSlots = typeof __propDef$4.slots;
declare class ColorPicker extends SvelteComponent<ColorPickerProps, ColorPickerEvents, ColorPickerSlots> {
}

declare const __propDef$3: {
    props: {
        path: JSONPath$1;
        value: JSONValue$1;
        parser: JSONParser;
        normalization: ValueNormalization;
        enforceString: boolean;
        onPatch: OnPatch;
        onPasteJson: OnPasteJson;
        onSelect: OnJSONSelect;
        onFind: OnFind;
        focus: () => void;
        findNextInside: FindNextInside;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type EditableValueProps = typeof __propDef$3.props;
type EditableValueEvents = typeof __propDef$3.events;
type EditableValueSlots = typeof __propDef$3.slots;
declare class EditableValue extends SvelteComponent<EditableValueProps, EditableValueEvents, EditableValueSlots> {
}

declare const __propDef$2: {
    props: {
        path: JSONPath$1;
        value: JSONValue$1;
        parser: JSONParser;
        readOnly: boolean;
        selection: JSONSelection | null;
        onPatch: OnPatch;
        options: {
            value: unknown;
            text: string;
        }[];
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type EnumValueProps = typeof __propDef$2.props;
type EnumValueEvents = typeof __propDef$2.events;
type EnumValueSlots = typeof __propDef$2.slots;
declare class EnumValue extends SvelteComponent<EnumValueProps, EnumValueEvents, EnumValueSlots> {
}

declare const __propDef$1: {
    props: {
        path: JSONPath;
        value: JSONValue;
        readOnly: boolean;
        normalization: ValueNormalization;
        parser: JSONParser;
        onSelect: OnJSONSelect;
        searchResultItems: ExtendedSearchResultItem[] | undefined;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type ReadonlyValueProps = typeof __propDef$1.props;
type ReadonlyValueEvents = typeof __propDef$1.events;
type ReadonlyValueSlots = typeof __propDef$1.slots;
declare class ReadonlyValue extends SvelteComponent<ReadonlyValueProps, ReadonlyValueEvents, ReadonlyValueSlots> {
}

declare const __propDef: {
    props: {
        value: number;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {};
};
type TimestampTagProps = typeof __propDef.props;
type TimestampTagEvents = typeof __propDef.events;
type TimestampTagSlots = typeof __propDef.slots;
declare class TimestampTag extends SvelteComponent<TimestampTagProps, TimestampTagEvents, TimestampTagSlots> {
}

declare function renderValue({ path, value, readOnly, enforceString, searchResultItems, isEditing, parser, normalization, onPatch, onPasteJson, onSelect, onFind, findNextInside, focus }: RenderValueProps): RenderValueComponentDescription[];

/**
 * Search the JSON schema for enums defined at given props.path. If found,
 * return an EnumValue renderer. If not found, return null. In that case you
 * have to fallback on the default valueRender function
 */
declare function renderJSONSchemaEnum(props: RenderValueProps, schema: JSONSchema, schemaDefinitions?: JSONSchemaDefinitions): RenderValueComponentDescription[] | null;

interface AjvValidatorOptions {
    schema: JSONSchema;
    schemaDefinitions?: JSONSchemaDefinitions;
    ajvOptions?: Options;
    onCreateAjv?: (ajv: Ajv) => Ajv | void;
}
/**
 * Create a JSON Schema validator powered by Ajv.
 * @param options
 * @property schema
 *                    The JSON schema to validate (required).
 * @property [schemaDefinitions=undefined]
 *                    An object containing JSON Schema definitions
 *                    which can be referenced using $ref
 * @property [ajvOptions=undefined]
 *                    Optional extra options for Ajv
 * @property [onCreateAjv=undefined]
 *                    An optional callback function allowing to apply additional
 *                    configuration on the provided Ajv instance, or return
 *                    your own Ajv instance and ignore the provided one.
 * @return Returns a validation function
 */
declare function createAjvValidator(options: AjvValidatorOptions): Validator;

declare const lodashQueryLanguage: QueryLanguage;

declare const javascriptQueryLanguage: QueryLanguage;

declare const jmespathQueryLanguage: QueryLanguage;

/**
 * Check whether a value is Content (TextContent or JSONContent)
 */
declare function isContent(content: unknown): content is Content;
/**
 * Check whether content contains text (and not JSON)
 */
declare function isTextContent(content: unknown): content is TextContent;
/**
 * Check whether content contains text (and not JSON)
 */
declare function isJSONContent(content: unknown): content is JSONContent;
/**
 * Convert Content into TextContent if it is JSONContent, else leave it as is
 */
declare function toTextContent(content: Content, indentation?: number | string | undefined, parser?: JSONParser): TextContent;
/**
 * Convert Content into TextContent if it is JSONContent, else leave it as is
 * @throws {SyntaxError} Will throw a parse error when the text contents does not contain valid JSON
 */
declare function toJSONContent(content: Content, parser?: JSONParser): JSONContent;
/**
 * Returns true when the (estimated) size of the contents exceeds the
 * provided maxSize.
 * @param content
 * @param maxSize  Maximum content size in bytes
 */
declare function isLargeContent(content: Content, maxSize: number): boolean;
/**
 * A rough, fast estimation on whether a document is larger than given size
 * when serialized.
 *
 * maxSize is an optional max size in bytes. When reached, size estimation will
 * be cancelled. This is useful when you're only interested in knowing whether
 * the size exceeds a certain maximum size.
 */
declare function estimateSerializedSize(content: Content, maxSize?: number): number;
/**
 * Check whether the actual functions of parse and stringify are strictly equal.
 * The object holding the functions may be a differing instance.
 */
declare function isEqualParser(a: JSONParser, b: JSONParser): boolean;

declare function isAfterSelection(selection: JSONEditorSelection | null): selection is AfterSelection;
declare function isInsideSelection(selection: JSONEditorSelection | null): selection is InsideSelection;
declare function isKeySelection(selection: JSONEditorSelection | null): selection is KeySelection;
declare function isValueSelection(selection: JSONEditorSelection | null): selection is ValueSelection;
declare function isMultiSelection(selection: JSONEditorSelection | null): selection is MultiSelection;
declare function createKeySelection(path: JSONPath$1, edit: boolean): KeySelection;
declare function createValueSelection(path: JSONPath$1, edit: boolean): ValueSelection;
declare function createInsideSelection(path: JSONPath$1): InsideSelection;
declare function createAfterSelection(path: JSONPath$1): AfterSelection;
declare function createMultiSelection(anchorPath: JSONPath$1, focusPath: JSONPath$1): MultiSelection;
declare function isEditingSelection(selection: JSONSelection | null): boolean;

/**
 **
 * Stringify an array with a path like ['items', '3', 'name'] into string like 'items[3].name'
 * Note that we allow all characters in a property name, like "item with spaces[3].name",
 * so this path is not usable as-is in JavaScript.
 */
declare function stringifyJSONPath(path: JSONPath$1): string;
/**
 * Parse a JSON path like 'items[3].name' into a path like ['items', '3', 'name']
 */
declare function parseJSONPath(pathStr: string): JSONPath$1;

/**
 * Example usage:
 *
 *   <script lang="ts">
 *      let clientWidth = 0
 *   </script>
 *
 *   <div use:resizeObserver={element => clientWidth = element.clientWidth}>
 *      My width is: {clientWidth}
 *   </div>
 */
declare function resizeObserver(element: Element, onResize: (element: Element) => void): {
    destroy: () => void;
};

type Callback = () => void;
/**
 * The provided callback is invoked when the user presses Escape,
 * but only the callback of the last registered component is invoked.
 *
 * This is useful for example when opening a model on top of another modal:
 * you only want the top modal to close on Escape, and not the second modal.
 */
declare function onEscape(element: Element, callback: Callback): {
    destroy: () => void;
};

declare function isMenuSpace(item: unknown): item is MenuSpace;
declare function isMenuSeparator(item: unknown): item is MenuSeparator;
declare function isMenuLabel(item: unknown): item is MenuLabel;
declare function isMenuButton(item: unknown): item is MenuButton;
declare function isMenuDropDownButton(item: unknown): item is MenuDropDownButton;
declare function isContextMenuRow(item: unknown): item is ContextMenuRow;
declare function isContextMenuColumn(item: unknown): item is ContextMenuColumn;
declare function isContentParseError(contentErrors: unknown): contentErrors is ContentParseError;
declare function isContentValidationErrors(contentErrors: unknown): contentErrors is ContentValidationErrors;

export { type AbsolutePopupOptions, type AfterPatchCallback, type AfterSelection, type AjvValidatorOptions, BooleanToggle, type CaretPosition, CaretType, type ClipboardValues, ColorPicker, type Content, type ContentErrors, type ContentParseError, type ContentValidationErrors, type ContextMenuColumn, type ContextMenuItem, type ContextMenuRow, type DocumentState, type DragInsideAction, type DragInsideProps, type DraggingState, EditableValue, EnumValue, type EscapeValue, type ExtendedSearchResultItem, type FindNextInside, type HistoryItem, type InsertType, type InsideSelection, type JSONContent, JsonEditor as JSONEditor, type JSONEditorContext, type JSONEditorModalCallback, type JSONEditorPropsOptional, type JSONEditorSelection, type JSONNodeItem, type JSONNodeProp, type JSONParser, type JSONPatchResult, type JSONPathParser, type JSONPointerMap, type JSONSchema, type JSONSchemaDefinitions, type JSONSchemaEnum, type JSONSelection, type KeySelection, type MenuButton, type MenuDropDownButton, type MenuItem, type MenuLabel, type MenuSeparator, type MenuSpace, type MessageAction, Mode, type MultiSelection, type NestedValidationError, type OnBlur, type OnChange, type OnChangeMode, type OnChangeQueryLanguage, type OnChangeStatus, type OnChangeText, type OnClassName, type OnContextMenu, type OnError, type OnExpand, type OnFind, type OnFocus, type OnJSONEditorModal, type OnJSONSelect, type OnPaste, type OnPasteJson, type OnPatch, type OnRenderMenu, type OnRenderMenuWithoutContext, type OnRenderValue, type OnSelect, type OnSort, type OnSortModal, type OnTransformModal, type ParseError, type PastedJson, type PopupEntry, type QueryLanguage, type QueryLanguageOptions, ReadonlyValue, type RenderMenuContext, type RenderValueComponentDescription, type RenderValueProps, type RenderValuePropsOptional, type RenderedItem, type RichValidationError, SearchField, type SearchResult, type SearchResultItem, type Section, SelectionType, SortDirection, type SortModalCallback, type SortedColumn, type TableCellIndex, type TextContent, type TextLocation, type TextSelection, TimestampTag, type TransformModalCallback, type TransformModalOptions, type TreeModeContext, type UnescapeValue, type ValidationError, ValidationSeverity, type Validator, type ValueNormalization, type ValueSelection, type VisibleSection, createAfterSelection, createAjvValidator, createInsideSelection, createKeySelection, createMultiSelection, createValueSelection, estimateSerializedSize, isAfterSelection, isContent, isContentParseError, isContentValidationErrors, isContextMenuColumn, isContextMenuRow, isEditingSelection, isEqualParser, isInsideSelection, isJSONContent, isKeySelection, isLargeContent, isMenuButton, isMenuDropDownButton, isMenuLabel, isMenuSeparator, isMenuSpace, isMultiSelection, isTextContent, isValueSelection, javascriptQueryLanguage, jmespathQueryLanguage, lodashQueryLanguage, onEscape, parseJSONPath, renderJSONSchemaEnum, renderValue, resizeObserver, stringifyJSONPath, toJSONContent, toTextContent };
