Skip to content

Commit 3be7a13

Browse files
Enhance global type definitions for jQuery and Underscore.
Co-authored-by: gemini-cli <[email protected]>
1 parent ef18c0c commit 3be7a13

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/js/_enqueues/wp/code-editor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ if ( 'undefined' === typeof wp.codeEditor ) {
134134
/**
135135
* @typedef {object} WpCodeEditor
136136
* @property {CodeEditorSettings} defaultSettings - Default settings.
137-
* @property {(textarea: string|jQuery|Element, settings?: CodeEditorSettings) => CodeEditorInstance} initialize - Initialize.
137+
* @property {(textarea: string|JQuery|Element, settings?: CodeEditorSettings) => CodeEditorInstance} initialize - Initialize.
138138
*/
139139

140140
/**
141-
* @param {jQuery} $ - jQuery.
141+
* @param {JQueryStatic} $ - jQuery.
142142
* @param {Object & {
143143
* codeEditor: WpCodeEditor,
144144
* CodeMirror: typeof import('codemirror'),
145145
* }} wp - WordPress namespace.
146-
* @param {import('underscore').UnderscoreStatic} _ - Underscore.
146+
* @param {_.UnderscoreStatic} _ - Underscore.
147147
*/
148148
( function( $, wp, _ ) {
149149
'use strict';

typings/globals.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
/// <reference types="jquery" />
2+
/// <reference types="underscore" />
13
/// <reference types="codemirror/addon/lint/lint" />
24
/// <reference types="codemirror/addon/hint/show-hint" />
35

46
interface Window {
57
wp: any;
6-
jQuery: any;
7-
_: any;
8+
jQuery: JQueryStatic;
9+
_: _.UnderscoreStatic;
810
Backbone: any;
911
HTMLHint: typeof import('htmlhint').HTMLHint;
1012
}
1113

1214
declare var wp: any;
13-
declare var jQuery: any;
14-
declare var _: any;
15+
declare var jQuery: JQueryStatic;
16+
declare var _: _.UnderscoreStatic;
1517
declare var Backbone: any;
1618
declare var HTMLHint: typeof import('htmlhint').HTMLHint;

0 commit comments

Comments
 (0)