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 1
1
import './editor' ;
2
2
import './tabs' ;
3
3
import './shortcode' ;
4
- import { window } from '../types' ;
5
4
6
5
document . addEventListener ( 'DOMContentLoaded' , ( ) => {
7
6
const form = document . getElementById ( 'snippet-form' ) ;
Original file line number Diff line number Diff line change 1
1
import '../editor-lib' ;
2
- import { window } from '../types'
3
2
4
3
window . code_snippets_editor = ( ( { codeEditor } ) => {
5
4
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' ;
2
2
import { EditorConfiguration } from 'codemirror' ;
3
3
4
4
( editor => {
Original file line number Diff line number Diff line change 1
1
import tagger from '@jcubic/tagger' ;
2
- import { window } from '../types'
3
2
4
3
( tags => {
5
4
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' ;
2
2
3
3
type SuccessCallback = ( response : { success : boolean , data ?: unknown } ) => void ;
4
4
Original file line number Diff line number Diff line change 1
1
import '../editor-lib' ;
2
- import { EditorOption , window } from '../types' ;
2
+ import { EditorOption } from '../types' ;
3
3
4
4
const { codeEditor } = window . wp ;
5
5
const editor_settings : EditorOption [ ] = window . code_snippets_editor_settings ;
Original file line number Diff line number Diff line change 1
- import { window } from '../types'
2
-
3
1
const page = document . querySelector ( '.wrap' ) ;
4
2
const tabs_wrapper = document . getElementById ( 'settings-sections-tabs' ) ;
5
3
const 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 {
42
42
type : SnippetType ;
43
43
}
44
44
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
+ }
55
57
}
You can’t perform that action at this time.
0 commit comments