| @@ -1,18 +1,30 @@ | ||
| 1 | +import type { SnippetSchema } from './schema/SnippetSchema' | |
| 1 | 2 | import type { ChangelogSchema, ImageLinkSchema } from './schema/WelcomeSchema' |
| 2 | 3 | import type Prism from 'prismjs' |
| 3 | 4 | import type tinymce from 'tinymce' |
| 5 | +import type { FeedbackConfig } from './Feedback' | |
| 6 | +import type { InsightsChartViews, InsightsSummary } from './Insights' | |
| 4 | 7 | import type { Snippet } from './Snippet' |
| 5 | -import type { CodeEditorInstance, EditorOption, WordPressCodeEditor } from './WordPressCodeEditor' | |
| 6 | -import type { WordPressEditor } from './WordPressEditor' | |
| 8 | +import type { SnippetView } from './SnippetView' | |
| 9 | +import type { CodeEditorInstance, EditorOption, WordPressCodeEditor } from './vendor/WordPressCodeEditor' | |
| 10 | +import type { WordPressEditor } from './vendor/WordPressEditor' | |
| 7 | 11 | |
| 8 | 12 | declare global { |
| 9 | 13 | interface Window { |
| 10 | 14 | readonly wp: { |
| 11 | 15 | readonly editor?: WordPressEditor |
| 12 | - readonly codeEditor: WordPressCodeEditor | |
| 16 | + readonly codeEditor?: WordPressCodeEditor | |
| 17 | + readonly hooks?: { | |
| 18 | + addAction: ( | |
| 19 | + hookName: string, | |
| 20 | + namespace: string, | |
| 21 | + callback: (data: { rest_nonce?: string }) => void | |
| 22 | + ) => void | |
| 23 | + } | |
| 13 | 24 | } |
| 14 | - readonly pagenow: string | |
| 25 | + codeSnippetsErrors?: string[] | |
| 26 | + readonly pagenow?: string | |
| 15 | 27 | readonly ajaxurl: string |
| 16 | 28 | readonly tinymce?: tinymce.EditorManager |
| 17 | 29 | readonly wpActiveEditor?: string |
| 18 | 30 | code_snippets_editor_preview?: CodeEditorInstance |
| @@ -21,13 +33,19 @@ | ||
| 21 | 33 | readonly CODE_SNIPPETS?: { |
| 22 | 34 | debug: boolean |
| 23 | 35 | isLicensed: boolean |
| 24 | 36 | hideUpsell: boolean |
| 37 | + isCloudConnected: boolean | |
| 38 | + snippetView: SnippetView | |
| 39 | + insightsChartViews: InsightsChartViews | |
| 40 | + demosSeen?: string[] | |
| 25 | 41 | restAPI: { |
| 26 | 42 | base: string |
| 27 | 43 | snippets: string |
| 28 | 44 | recentlyActive: string |
| 29 | - conditions: string | |
| 45 | + snippetView: string | |
| 46 | + insightsView: string | |
| 47 | + demosSeen: string | |
| 30 | 48 | importPlugins: string |
| 31 | 49 | importFiles: string |
| 32 | 50 | nonce: string |
| 33 | 51 | cloud: { |
| @@ -39,11 +57,14 @@ | ||
| 39 | 57 | plugin: string |
| 40 | 58 | manage: string |
| 41 | 59 | addNew: string |
| 42 | 60 | edit: string |
| 61 | + insights: string | |
| 43 | 62 | welcome: string |
| 44 | - settings: string | |
| 63 | + import: string | |
| 64 | + settings: string | null | |
| 45 | 65 | cloud: string |
| 66 | + demoReset: string | |
| 46 | 67 | } |
| 47 | 68 | banner: { |
| 48 | 69 | key: string |
| 49 | 70 | start_datetime: { date: string, timezone_type: number, timezone: string } |
| @@ -59,17 +80,24 @@ | ||
| 59 | 80 | readonly CODE_SNIPPETS_MANAGE?: { |
| 60 | 81 | snippetsList?: Snippet[] |
| 61 | 82 | hasNetworkCap: boolean |
| 62 | 83 | hiddenColumns: string[] |
| 84 | + listOrder?: string | |
| 63 | 85 | truncateRowValues: number | string |
| 64 | 86 | snippetsPerPage: number |
| 87 | + typeCounts?: Record<string, number> | |
| 65 | 88 | cloudSearchPerPage: number |
| 66 | 89 | isSafeModeActive: boolean |
| 67 | 90 | bulkDownloadNonce: string |
| 91 | + runOnceNonce?: string | |
| 68 | 92 | supportsZipDownloads: boolean |
| 93 | + editorTheme: string | |
| 94 | + aiDemo?: { | |
| 95 | + siteName: string | |
| 96 | + } | |
| 69 | 97 | } |
| 70 | 98 | readonly CODE_SNIPPETS_EDIT?: { |
| 71 | - snippet: Snippet | |
| 99 | + snippet: SnippetSchema | |
| 72 | 100 | pageTitleActions: Record<string, string> |
| 73 | 101 | isLicensed: boolean |
| 74 | 102 | enableDownloads: boolean |
| 75 | 103 | activateByDefault: boolean |
| @@ -94,6 +122,8 @@ | ||
| 94 | 122 | changelog: ChangelogSchema[] |
| 95 | 123 | features: ImageLinkSchema[] |
| 96 | 124 | partners: ImageLinkSchema[] |
| 97 | 125 | } |
| 126 | + readonly CODE_SNIPPETS_INSIGHTS?: InsightsSummary | |
| 127 | + readonly CODE_SNIPPETS_FEEDBACK?: FeedbackConfig | |
| 98 | 128 | } |
| 99 | 129 | } |