/**
 * This Source Code is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Copyright (c) Infonomic Company Limited
 */
import { type AnyLexicalExtension, type AnyLexicalExtensionArgument, type LexicalExtensionConfig } from 'lexical';
/**
 * Chainable wrapper around an ordered list of Lexical extensions. Used
 * inside the `lexicalEditor((c) => ...)` configure callback so site
 * authors can add, remove, configure, or reorder extensions before the
 * editor is built.
 *
 * Comparison is by extension `name` so a bare `LinkExtension` and a
 * `configExtension(LinkExtension, {...})` tuple are treated as the same
 * entry.
 */
export declare class ExtensionsList {
    private items;
    constructor(items?: ReadonlyArray<AnyLexicalExtensionArgument>);
    /** Append `extension` to the end of the list. */
    add(extension: AnyLexicalExtensionArgument): this;
    /**
     * Remove every entry whose name matches `extension.name`. No-op when
     * the extension isn't present.
     */
    remove(extension: AnyLexicalExtension): this;
    /** Replace `oldExtension` with `newExtension`, preserving position. */
    replace(oldExtension: AnyLexicalExtension, newExtension: AnyLexicalExtensionArgument): this;
    /**
     * Re-wrap an existing extension entry with a fresh `configExtension`
     * binding the supplied config. If the extension isn't present, it is
     * added. If it was already wrapped with `configExtension`, the wrapper
     * is replaced rather than nested.
     */
    configure<Extension extends AnyLexicalExtension>(extension: Extension, config: Partial<LexicalExtensionConfig<Extension>>): this;
    /** True when an entry with the same `name` is present. */
    has(extension: AnyLexicalExtension): boolean;
    /** Independent copy — safe to hand to a configure callback. */
    clone(): ExtensionsList;
    /** The list as a plain array, ready for `defineExtension({ dependencies })`. */
    toArray(): AnyLexicalExtensionArgument[];
}
