Skip to content

Commit

Permalink
update types; improve generation by removing undefined declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Nov 18, 2024
1 parent 9f1a005 commit fd90e44
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 281 deletions.
79 changes: 2 additions & 77 deletions ace-ext.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
declare module "ace-code/src/ext/command_bar" {
const CommandBarTooltip_base: undefined;
/**
* Displays a command tooltip above the currently active line selection, with clickable elements.
*
Expand Down Expand Up @@ -78,7 +77,6 @@ declare module "ace-code/src/ext/command_bar" {
import Tooltip = Tooltip_2.Tooltip;
export var TOOLTIP_CLASS_NAME: string;
export var BUTTON_CLASS_NAME: string;
export { };
namespace Ace {
type EventEmitter<T> = import("ace-code").Ace.EventEmitter<T>;
}
Expand Down Expand Up @@ -111,8 +109,8 @@ declare module "ace-code/src/ext/inline_autocomplete" {
blurListener(e: any): void;
changeListener(e: any): void;
changeTimer: {
(timeout: any): void;
delay(timeout: any): void;
(timeout?: number): void;
delay(timeout?: number): void;
schedule: any;
call(): void;
cancel(): void;
Expand Down Expand Up @@ -509,7 +507,6 @@ declare module "ace-code/src/ext/modelist" {
*/
supportsFile(filename: string): RegExpMatchArray;
}
export { };
}
declare module "ace-code/src/ext/themelist" {
export const themesByName: {};
Expand All @@ -521,7 +518,6 @@ declare module "ace-code/src/ext/themelist" {
}[];
}
declare module "ace-code/src/ext/options" {
const OptionPanel_base: undefined;
export class OptionPanel {
/**
*
Expand Down Expand Up @@ -557,7 +553,6 @@ declare module "ace-code/src/ext/options" {
getOption(option: any): any;
}
export type Editor = import("ace-code/src/editor").Editor;
export { };
namespace Ace {
type EventEmitter<T> = import("ace-code").Ace.EventEmitter<T>;
}
Expand Down Expand Up @@ -671,7 +666,6 @@ declare module "ace-code/src/ext/prompt" {
}
}
declare module "ace-code/src/ext/rtl" {
export { };
}
declare module "ace-code/src/ext/settings_menu" {
export function init(): void;
Expand Down Expand Up @@ -760,75 +754,6 @@ declare module "ace-code/src/ext/statusbar" {
updateStatus(editor: Editor): void;
}
}
declare module "ace-code/src/ext/textarea" {
const _exports: {
config: {
defineOptions(obj: any, path: string, options: {
[key: string]: any;
}): import("ace-code").Ace.AppConfig;
resetOptions(obj: any): void;
setDefaultValue(path: string, name: string, value: any): boolean;
setDefaultValues(path: string, optionHash: {
[key: string]: any;
}): void;
setMessages(value: any, options?: {
placeholders?: "dollarSigns" | "curlyBrackets";
}): void;
nls(key: string, defaultString: string, params?: {
[x: string]: any;
}): any;
warn: (message: any, ...args: any[]) => void;
reportError: (msg: any, data: any) => void;
once<K extends string | number | symbol>(name: K, callback: any): void;
setDefaultHandler(name: string, callback: Function): void;
removeDefaultHandler(name: string, callback: Function): void;
on<K extends string | number | symbol>(name: K, callback: any, capturing?: boolean): any;
addEventListener<K extends string | number | symbol>(name: K, callback: any, capturing?: boolean): any;
off<K extends string | number | symbol>(name: K, callback: any): void;
removeListener<K extends string | number | symbol>(name: K, callback: any): void;
removeEventListener<K extends string | number | symbol>(name: K, callback: any): void;
removeAllListeners(name?: string): void;
get: <K extends keyof import("ace-code").Ace.ConfigOptions>(key: K) => import("ace-code").Ace.ConfigOptions[K];
set: <K extends keyof import("ace-code").Ace.ConfigOptions>(key: K, value: import("ace-code").Ace.ConfigOptions[K]) => void;
all: () => import("ace-code").Ace.ConfigOptions;
moduleUrl: (name: string, component?: string) => string;
setModuleUrl: (name: string, subst: string) => string;
setLoader: (cb: (name: string, callback: (error: any, module: any) => void) => void) => void;
dynamicModules: any;
loadModule: (moduleId: string | [
string,
string
], onLoad: (module: any) => void) => void;
setModuleLoader: (moduleName: any, onLoad: any) => void;
version: "1.36.4";
};
edit: (el?: string | (HTMLElement & {
env?: any;
value?: any;
}) | null, options?: any) => ace.Editor;
createEditSession: (text: import("ace-code/src/document").Document | string, mode?: import("ace-code").Ace.SyntaxMode) => ace.EditSession;
Range: typeof ace.Range;
Editor: typeof ace.Editor;
EditSession: typeof ace.EditSession;
UndoManager: typeof ace.UndoManager;
VirtualRenderer: typeof ace.VirtualRenderer;
version: "1.36.4";
transformTextarea: (element: any, options: any) => ace.Editor;
defaultOptions: {
mode: string;
theme: string;
wrap: string;
fontSize: string;
showGutter: string;
keybindings: string;
showPrintMargin: string;
useSoftTabs: string;
showInvisibles: string;
};
};
export = _exports;
import ace = require("ace-code");
}
declare module "ace-code/src/ext/whitespace" {
export function $detectIndentation(lines: string[], fallback?: any): {
ch?: string;
Expand Down
14 changes: 8 additions & 6 deletions ace-lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ declare module "ace-code/src/lib/lang" {
cancel(): any;
isPending(): any;
};
export function delayedCall(fcn: any, defaultTimeout: any): {
(timeout: any): void;
delay(timeout: any): void;
export function delayedCall(fcn: any, defaultTimeout?: number): {
(timeout?: number): void;
/**
* @param {number} [timeout]
*/
delay(timeout?: number): void;
schedule: any;
call(): void;
cancel(): void;
Expand All @@ -110,7 +113,9 @@ declare module "ace-code/src/lib/event" {
export function getModifierString(e: KeyboardEvent | MouseEvent): any;
export function addCommandKeyListener(el: EventTarget, callback: (e: KeyboardEvent, hashId: number, keyCode: number) => void, destroyer?: any): void;
export function nextTick(callback: any, win: any): void;
export const $idleBlocked: boolean;
export function onIdle(cb: any, timeout: any): number;
export const $idleBlockId: number;
export function blockIdle(delay: any): void;
export const nextFrame: any;
}
Expand Down Expand Up @@ -177,7 +182,6 @@ declare module "ace-code/src/lib/default_english_messages" {
};
}
declare module "ace-code/src/lib/app_config" {
const AppConfig_base: undefined;
export class AppConfig {
/**
* @param {Object} obj
Expand Down Expand Up @@ -224,7 +228,6 @@ declare module "ace-code/src/lib/app_config" {
reportError: (msg: any, data: any) => void;
}
function warn(message: any, ...args: any[]): void;
export { };
namespace Ace {
type EventEmitter<T> = import("ace-code").Ace.EventEmitter<T>;
}
Expand All @@ -249,5 +252,4 @@ declare module "ace-code/src/lib/bidiutil" {
export var EN: number;
}
declare module "ace-code/src/lib/fixoldbrowsers" {
export { };
}
Loading

0 comments on commit fd90e44

Please sign in to comment.