UNPKG

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