@atlaskit/editor-plugin-extension
Version: 
editor-plugin-extension plugin for @atlaskit/editor-core
111 lines (91 loc) • 3.56 kB
Markdown
<!-- API Report Version: 2.3 -->
## API Report File for "@atlaskit/editor-plugin-extension"
> Do not edit this file. This report is auto-generated using
> [API Extractor](https://api-extractor.com/).
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
### Table of contents
- [Main Entry Types](#main-entry-types)
- [Peer Dependencies](#peer-dependencies)
### Main Entry Types
<!--SECTION START: Main Entry Types-->
```ts
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
import type { EditorAppearance } from '@atlaskit/editor-common/types';
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
import type { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
// @public (undocumented)
export type CreateExtensionAPI = (options: CreateExtensionAPIOptions) => ExtensionAPI;
// @public (undocumented)
interface CreateExtensionAPIOptions {
	// (undocumented)
	applyChange: ApplyChangeHandler | undefined;
	// (undocumented)
	editInLegacyMacroBrowser?: () => void;
	// (undocumented)
	editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
	// (undocumented)
	editorView: EditorView;
}
// @public (undocumented)
export type ExtensionPlugin = NextEditorPlugin<
	'extension',
	{
		pluginConfiguration: ExtensionPluginOptions | undefined;
		dependencies: [
			OptionalPlugin<AnalyticsPlugin>,
			OptionalPlugin<FeatureFlagsPlugin>,
			WidthPlugin,
			DecorationsPlugin,
			OptionalPlugin<ContextPanelPlugin>,
		];
		actions: {
			editSelectedExtension: () => boolean;
			api: () => ExtensionAPI;
			insertMacroFromMacroBrowser: InsertMacroFromMacroBrowser;
			runMacroAutoConvert: RunMacroAutoConvert;
		};
	}
>;
// @public (undocumented)
export interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
	// (undocumented)
	allowAutoSave?: boolean;
	// (undocumented)
	appearance?: EditorAppearance;
	// (undocumented)
	breakoutEnabled?: boolean;
	// (undocumented)
	extensionHandlers?: ExtensionHandlers;
}
// @public (undocumented)
type InsertMacroFromMacroBrowser = (
	macroProvider: MacroProvider,
	macroNode?: Node_2,
	isEditing?: boolean,
) => (view: EditorView) => Promise<boolean>;
// @public (undocumented)
export type RunMacroAutoConvert = (state: EditorState, text: string) => Node_2 | null;
// (No @packageDocumentation comment for this package)
```
<!--SECTION END: Main Entry Types-->
### Peer Dependencies
<!--SECTION START: Peer Dependencies-->
```json
{
	"react": "^16.8.0"
}
```
<!--SECTION END: Peer Dependencies-->