WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ee82805

Browse files
committed
fix: merge conflicts; accumulate changes in interfaces
1 parent a7af3fc commit ee82805

File tree

3 files changed

+48
-21
lines changed

3 files changed

+48
-21
lines changed

Makefile.dryice.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,6 @@ function ace() {
182182
function correctDeclarationsForBuild(path) {
183183
var definitions = fs.readFileSync(path, 'utf8');
184184
var newDefinitions = updateDeclarationModuleNames(definitions);
185-
if (additionalDeclarations) {
186-
newDefinitions = newDefinitions + '\n' + additionalDeclarations;
187-
}
188-
if (/ace\.d\.ts$/.test(path)) {
189-
var aceRequire = "$1\n export function require(name: string): any;";
190-
newDefinitions = newDefinitions.replace(/(declare\smodule\s"ace\-builds"\s{)/, aceRequire);
191-
}
192185
fs.writeFileSync(path, newDefinitions, "utf-8");
193186
}
194187

@@ -212,11 +205,12 @@ function buildTypes() {
212205
return "declare module 'ace-builds/src-noconflict/" + moduleName + "';";
213206
}
214207
}).filter(Boolean)).join("\n") + "\n";
215-
208+
216209
generateDeclaration();
217210
fs.copyFileSync(ACE_HOME + '/ace-modes.d.ts', BUILD_DIR + '/ace-modes.d.ts');
218211
correctDeclarationsForBuild(BUILD_DIR + '/ace-modes.d.ts');
219-
const finalDeclaration = bundleDtsFiles() + "\n" + pathModules;
212+
let finalDeclaration = bundleDtsFiles() + "\n" + pathModules;
213+
finalDeclaration = finalDeclaration.replace(/(declare\smodule\s"ace\-builds"\s{)/, "$1\n export function require(name: string): any;");
220214

221215
var esmUrls = [];
222216

ace-internal.d.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export namespace Ace {
4040
type DragdropHandler = import("./src/mouse/dragdrop_handler").DragdropHandler;
4141
type AppConfig = import("./src/lib/app_config").AppConfig;
4242
type Config = typeof import("./src/config");
43+
type GutterTooltip = import( "./src/mouse/default_gutter_handler").GutterTooltip;
44+
type GutterKeyboardEvent = import( "./src/keyboard/gutter_handler").GutterKeyboardEvent;
4345

4446
type AfterLoadCallback = import("./interfaces").AfterLoadCallback
4547
type LoaderFunction = import("./interfaces").LoaderFunction;
@@ -225,6 +227,11 @@ export namespace Ace {
225227

226228
type StaticHighlightOptions = import("./interfaces").StaticHighlightOptions;
227229
type Operation = import("./interfaces").Operation;
230+
231+
type CommandBarEvents = import("./interfaces").CommandBarEvents;
232+
type FontMetricsEvents = import("./interfaces").FontMetricsEvents;
233+
type OptionPanelEvents = import("./interfaces").OptionPanelEvents;
234+
type ScrollbarEvents = import("./interfaces").ScrollbarEvents;
228235
}
229236

230237
declare global {
@@ -290,6 +297,7 @@ declare module "./src/editor" {
290297
showSettingsMenu?: () => void,
291298
searchBox?: SearchBox,
292299
_eventRegistry?: any,
300+
$textInputAriaLabel?: string
293301
}
294302
}
295303

@@ -348,18 +356,18 @@ declare module "./src/placeholder" {
348356
}
349357

350358
declare module "./src/scrollbar" {
351-
export interface VScrollBar extends i.EventEmitter<any> {
359+
export interface VScrollBar extends i.EventEmitter<i.ScrollbarEvents> {
352360
}
353361

354-
export interface HScrollBar extends i.EventEmitter<any> {
362+
export interface HScrollBar extends i.EventEmitter<i.ScrollbarEvents> {
355363
}
356364
}
357365

358366
declare module "./src/scrollbar_custom" {
359-
export interface VScrollBar extends i.EventEmitter<any> {
367+
export interface VScrollBar extends i.EventEmitter<i.ScrollbarEvents> {
360368
}
361369

362-
export interface HScrollBar extends i.EventEmitter<any> {
370+
export interface HScrollBar extends i.EventEmitter<i.ScrollbarEvents> {
363371
}
364372
}
365373

@@ -420,13 +428,13 @@ declare module "./src/snippets" {
420428
}
421429

422430
declare module "./src/ext/command_bar" {
423-
export interface CommandBarTooltip extends i.EventEmitter<any> {
431+
export interface CommandBarTooltip extends i.EventEmitter<i.CommandBarEvents> {
424432
$shouldHideMoreOptions?: boolean,
425433
}
426434
}
427435

428436
declare module "./src/commands/command_manager" {
429-
export interface CommandManager extends i.EventEmitter<any> {
437+
export interface CommandManager extends i.EventEmitter<i.CommandManagerEvents> {
430438
$checkCommandState?: boolean
431439
}
432440
}
@@ -505,12 +513,12 @@ declare module "./src/mouse/mouse_handler" {
505513
}
506514

507515
declare module "./src/ext/options" {
508-
export interface OptionPanel extends i.EventEmitter<any> {
516+
export interface OptionPanel extends i.EventEmitter<i.OptionPanelEvents> {
509517
}
510518
}
511519

512520
declare module "./src/layer/font_metrics" {
513-
export interface FontMetrics extends i.EventEmitter<any> {
521+
export interface FontMetrics extends i.EventEmitter<i.FontMetricsEvents> {
514522
}
515523
}
516524

interfaces.d.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import type {ElasticTabstopsLite} from "./src/ext/elastic_tabstops_lite";
1414
import type {MouseEvent} from "./src/mouse/mouse_event";
1515
export type AfterLoadCallback = (err: Error | null, module: unknown) => void;
1616
export type LoaderFunction = (moduleName: string, afterLoad: AfterLoadCallback) => void;
17+
import type {GutterKeyboardEvent} from "./src/keyboard/gutter_handler";
18+
import type {GutterTooltip} from "./src/mouse/default_gutter_handler";
1719

1820
export interface ConfigOptions {
1921
packaged: boolean,
@@ -493,7 +495,7 @@ export interface EditorEvents {
493495
/**
494496
* Emitted when text is pasted.
495497
**/
496-
"paste": (text: string, event: any) => void;
498+
"paste": (e: { text: string, event?: ClipboardEvent }) => void;
497499
/**
498500
* Emitted when the selection style changes, via [[Editor.setSelectionStyle]].
499501
* @param data Contains one property, `data`, which indicates the new selection style
@@ -508,6 +510,11 @@ export interface EditorEvents {
508510
"codeLensClick": (e: any) => void;
509511

510512
"select": () => void;
513+
"gutterkeydown": (e: GutterKeyboardEvent) => void;
514+
"gutterclick": (e: MouseEvent) => void;
515+
"showGutterTooltip": (e: GutterTooltip) => void;
516+
"hideGutterTooltip": (e: GutterTooltip) => void;
517+
"compositionStart": () => void;
511518
}
512519

513520
export interface AcePopupEvents {
@@ -913,9 +920,9 @@ export type execEventHandler = (obj: {
913920
}) => void;
914921

915922
export interface CommandManagerEvents {
916-
on(name: 'exec', callback: execEventHandler): Function;
917-
918-
on(name: 'afterExec', callback: execEventHandler): Function;
923+
"exec": execEventHandler
924+
"afterExec": execEventHandler;
925+
"commandUnavailable": execEventHandler;
919926
}
920927

921928
export interface SavedSelection {
@@ -1197,4 +1204,22 @@ export interface Operation {
11971204
selectionAfter?: Range | Range[];
11981205
docChanged?: boolean;
11991206
selectionChanged?: boolean;
1207+
}
1208+
1209+
export interface CommandBarEvents {
1210+
"hide": () => void;
1211+
"show": () => void;
1212+
"alwaysShow": (e: boolean) => void;
1213+
}
1214+
1215+
export interface FontMetricsEvents {
1216+
"changeCharacterSize": (e: { data: { height: number, width: number } }) => void;
1217+
}
1218+
1219+
export interface OptionPanelEvents {
1220+
"setOption": (e: { name: string, value: any }) => void;
1221+
}
1222+
1223+
export interface ScrollbarEvents {
1224+
"scroll": (e: { data: number }) => void;
12001225
}

0 commit comments

Comments
 (0)