mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 09:52:36 +02:00
4c0d806a12
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
28 lines
536 B
TypeScript
28 lines
536 B
TypeScript
import Module from '../../__module';
|
|
import { Saver } from '../../../../types/api';
|
|
import { OutputData } from '../../../../types';
|
|
|
|
/**
|
|
* @class SaverAPI
|
|
* provides with methods to save data
|
|
*/
|
|
export default class SaverAPI extends Module {
|
|
/**
|
|
* Available methods
|
|
*
|
|
* @returns {Saver}
|
|
*/
|
|
public get methods(): Saver {
|
|
return {
|
|
save: (): Promise<OutputData> => this.save(),
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Return Editor's data
|
|
*/
|
|
public save(): Promise<OutputData> {
|
|
return this.Editor.Saver.save();
|
|
}
|
|
}
|