mirror of
https://github.com/codex-team/editor.js
synced 2024-06-02 14:02:17 +02:00
3bf30f0c1e
* Add generics to OutputBlockData * Fix typo * Update CHANGELOG.md * Add @template description Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
36 lines
633 B
TypeScript
36 lines
633 B
TypeScript
import {BlockToolData} from '../tools';
|
|
|
|
/**
|
|
* Output of one Tool
|
|
*
|
|
* @template Type - the string literal describing a tool type
|
|
* @template Data - the structure describing a data object supported by the tool
|
|
*/
|
|
export interface OutputBlockData<Type extends string = string, Data extends object = any> {
|
|
/**
|
|
* Tool type
|
|
*/
|
|
type: Type;
|
|
/**
|
|
* Saved Block data
|
|
*/
|
|
data: BlockToolData<Data>;
|
|
}
|
|
|
|
export interface OutputData {
|
|
/**
|
|
* Editor's version
|
|
*/
|
|
version?: string;
|
|
|
|
/**
|
|
* Timestamp of saving in milliseconds
|
|
*/
|
|
time?: number;
|
|
|
|
/**
|
|
* Saved Blocks
|
|
*/
|
|
blocks: OutputBlockData[];
|
|
}
|