@ckeditor/ckeditor5-integrations-common
Version:
This package implements common utility modules for integration projects.
16 lines (15 loc) • 597 B
TypeScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
export type Defer<E> = {
promise: Promise<E>;
resolve: (value: E) => void;
};
/**
* This function generates a promise that can be resolved by invoking the returned `resolve` method.
* It proves to be beneficial in the creation of various types of locks and semaphores.
*
* It can be replaced with `Promise.withResolvers()` in the future.
*/
export declare function createDefer<E = void>(): Defer<E>;