suneditor
Version:
Vanilla JavaScript based WYSIWYG web editor
74 lines (73 loc) • 1.83 kB
TypeScript
import type {} from '../../typedef';
export default AudioGallery;
export type AudioGalleryPluginOptions = {
/**
* - Direct data without server calls
*/
data?: Array<SunEditor.Module.Browser.File>;
/**
* - Server request URL
* - The server must return:
* ```js
* {
* "result": [
* {
* "src": "https://example.com/audio.mp3",
* "name": "audio.mp3",
* "thumbnail": "https://example.com/audio_icon.png",
* "tag": ["music"]
* }
* ]
* }
* ```
*/
url?: string;
/**
* - Server request headers
*/
headers?: {
[x: string]: string;
};
/**
* - Default thumbnail
*/
thumbnail?: string | ((item: SunEditor.Module.Browser.File) => string);
};
/**
* @typedef {Object} AudioGalleryPluginOptions
* @property {Array<SunEditor.Module.Browser.File>} [data] - Direct data without server calls
* @property {string} [url] - Server request URL
* - The server must return:
* ```js
* {
* "result": [
* {
* "src": "https://example.com/audio.mp3",
* "name": "audio.mp3",
* "thumbnail": "https://example.com/audio_icon.png",
* "tag": ["music"]
* }
* ]
* }
* ```
* @property {Object<string, string>} [headers] - Server request headers
* @property {string|((item: SunEditor.Module.Browser.File) => string)} [thumbnail] - Default thumbnail
*/
/**
* @class
* @description Audio gallery plugin
*/
declare class AudioGallery extends PluginBrowser {
/**
* @constructor
* @param {SunEditor.Kernel} kernel - The Kernel instance
* @param {AudioGalleryPluginOptions} pluginOptions
*/
constructor(kernel: SunEditor.Kernel, pluginOptions: AudioGalleryPluginOptions);
title: any;
onSelectfunction: (target: Node) => any;
browser: Browser;
#private;
}
import { PluginBrowser } from '../../interfaces';
import { Browser } from '../../modules/contract';