2020-11-21 19:01:31 +01:00
|
|
|
// in cypress/support/index.d.ts
|
|
|
|
// load type definitions that come with Cypress module
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
2021-04-27 15:33:00 +02:00
|
|
|
import type { EditorConfig, OutputData } from './../../../types/index';
|
2020-11-21 19:01:31 +01:00
|
|
|
import type EditorJS from '../../../types/index'
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
namespace Cypress {
|
|
|
|
interface Chainable<Subject = any> {
|
|
|
|
/**
|
|
|
|
* Custom command to select DOM element by data-cy attribute.
|
|
|
|
* @param editorConfig - config to pass to the editor
|
|
|
|
* @example cy.createEditor({})
|
|
|
|
*/
|
|
|
|
createEditor(editorConfig: EditorConfig): Chainable<EditorJS>
|
2021-04-08 20:17:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Paste command to dispatch paste event
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* cy.get('div').paste({'text/plain': 'Text', 'text/html': '<b>Text</b>'})
|
|
|
|
*
|
|
|
|
* @param data - map with MIME type as a key and data as value
|
|
|
|
*/
|
|
|
|
paste(data: {[type: string]: string}): Chainable<Subject>
|
2021-04-08 21:19:49 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy command to dispatch copy event on subject
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* cy.get('div').copy().then(data => {})
|
|
|
|
*/
|
|
|
|
copy(): Chainable<{ [type: string]: any }>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cut command to dispatch cut event on subject
|
|
|
|
*
|
|
|
|
* @usage
|
|
|
|
* cy.get('div').cut().then(data => {})
|
|
|
|
*/
|
|
|
|
cut(): Chainable<{ [type: string]: any }>;
|
2021-04-27 15:33:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Calls EditorJS API render method
|
|
|
|
*
|
|
|
|
* @param data — data to render
|
|
|
|
*/
|
|
|
|
render(data: OutputData): Chainable<EditorJS>;
|
2020-11-21 19:01:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ApplicationWindow {
|
|
|
|
EditorJS: typeof EditorJS
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|