Skip to content

Commit

Permalink
refactor(link): Fix Typing for pluginName
Browse files Browse the repository at this point in the history
Adapting as required for use in `augmentation.ts`, referencing
to `pluginName` as object keys.
  • Loading branch information
mmichaelis committed Apr 21, 2023
1 parent 592f87a commit 5889fbd
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const createLinkModelFunction: CreateLinkModelFunction = (contentUri: string, na
* should be displayed as a link.
*/
export default class ContentLinkClipboardPlugin extends Plugin {
static readonly pluginName: string = "ContentLinkClipboardPlugin";
public static readonly pluginName = "ContentLinkClipboardPlugin" as const;
static readonly #logger: Logger = LoggerProvider.getLogger(ContentLinkClipboardPlugin.pluginName);

init(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const getItems = (range: Range): ModelItem[] => [...range.getItems({ shallow: tr
* content-links.
*/
class ContentLinkCommandHook extends Plugin {
static readonly pluginName: string = "ContentLinkCommandHook";
public static readonly pluginName = "ContentLinkCommandHook" as const;
static readonly #logger: Logger = LoggerProvider.getLogger(ContentLinkCommandHook.pluginName);

readonly #trackingData: TrackingData = new TrackingData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { Observable } from "@ckeditor/ckeditor5-utils";
* Content Links will be displayed as a content item.
*/
export default class ContentLinks extends Plugin {
static readonly pluginName: string = "ContentLinks";
public static readonly pluginName = "ContentLinks" as const;

#logger = LoggerProvider.getLogger(ContentLinks.pluginName);
#serviceRegisteredSubscription: Subscription | undefined = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { env, keyCodes } from "@ckeditor/ckeditor5-utils";
* browser tab instead of the same tab and content links in a new work area tab.
*/
export default class LinkUserActionsPlugin extends Plugin {
static readonly pluginName: string = "LinkUserActionsPlugin";
public static readonly pluginName = "LinkUserActionsPlugin" as const;
static readonly LOG: Logger = LoggerProvider.getLogger(LinkUserActionsPlugin.pluginName);
static readonly requires = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { LazyLinkUIPropertiesNotInitializedYetError } from "../LazyLinkUIPropert
* (rather than opening an external URL in a new browser tab).
*/
class ContentLinkActionsViewExtension extends Plugin {
static readonly pluginName: string = "ContentLinkActionsViewExtension";
public static readonly pluginName = "ContentLinkActionsViewExtension" as const;
static readonly #logger = LoggerProvider.getLogger(ContentLinkActionsViewExtension.pluginName);

static readonly requires = [LinkUI, ContextualBalloon];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const augmentFormView = <T extends object>(formView: T): T & AugmentedFormView =
* * to provide `onClick` handler to open a content in a new Studio tab
*/
class ContentLinkFormViewExtension extends Plugin {
static readonly pluginName: string = "ContentLinkFormViewExtension";
public static readonly pluginName = "ContentLinkFormViewExtension" as const;
static readonly #logger: Logger = LoggerProvider.getLogger(ContentLinkFormViewExtension.pluginName);

static readonly #CM_LINK_FORM_CLS = "cm-ck-link-form";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "../lang/linktarget";
* @see {@link https://stackoverflow.com/questions/51303892/how-to-add-target-attribute-to-a-tag-in-ckeditor5 | How to add "target" attribute to `a` tag in ckeditor5? - Stack Overflow}
*/
export default class LinkTarget extends Plugin {
static readonly pluginName: string = "LinkTarget";
public static readonly pluginName = "LinkTarget" as const;

static readonly requires = [Link, LinkTargetModelView, LinkTargetActionsViewExtension];
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { LazyLinkUIPropertiesNotInitializedYetError } from "../contentlink/LazyL
* The default configuration is defined in {@link linktarget.config.DefaultTarget}.
*/
class LinkTargetActionsViewExtension extends Plugin {
static readonly pluginName: string = "LinkTargetActionsViewExtension";
public static readonly pluginName = "LinkTargetActionsViewExtension" as const;
static readonly requires = [LinkUI, CustomLinkTargetUI];
static readonly #logger = LoggerProvider.getLogger(LinkTargetActionsViewExtension.pluginName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getLinkAttributes, LinkAttributes } from "@coremedia/ckeditor5-link-com
* @see {@link https://stackoverflow.com/questions/51303892/how-to-add-target-attribute-to-a-tag-in-ckeditor5 | How to add "target" attribute to `a` tag in ckeditor5? - Stack Overflow}
*/
export default class LinkTargetModelView extends Plugin {
static readonly pluginName: string = "LinkTargetModelView";
public static readonly pluginName = "LinkTargetModelView" as const;

// LinkUI: Registers the commands, which are expected to set/unset `linkHref`
static readonly requires = [LinkAttributes];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { IncompatibleInternalApiUsageError } from "@coremedia/ckeditor5-common/I
* `linkTarget`.
*/
export default class CustomLinkTargetUI extends Plugin {
static readonly pluginName: string = "CustomLinkTargetUI";
public static readonly pluginName = "CustomLinkTargetUI" as const;

static readonly customTargetButtonName: string = "customLinkTargetButton";

Expand Down

0 comments on commit 5889fbd

Please sign in to comment.