2021-05-27 20:22:27 +00:00
|
|
|
import 'codemirror';
|
2021-07-22 23:04:56 +00:00
|
|
|
|
2021-05-27 20:22:27 +00:00
|
|
|
import { HandleGetRenderContext, HandleRender } from './common/render';
|
|
|
|
|
|
|
|
type LinkClickCallback = (url: string) => void;
|
|
|
|
|
|
|
|
interface InsomniaExtensions {
|
|
|
|
closeHintDropdown: () => void;
|
|
|
|
enableNunjucksTags: (
|
|
|
|
handleRender: HandleRender,
|
|
|
|
handleGetRenderContext?: HandleGetRenderContext,
|
|
|
|
isVariableUncovered?: boolean,
|
|
|
|
) => void;
|
|
|
|
isHintDropdownActive: () => boolean;
|
|
|
|
makeLinksClickable: (handleClick: LinkClickCallback) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare module 'codemirror' {
|
|
|
|
type CodeMirrorLinkClickCallback = LinkClickCallback;
|
|
|
|
|
|
|
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
|
|
|
interface Editor extends InsomniaExtensions {}
|
|
|
|
interface EditorFromTextEditor extends InsomniaExtensions {}
|
|
|
|
/* eslint-enable @typescript-eslint/no-empty-interface */
|
|
|
|
}
|