1 | import { Plugin } from '@ckeditor/ckeditor5-core';
|
2 | import LinkEditing from './linkediting';
|
3 | import LinkUI from './linkui';
|
4 | import AutoLink from './autolink';
|
5 |
|
6 | export default class Link extends Plugin {
|
7 | static readonly requires: [typeof LinkEditing, typeof LinkUI, typeof AutoLink];
|
8 | static readonly pluginName: 'Link';
|
9 | }
|
10 |
|
11 | export interface LinkDecoratorDefinition {
|
12 | mode: 'automatic' | 'manual';
|
13 | }
|
14 |
|
15 | export interface LinkDecoratorAutomaticDefinition extends LinkDecoratorDefinition {
|
16 | attributes?: Record<string, string>;
|
17 | callback(url: string): boolean;
|
18 | mode: 'automatic';
|
19 | classes?: string | string[];
|
20 | styles?: Record<string, string>;
|
21 | }
|
22 |
|
23 | export interface LinkDecoratorManualDefinition extends LinkDecoratorDefinition {
|
24 | attributes?: Record<string, string>;
|
25 | defaultValue?: boolean | undefined;
|
26 | label: string;
|
27 | mode: 'manual';
|
28 | styles?: Record<string, string>;
|
29 | classes?: string | string[];
|
30 | }
|
31 |
|
32 | export interface LinkConfig {
|
33 | addTargetToExternalLinks?: boolean | undefined;
|
34 | decorators?: Record<string, LinkDecoratorDefinition> | undefined;
|
35 | defaultProtocol?: string | undefined;
|
36 | }
|
37 |
|
38 | declare module '@ckeditor/ckeditor5-core/src/plugincollection' {
|
39 | interface Plugins {
|
40 | Link: Link;
|
41 | }
|
42 | }
|