/**
 * 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 { RichTextEditorComponent } from '@byline/core';
import type { ExtensionsList } from './field/config/extensions-list';
import type { EditorConfig } from './field/config/types';
/**
 * Inside `lexicalEditor((c) => ...)` the seed always carries an
 * `ExtensionsList`, so narrow the callback parameter so callers can write
 * `c.extensions.add(...)` without a non-null assertion.
 */
export type LexicalEditorConfigureInput = Omit<EditorConfig, 'extensions'> & {
    extensions: ExtensionsList;
};
type ConfigureFn = (config: LexicalEditorConfigureInput) => LexicalEditorConfigureInput;
/**
 * Returns a `RichTextEditorComponent` with editor settings baked in. Use
 * this at the registration site in your admin config when you want to
 * customise the editor across the whole installation; per-field
 * overrides via `RichTextField.editorConfig` continue to take precedence
 * at render time.
 *
 * The returned component is lazy: the editor module graph (RichTextField
 * + every built-in extension + the Lexical core) is dynamically imported
 * on first mount, so callers that merely *reference* `lexicalEditor` at
 * registration time don't drag the editor onto every bundle that touches
 * the registration. The `configure` callback runs once the chunk has
 * loaded, with the same seed it received before.
 *
 * The `configure` callback receives a deep clone of `defaultEditorConfig`
 * with `extensions` populated from `defaultExtensionsList()`. Mutate the
 * clone freely — it's local to this call. Use the chainable
 * `c.extensions.add(...)`, `.remove(...)`, `.replace(...)`, and
 * `.configure(...)` methods to manipulate the extension graph.
 *
 * Calling `lexicalEditor()` with no argument is equivalent to
 * registering `RichTextField` directly with the package defaults.
 *
 * @example
 * ```ts
 * import { lexicalEditor, TableExtension } from '@byline/richtext-lexical'
 *
 * defineClientConfig({
 *   fields: {
 *     richText: {
 *       editor: lexicalEditor((c) => {
 *         c.extensions.remove(TableExtension)        // drop a built-in
 *         c.settings.placeholderText = 'Start writing...'
 *         return c
 *       }),
 *     },
 *   },
 * })
 * ```
 */
export declare function lexicalEditor(configure?: ConfigureFn): RichTextEditorComponent;
export {};
