import type { ClassName } from '@linaria/core/types/cx'; import type { ProsemirrorAttributes } from '@remirror/core-types'; import { AnyExtension, PlainExtension } from '../extension'; /** * This extension allows others extension to add the `createAttributes` method * for adding attributes to the prosemirror dom element. * * @remarks * * Use this to include all the dynamically generated attributes provided by each * extension. High priority extensions have preference over the lower priority * extensions. * * @category Builtin Extension */ export declare class AttributesExtension extends PlainExtension { get name(): "attributes"; private attributeList; private attributeObject; /** * Create the attributes object on initialization. * * @internal */ onCreate(): void; private readonly updateAttributes; private transformAttributes; } declare global { namespace Remirror { interface ManagerStore { /** * The attributes to be added to the prosemirror editor. */ attributes: ProsemirrorAttributes; } interface ExtensionStore { /** * Triggers a recalculation of the `view.dom` attributes for each * extension and notifies the parent UI once done. * * This will also dispatch an update to the state automatically. However * you can disable this by setting `triggerUpdate` to `false`. * * By not triggering an update the new value may not be capture by the view layer, e.g. `React`. * * @param triggerUpdate - defaults to true */ updateAttributes: (triggerUpdate?: boolean) => void; } interface ExcludeOptions { /** * Whether to use the attributes provided by this extension * * @defaultValue undefined */ attributes?: boolean; } interface BaseExtension { /** * A list of class names to add to the main editor element. */ classNames?: ClassName[]; /** * Allows the extension to modify the attributes for the Prosemirror editor * dom element. * * @remarks * * Sometimes an extension will need to make a change to the attributes of the * editor itself. For example a placeholder may need to do some work to make * the editor more accessible by setting the `aria-placeholder` value to match * the value of the placeholder. * * @alpha */ createAttributes?(): ProsemirrorAttributes; } interface AllExtensions { attributes: AttributesExtension; } } }