UNPKG

2.67 kBTypeScriptView Raw
1import type { GetStaticAndDynamic, ValueOf } from '@remirror/core-types';
2import { AttributesExtension } from './attributes-extension';
3import { CommandsExtension } from './commands-extension';
4import { DecorationsExtension, DecorationsOptions } from './decorations-extension';
5import { HelpersExtension } from './helpers-extension';
6import { InputRulesExtension, InputRulesOptions } from './input-rules-extension';
7import { KeymapExtension, KeymapOptions } from './keymap-extension';
8import { NodeViewsExtension } from './node-views-extension';
9import { PasteRulesExtension } from './paste-rules-extension';
10import { PluginsExtension } from './plugins-extension';
11import { SchemaExtension } from './schema-extension';
12import { SuggestExtension, SuggestOptions } from './suggest-extension';
13import { TagsExtension } from './tags-extension';
14import { UploadExtension } from './upload-extension';
15export interface BuiltinOptions extends SuggestOptions, KeymapOptions, DecorationsOptions, InputRulesOptions {
16}
17/**
18 * Provides all the builtin extensions to the editor.
19 *
20 * @remarks
21 *
22 * This is used automatically and (at the time of writing) can't be removed from
23 * the editor. If you feel that there's a compelling reason to override these
24 * extensions feel free to create a [discussion
25 * here](https://github.com/remirror/remirror/discussions/category_choices) and
26 * it can be addressed.
27 *
28 * @category Builtin Extension
29 *
30 * The order of these extension are important.
31 *
32 * - [[`TagsExtension`]] is places first because it provides tagging which is
33 * used by the schema extension.
34 * - [[`SchemeExtension`]] goes next because it's super important to the editor
35 * functionality and needs to run before everything else which might depend
36 * on it.
37 */
38export declare function builtinPreset(options?: GetStaticAndDynamic<BuiltinOptions>): BuiltinPreset[];
39export declare type BuiltinPreset = TagsExtension | SchemaExtension | AttributesExtension | PluginsExtension | InputRulesExtension | PasteRulesExtension | NodeViewsExtension | SuggestExtension | CommandsExtension | HelpersExtension | KeymapExtension | UploadExtension | DecorationsExtension;
40declare global {
41 namespace Remirror {
42 interface ManagerSettings {
43 /**
44 * The options that can be passed into the built in options.
45 */
46 builtin?: GetStaticAndDynamic<BuiltinOptions>;
47 }
48 /**
49 * The builtin preset.
50 */
51 type Builtin = BuiltinPreset;
52 /**
53 * The union of every extension available via the remirror codebase.
54 */
55 type Extensions = ValueOf<AllExtensions>;
56 }
57}