/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow strict
 */

import type {LexicalExtension, ElementNode, LexicalEditor} from 'lexical';
import type {NamedSignalsOutput} from '@lexical/extension/namedSignals';
import type {ReadonlySignal} from '@lexical/extension/signals';

export type CanIndentPredicate = (node: ElementNode) => boolean;

declare export function registerTabIndentation(
  editor: LexicalEditor,
  maxIndent?: number | ReadonlySignal<null | number>,
  $canIndent?: CanIndentPredicate | ReadonlySignal<CanIndentPredicate>,
): () => void;

export type TabIndentationConfig = {
  disabled: boolean,
  maxIndent: null | number,
  $canIndent?: CanIndentPredicate,
};

declare export var TabIndentationExtension: LexicalExtension<
  TabIndentationConfig,
  '@lexical/extension/TabIndentation',
  NamedSignalsOutput<TabIndentationConfig>,
  void,
>;
