Skip to content

Commit f39479b

Browse files
committed
Mirror optionality of plugin parameters between JavaScript and TypeScript
1 parent 6a51063 commit f39479b

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

code-input.d.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export namespace plugins {
9191
* Create an auto-close brackets plugin to pass into a template
9292
* @param {Object} bracketPairs Opening brackets mapped to closing brackets, default and example {"(": ")", "[": "]", "{": "}", '"': '"'}. All brackets must only be one character.
9393
*/
94-
constructor(bracketPairs: Object);
94+
constructor(bracketPairs?: Object);
9595
}
9696
// ESM-SUPPORT-END-PLUGIN-auto-close-brackets Do not (re)move this - it's needed for ESM generation
9797

@@ -120,21 +120,6 @@ export namespace plugins {
120120
}
121121
// ESM-SUPPORT-END-PLUGIN-autodetect Do not (re)move this - it's needed for ESM generation
122122

123-
// E doesn't exist? SM-SUPPORT-START-PLUGIN-debounce-update Do not (re)move this - it's needed for ESM generation
124-
/**
125-
* Debounce the update and highlighting function
126-
* https://medium.com/@jamischarles/what-is-debouncing-2505c0648ff1
127-
* Files: debounce-update.js
128-
*/
129-
class DebounceUpdate extends Plugin {
130-
/**
131-
* Create a debounced update plugin to pass into a template.
132-
* @param {Number} delayMs Delay, in ms, to wait until updating the syntax highlighting
133-
*/
134-
constructor(delayMs: number);
135-
}
136-
// E doesn't exist? SM-SUPPORT-END-PLUGIN-debounce-update Do not (re)move this - it's needed for ESM generation
137-
138123
// ESM-SUPPORT-START-PLUGIN-find-and-replace Do not (re)move this - it's needed for ESM generation
139124
/**
140125
* Add Find-and-Replace (Ctrl+F for find, Ctrl+H for replace by default) functionality to the code editor.
@@ -189,7 +174,7 @@ export namespace plugins {
189174
* @param {boolean} useCtrlG Should Ctrl+G be overriden for go-to-line functionality? If not, you can trigger it yourself using (instance of this plugin)`.showPrompt(code-input element)`.
190175
* @param {Object} instructionTranslations: user interface string keys mapped to translated versions for localisation. Look at the go-to-line.js source code for the English text.
191176
*/
192-
constructor(useCtrlG: boolean,
177+
constructor(useCtrlG?: boolean,
193178
instructionTranslations?: {
194179
closeDialog?: string;
195180
input?: string;
@@ -217,7 +202,7 @@ export namespace plugins {
217202
* @param {boolean} escTabToChangeFocus Whether pressing the Escape key before (Shift+)Tab should make this keypress focus on a different element (Tab's default behaviour). You should always either enable this or use this plugin's disableTabIndentation and enableTabIndentation methods linked to other keyboard shortcuts, for accessibility.
218203
* @param {Object} instructionTranslations: user interface string keys mapped to translated versions for localisation. Look at the go-to-line.js source code for the English text.
219204
*/
220-
constructor(defaultSpaces?: boolean, numSpaces?: Number, bracketPairs?: Object, escTabToChangeFocus?: boolean, instructionTranslations?: {
205+
constructor(defaultSpaces?: boolean, numSpaces?: Number, bracketPairs?: Object, escTabToChangeFocus?: boolean, instructionTwranslations?: {
221206
tabForIndentation?: string;
222207
tabForNavigation?: string;
223208
});
@@ -270,7 +255,7 @@ export namespace plugins {
270255
* @param {string} selectedClass The CSS class that will be present on tokens only when they are part of the selected text in the `<code-input>` element. Defaults to "code-input_select-token-callbacks_selected".
271256
* @returns {TokenSelectorCallbacks} A new TokenSelectorCallbacks instance that encodes this behaviour.
272257
*/
273-
static createClassSynchronisation(selectedClass: string): codeInput.plugins.SelectTokenCallbacks.TokenSelectorCallbacks;
258+
static createClassSynchronisation(selectedClass?: string): codeInput.plugins.SelectTokenCallbacks.TokenSelectorCallbacks;
274259
}
275260
}
276261
// ESM-SUPPORT-END-PLUGIN-select-token-callbacks Do not (re)move this - it's needed for ESM generation

0 commit comments

Comments
 (0)