File tree Expand file tree Collapse file tree 8 files changed +15
-18
lines changed
Expand file tree Collapse file tree 8 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 11import './editor' ;
22import './tabs' ;
33import './shortcode' ;
4- import { window } from '../types' ;
54
65document . addEventListener ( 'DOMContentLoaded' , ( ) => {
76 const form = document . getElementById ( 'snippet-form' ) ;
Original file line number Diff line number Diff line change 11import '../editor-lib' ;
2- import { window } from '../types'
32
43window . code_snippets_editor = ( ( { codeEditor } ) => {
54 const textarea = document . getElementById ( 'snippet_code' ) ;
Original file line number Diff line number Diff line change 1- import { SnippetType , window } from '../types' ;
1+ import { SnippetType } from '../types' ;
22import { EditorConfiguration } from 'codemirror' ;
33
44( editor => {
Original file line number Diff line number Diff line change 11import tagger from '@jcubic/tagger' ;
2- import { window } from '../types'
32
43( tags => {
54 const tags_field = document . getElementById ( 'snippet_tags' ) ;
Original file line number Diff line number Diff line change 1- import { Snippet , window } from './types' ;
1+ import { Snippet } from './types' ;
22
33type SuccessCallback = ( response : { success : boolean , data ?: unknown } ) => void ;
44
Original file line number Diff line number Diff line change 11import '../editor-lib' ;
2- import { EditorOption , window } from '../types' ;
2+ import { EditorOption } from '../types' ;
33
44const { codeEditor } = window . wp ;
55const editor_settings : EditorOption [ ] = window . code_snippets_editor_settings ;
Original file line number Diff line number Diff line change 1- import { window } from '../types'
2-
31const page = document . querySelector ( '.wrap' ) ;
42const tabs_wrapper = document . getElementById ( 'settings-sections-tabs' ) ;
53const http_referer = document . querySelector ( 'input[name=_wp_http_referer]' ) as HTMLInputElement ;
Original file line number Diff line number Diff line change @@ -42,14 +42,16 @@ export interface Snippet {
4242 type : SnippetType ;
4343}
4444
45- export declare const window : Window & {
46- pagenow : string ;
47- ajaxurl : string ;
48- wp : WordPressUtils ;
49- code_snippets_tags : { allow_spaces : boolean , available_tags : string [ ] } ;
50- code_snippets_editor ?: CodeEditorInstance ;
51- code_snippets_editor_preview ?: CodeEditorInstance ;
52- code_snippets_editor_settings : EditorOption [ ] ;
53- code_snippets_edit_i18n : Record < string , string > ;
54- code_snippets_manage_i18n : Record < string , string > ;
45+ declare global {
46+ interface Window {
47+ pagenow : string ;
48+ ajaxurl : string ;
49+ wp : WordPressUtils ;
50+ code_snippets_tags : { allow_spaces : boolean , available_tags : string [ ] } ;
51+ code_snippets_editor ?: CodeEditorInstance ;
52+ code_snippets_editor_preview ?: CodeEditorInstance ;
53+ code_snippets_editor_settings : EditorOption [ ] ;
54+ code_snippets_edit_i18n : Record < string , string > ;
55+ code_snippets_manage_i18n : Record < string , string > ;
56+ }
5557}
You can’t perform that action at this time.
0 commit comments