ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

[TS] Add types to DLLs

Open Witoso opened this issue 1 year ago • 2 comments

When using DLL's I want to have access to types.

Examples from the prototypes:

// image.d.ts:
import type * as image from '@ckeditor/ckeditor5-image';

declare module 'ckeditor5/build/ckeditor5-dll.js' {
	interface CKEditor5DLL {
		image: typeof image;
	}
}
// ckeditor5-dll.d.ts
import type * as clipboard from '@ckeditor/ckeditor5-clipboard';
import type * as core from '@ckeditor/ckeditor5-core';
import type * as engine from '@ckeditor/ckeditor5-engine';
import type * as enter from '@ckeditor/ckeditor5-enter';
import type * as paragraph from '@ckeditor/ckeditor5-paragraph';
import type * as selectAll from '@ckeditor/ckeditor5-select-all';
import type * as typing from '@ckeditor/ckeditor5-typing';
import type * as ui from '@ckeditor/ckeditor5-ui';
import type * as undo from '@ckeditor/ckeditor5-undo';
import type * as upload from '@ckeditor/ckeditor5-upload';
import type * as utils from '@ckeditor/ckeditor5-utils';
import type * as watchdog from '@ckeditor/ckeditor5-watchdog';
import type * as widget from '@ckeditor/ckeditor5-widget';

export interface CKEditor5DLL {
	clipboard: typeof clipboard;
	core: typeof core;
	engine: typeof engine;
	enter: typeof enter;
	paragraph: typeof paragraph;
	selectAll: typeof selectAll;
	typing: typeof typing;
	ui: typeof ui;
	undo: typeof undo;
	upload: typeof upload;
	utils: typeof utils;
	watchdog: typeof watchdog;
	widget: typeof widget;
}

declare global {
	interface Window {
		CKEditor5: CKEditor5DLL;
	}
}

Witoso avatar Apr 11 '23 14:04 Witoso

Decisions to make:

  1. generate from some file? vs manual creation ofd.ts
  2. if the manual method, where to keep them? build may not be the best place for this.
  3. one file: index-dll.ts that is used during DLL build?

We need to start to check this.

Witoso avatar Apr 12 '23 11:04 Witoso

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar May 12 '24 03:05 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Jun 12 '24 03:06 CKEditorBot