acode-plugin-types 1.11.7-patch.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/index.d.ts +91 -0
- package/package.json +26 -0
- package/src/ace/index.d.ts +1 -0
- package/src/ace/modelist.d.ts +22 -0
- package/src/acode.d.ts +437 -0
- package/src/components/collapsibleList.d.ts +11 -0
- package/src/components/contextMenu.d.ts +66 -0
- package/src/components/index.d.ts +10 -0
- package/src/components/inputhints.d.ts +45 -0
- package/src/components/page.d.ts +22 -0
- package/src/components/palette.d.ts +21 -0
- package/src/components/sideButton.d.ts +35 -0
- package/src/components/terminal/index.d.ts +1 -0
- package/src/components/terminal/terminalManager.d.ts +113 -0
- package/src/components/toast.d.ts +20 -0
- package/src/components/tutorial.d.ts +13 -0
- package/src/components/webComponents/index.d.ts +1 -0
- package/src/components/webComponents/wcPage.d.ts +85 -0
- package/src/dialogs/alert.d.ts +15 -0
- package/src/dialogs/box.d.ts +45 -0
- package/src/dialogs/color.d.ts +15 -0
- package/src/dialogs/confirm.d.ts +16 -0
- package/src/dialogs/index.d.ts +8 -0
- package/src/dialogs/loader.d.ts +44 -0
- package/src/dialogs/multiPrompt.d.ts +16 -0
- package/src/dialogs/prompt.d.ts +47 -0
- package/src/dialogs/select.d.ts +66 -0
- package/src/fileSystem.d.ts +113 -0
- package/src/handlers/index.d.ts +3 -0
- package/src/handlers/intent.d.ts +47 -0
- package/src/handlers/keyboard.d.ts +30 -0
- package/src/handlers/windowResize.d.ts +13 -0
- package/src/index.d.ts +12 -0
- package/src/lib/actionStack.d.ts +60 -0
- package/src/lib/editorFile.d.ts +344 -0
- package/src/lib/editorManager.d.ts +127 -0
- package/src/lib/fileList.d.ts +70 -0
- package/src/lib/fonts.d.ts +29 -0
- package/src/lib/index.d.ts +9 -0
- package/src/lib/openFolder.d.ts +102 -0
- package/src/lib/projects.d.ts +28 -0
- package/src/lib/selectionMenu.d.ts +19 -0
- package/src/lib/settings.d.ts +155 -0
- package/src/pages/fileBrowser/fileBrowser.d.ts +65 -0
- package/src/pages/fileBrowser/index.d.ts +1 -0
- package/src/pages/index.d.ts +1 -0
- package/src/plugins/customtabs/CustomTabs.d.ts +57 -0
- package/src/plugins/customtabs/index.d.ts +1 -0
- package/src/plugins/index.d.ts +4 -0
- package/src/plugins/system/System.d.ts +550 -0
- package/src/plugins/system/index.d.ts +1 -0
- package/src/plugins/terminal/Executor.d.ts +155 -0
- package/src/plugins/terminal/Terminal.d.ts +123 -0
- package/src/plugins/terminal/index.d.ts +2 -0
- package/src/plugins/websocket/WebSocket.d.ts +224 -0
- package/src/plugins/websocket/index.d.ts +1 -0
- package/src/sideBarApps.d.ts +39 -0
- package/src/test.ts +517 -0
- package/src/theme/builder.d.ts +188 -0
- package/src/theme/index.d.ts +2 -0
- package/src/theme/list.d.ts +29 -0
- package/src/utils/KeyboardEvent.d.ts +19 -0
- package/src/utils/Url.d.ts +65 -0
- package/src/utils/color.d.ts +51 -0
- package/src/utils/encodings.d.ts +24 -0
- package/src/utils/helpers.d.ts +102 -0
- package/src/utils/index.d.ts +5 -0
- package/types/ace/VERSION +1 -0
- package/types/ace/ace-modes.d.ts +1724 -0
- package/types/ace/index.d.ts +1176 -0
- package/types/ace/types/ace-ext.d.ts +720 -0
- package/types/ace/types/ace-lib.d.ts +302 -0
- package/types/ace/types/ace-modules.d.ts +5293 -0
- package/types/ace/types/ace-snippets.d.ts +406 -0
- package/types/ace/types/ace-theme.d.ts +437 -0
- package/types/html-tag-js.d.ts +680 -0
- package/types/require.d.ts +412 -0
- package/types/xterm.d.ts +1908 -0
package/README.md
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/// <reference path="./src/index.d.ts" />
|
|
2
|
+
/// <reference path="./types/ace/index.d.ts" />
|
|
3
|
+
/// <reference path="./types/require.d.ts" />
|
|
4
|
+
/// <reference path="./types/xterm.d.ts" />
|
|
5
|
+
/// <reference path="./types/html-tag-js.d.ts" />
|
|
6
|
+
|
|
7
|
+
declare module "acode" {
|
|
8
|
+
export type AceModes = Acode.AceModes;
|
|
9
|
+
export type Action = Acode.Action;
|
|
10
|
+
export type ActionStack = Acode.ActionStack;
|
|
11
|
+
export type AddIconOptions = Acode.AddIconOptions;
|
|
12
|
+
export type AddedFolder = Acode.AddedFolder;
|
|
13
|
+
export type Alert = Acode.Alert;
|
|
14
|
+
export type ClipBoard = Acode.ClipBoard;
|
|
15
|
+
export type Collapsible = Acode.Collapsible;
|
|
16
|
+
export type Color = Acode.Color;
|
|
17
|
+
export type ColorConstructor = Acode.ColorConstructor;
|
|
18
|
+
export type ColorPicker = Acode.ColorPicker;
|
|
19
|
+
export type Confirm = Acode.Confirm;
|
|
20
|
+
export type ContextMenu = Acode.ContextMenu;
|
|
21
|
+
export type ContextMenuConstructor = Acode.ContextMenuConstructor;
|
|
22
|
+
export type ContextMenuOptions = Acode.ContextMenuOptions;
|
|
23
|
+
export type CreateKeyboardEvent = Acode.CreateKeyboardEvent;
|
|
24
|
+
export type DialogBox = Acode.DialogBox;
|
|
25
|
+
export type DialogBoxConstructor = Acode.DialogBoxConstructor;
|
|
26
|
+
export type EditorEvent = Acode.EditorEvent;
|
|
27
|
+
export type EditorManager = Acode.EditorManager;
|
|
28
|
+
export type Encodings = Acode.Encodings;
|
|
29
|
+
export type FS = Acode.FS;
|
|
30
|
+
export type File = Acode.File;
|
|
31
|
+
export type FileEvent = Acode.FileEvent;
|
|
32
|
+
export type FileEventType = Acode.FileEventType;
|
|
33
|
+
export type FileHandlerOptions = Acode.FileHandlerOptions;
|
|
34
|
+
export type FileList = Acode.FileList;
|
|
35
|
+
export type FileListEvent = Acode.FileListEvent;
|
|
36
|
+
export type FileOptions = Acode.FileOptions;
|
|
37
|
+
export type FileSystem = Acode.FileSystem;
|
|
38
|
+
export type FileUrl = Acode.FileUrl;
|
|
39
|
+
export type Folder = Acode.Folder;
|
|
40
|
+
export type Fonts = Acode.Fonts;
|
|
41
|
+
export type Helpers = Acode.Helpers;
|
|
42
|
+
export type Hint = Acode.Hint;
|
|
43
|
+
export type HintCallback = Acode.HintCallback;
|
|
44
|
+
export type HintModification = Acode.HintModification;
|
|
45
|
+
export type HintObj = Acode.HintObj;
|
|
46
|
+
export type ISettings = Acode.ISettings;
|
|
47
|
+
export type Input = Acode.Input;
|
|
48
|
+
export type InputHints = Acode.InputHints;
|
|
49
|
+
export type Intent = Acode.Intent;
|
|
50
|
+
export type IntentEvent = Acode.IntentEvent;
|
|
51
|
+
export type Keyboard = Acode.Keyboard;
|
|
52
|
+
export type KeyboardEventName = Acode.KeyboardEventName;
|
|
53
|
+
export type Loader = Acode.Loader;
|
|
54
|
+
export type Modules = Acode.Modules;
|
|
55
|
+
export type MultiPrompt = Acode.MultiPrompt;
|
|
56
|
+
export type OpenFolder = Acode.OpenFolder;
|
|
57
|
+
export type OpenFolderOptions = Acode.OpenFolderOptions;
|
|
58
|
+
export type Page = Acode.Page;
|
|
59
|
+
export type PageHandler = Acode.PageHandler;
|
|
60
|
+
export type Palette = Acode.Palette;
|
|
61
|
+
export type PluginInit = Acode.PluginInit;
|
|
62
|
+
export type PluginInitOptions = Acode.PluginInitOptions;
|
|
63
|
+
export type PluginSettings = Acode.PluginSettings;
|
|
64
|
+
export type Projects = Acode.Projects;
|
|
65
|
+
export type Prompt = Acode.Prompt;
|
|
66
|
+
export type PromptOptions<T> = Acode.PromptOptions<T>;
|
|
67
|
+
export type PromptType = Acode.PromptType;
|
|
68
|
+
export type Require = Acode.Require;
|
|
69
|
+
export type Select = Acode.Select;
|
|
70
|
+
export type SelectItem = Acode.SelectItem;
|
|
71
|
+
export type SelectItems = Acode.SelectItems;
|
|
72
|
+
export type SelectOptions = Acode.SelectOptions;
|
|
73
|
+
export type SelectionMenu = Acode.SelectionMenu;
|
|
74
|
+
export type Settings = Acode.Settings;
|
|
75
|
+
export type SideButton = Acode.SideButton;
|
|
76
|
+
export type SideButtonConstructor = Acode.SideButtonConstructor;
|
|
77
|
+
export type SideButtonOptions = Acode.SideButtonOptions;
|
|
78
|
+
export type SidebarApps = Acode.SidebarApps;
|
|
79
|
+
export type Stat = Acode.Stat;
|
|
80
|
+
export type Terminal = Acode.Terminal;
|
|
81
|
+
export type TerminalInstance = Acode.TerminalInstance;
|
|
82
|
+
export type TerminalOptions = Acode.TerminalOptions;
|
|
83
|
+
export type Themes = Acode.Themes;
|
|
84
|
+
export type Toast = Acode.Toast;
|
|
85
|
+
export type Tree = Acode.Tree;
|
|
86
|
+
export type TreeJson = Acode.TreeJson;
|
|
87
|
+
export type Url = Acode.Url;
|
|
88
|
+
export type WCPage = Acode.WCPage;
|
|
89
|
+
export type WindowResize = Acode.WindowResize;
|
|
90
|
+
export type WindowResizeEventName = Acode.WindowResizeEventName;
|
|
91
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "acode-plugin-types",
|
|
3
|
+
"version": "1.11.7-patch.1",
|
|
4
|
+
"types": "index.d.ts",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Acode Foundation",
|
|
7
|
+
"email": "contact@acode.app"
|
|
8
|
+
},
|
|
9
|
+
"readme": "README.md",
|
|
10
|
+
"repository": {
|
|
11
|
+
"url": "git+https://github.com/Acode-Foundation/plugin-types.git"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "biome check",
|
|
15
|
+
"format": "biome format --write",
|
|
16
|
+
"check": "biome check --write",
|
|
17
|
+
"link-types": "node ./scripts/linkTypes.js"
|
|
18
|
+
},
|
|
19
|
+
"files": ["./src", "README.md", "./index.d.ts", "./types"],
|
|
20
|
+
"keywords": ["acode", "plugin-types", "acode-app"],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@biomejs/biome": "^1.9.4",
|
|
24
|
+
"typescript": "^5.9.3"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference path="./modelist.d.ts" />
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare namespace Acode {
|
|
2
|
+
/**
|
|
3
|
+
* The Ace Modes is a utility method in Acode allows you to manage the language modes supported by the Ace editor.
|
|
4
|
+
* This includes adding new modes, removing existing ones, and configuring how the editor handles different file types.
|
|
5
|
+
*/
|
|
6
|
+
interface AceModes {
|
|
7
|
+
/**
|
|
8
|
+
* Adds a new mode to the Ace editor. This is useful when you want to support a custom language or file type.
|
|
9
|
+
* @param name The name of the mode.
|
|
10
|
+
|
|
11
|
+
* @param extensions The file extensions associated with this mode. This can be a string or an array of strings.
|
|
12
|
+
* @param caption The display name of the mode.
|
|
13
|
+
*/
|
|
14
|
+
addMode(name: string, extensions: string | string[], caption: string): void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Removes a mode from the Ace editor. This is useful if you need to clean up or no longer need support for a particular mode.
|
|
18
|
+
* @param name The name of the mode to be removed.
|
|
19
|
+
*/
|
|
20
|
+
removeMode(name: string): void;
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/acode.d.ts
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
/// <reference path="./ace/index.d.ts" />
|
|
2
|
+
/// <reference path="./components/index.d.ts" />
|
|
3
|
+
/// <reference path="./dialogs/index.d.ts" />
|
|
4
|
+
/// <reference path="./handlers/index.d.ts" />
|
|
5
|
+
/// <reference path="./lib/index.d.ts" />
|
|
6
|
+
/// <reference path="./pages/fileBrowser/index.d.ts" />
|
|
7
|
+
/// <reference path="./theme/index.d.ts" />
|
|
8
|
+
/// <reference path="./utils/index.d.ts" />
|
|
9
|
+
/// <reference path="./fileSystem.d.ts" />
|
|
10
|
+
/// <reference path="./sideBarApps.d.ts" />
|
|
11
|
+
|
|
12
|
+
declare namespace Acode {
|
|
13
|
+
interface PluginInit {
|
|
14
|
+
/**
|
|
15
|
+
* When the init function is called, it will receive 3 parameters:
|
|
16
|
+
* @param baseUrl The base URL of the plugin. You can use this URL to access the files in the plugin directory.
|
|
17
|
+
* @param $page This page object can be used to show content.
|
|
18
|
+
* @param options This object can be used to access the cached files.
|
|
19
|
+
*/
|
|
20
|
+
(baseUrl: string, $page: WCPage, options: PluginInitOptions): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface PluginInitOptions {
|
|
24
|
+
/** Url of the cached file. */
|
|
25
|
+
cacheFileUrl: string;
|
|
26
|
+
|
|
27
|
+
/** File object of the cached file. Using this object, you can write/read the file. */
|
|
28
|
+
cacheFile: FileSystem;
|
|
29
|
+
|
|
30
|
+
/** If this is the first time the plugin is loaded, this value will be true. Otherwise, it will be false. */
|
|
31
|
+
firstInit: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface PluginSettings {
|
|
35
|
+
/** An array of settings. */
|
|
36
|
+
list: {
|
|
37
|
+
/** The key of the setting. This key will be used to access the value of the setting. */
|
|
38
|
+
key: string;
|
|
39
|
+
|
|
40
|
+
/** The text of the setting. This text will be displayed in the settings page. */
|
|
41
|
+
text: string;
|
|
42
|
+
|
|
43
|
+
/** The icon of the setting. This icon will be displayed in the settings page. */
|
|
44
|
+
icon?: string;
|
|
45
|
+
|
|
46
|
+
/** The icon color of the setting. This icon color will be displayed in the settings page. */
|
|
47
|
+
iconColor?: string;
|
|
48
|
+
|
|
49
|
+
/** The info of the setting. This info will be displayed in the settings page. */
|
|
50
|
+
info?: string;
|
|
51
|
+
|
|
52
|
+
/** The value of the setting. This value will be displayed in the settings page. */
|
|
53
|
+
value?: unknown;
|
|
54
|
+
|
|
55
|
+
/** The value text of the setting. This value text will be displayed in the settings page. */
|
|
56
|
+
valueText?: (value: unknown) => string;
|
|
57
|
+
|
|
58
|
+
/** If this property is set to true, the setting will be displayed as a checkbox. */
|
|
59
|
+
checkbox?: boolean;
|
|
60
|
+
|
|
61
|
+
/** If this property is set to an array, the setting will be displayed as a select.
|
|
62
|
+
* The array should contain the options of the select. Each option can be a string or an array of two strings.
|
|
63
|
+
* If the option is a string, the value and the text of the option will be the same.
|
|
64
|
+
* If the option is an array of two strings, the first string will be the value of
|
|
65
|
+
* the option and the second string will be the text of the option. */
|
|
66
|
+
select?: Array<Array<string> | string>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* If this property is set to true, the setting will be displayed as a prompt.
|
|
70
|
+
*/
|
|
71
|
+
prompt?: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The type of the prompt. This property is only used when the prompt property is set to true. The default value is text.
|
|
75
|
+
*/
|
|
76
|
+
promptType?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The options of the prompt. This property is only used when the prompt property is set to true and the promptType property is set to select.
|
|
80
|
+
*/
|
|
81
|
+
promptOptions?: {
|
|
82
|
+
/**
|
|
83
|
+
* The regular expression to match the value.
|
|
84
|
+
*/
|
|
85
|
+
match: RegExp;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* If this property is set to true, the value is required.
|
|
89
|
+
*/
|
|
90
|
+
required: boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The placeholder of the prompt.
|
|
94
|
+
*/
|
|
95
|
+
placeholder: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The test function to test the value.
|
|
99
|
+
* @param value
|
|
100
|
+
* @returns
|
|
101
|
+
*/
|
|
102
|
+
test: (value: unknown) => boolean;
|
|
103
|
+
}[];
|
|
104
|
+
}[];
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The callback function that will be called when the settings are changed.
|
|
108
|
+
* @param key
|
|
109
|
+
* @param value
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
cb: (key: string, value: unknown) => void;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
type Require = <K extends string>(
|
|
116
|
+
moduleName: K,
|
|
117
|
+
) => Lowercase<K> extends keyof Modules ? Modules[Lowercase<K>] : unknown;
|
|
118
|
+
|
|
119
|
+
interface Modules {
|
|
120
|
+
acemodes: AceModes;
|
|
121
|
+
actionstack: ActionStack;
|
|
122
|
+
addedfolder: AddedFolder;
|
|
123
|
+
alert: Alert;
|
|
124
|
+
color: Color;
|
|
125
|
+
colorpicker: ColorPicker;
|
|
126
|
+
confirm: Confirm;
|
|
127
|
+
contextmenu: ContextMenuConstructor;
|
|
128
|
+
createkeyboardevent: CreateKeyboardEvent;
|
|
129
|
+
dialogbox: DialogBoxConstructor;
|
|
130
|
+
editorfile: EditorFile;
|
|
131
|
+
encodings: Encodings;
|
|
132
|
+
filebrowser: FileBrowser;
|
|
133
|
+
filelist: FileList;
|
|
134
|
+
fonts: Fonts;
|
|
135
|
+
fs: FS;
|
|
136
|
+
fsoperation: FS;
|
|
137
|
+
inputhints: InputHints;
|
|
138
|
+
helpers: Helpers;
|
|
139
|
+
intent: Intent;
|
|
140
|
+
keyboard: Keyboard;
|
|
141
|
+
loader: Loader;
|
|
142
|
+
multiprompt: MultiPrompt;
|
|
143
|
+
openfolder: OpenFolder;
|
|
144
|
+
page: WCPage;
|
|
145
|
+
palette: Palette;
|
|
146
|
+
projects: Projects;
|
|
147
|
+
prompt: Prompt;
|
|
148
|
+
select: Select;
|
|
149
|
+
selectionmenu: SelectionMenu;
|
|
150
|
+
settings: Settings;
|
|
151
|
+
sidebarapps: SidebarApps;
|
|
152
|
+
sidebutton: SideButtonConstructor;
|
|
153
|
+
terminal: Terminal;
|
|
154
|
+
themebuilder: typeof ThemeBuilder;
|
|
155
|
+
themes: Themes;
|
|
156
|
+
tointernalurl: Helpers["toInternalUri"];
|
|
157
|
+
toast: Toast;
|
|
158
|
+
tutorial: Tutorial;
|
|
159
|
+
url: Url;
|
|
160
|
+
windowresize: WindowResize;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
interface AddIconOptions {
|
|
164
|
+
/** If true, icon will use svg currentColor and adapt to theme */
|
|
165
|
+
monochrome?: boolean;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface FileHandlerOptions {
|
|
169
|
+
/** File extensions to handle (without dots), e.g. ['pdf', 'docx'] */
|
|
170
|
+
extensions: string[];
|
|
171
|
+
/** Function that handles opening the file */
|
|
172
|
+
handleFile: (uri: string) => void | Promise<void>;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** The acode object is the global object that provides access to the Acode API.
|
|
177
|
+
* You can use this object to access the API methods. */
|
|
178
|
+
interface Acode {
|
|
179
|
+
/** This method is used to register the plugin.
|
|
180
|
+
* @param pluginId` The ID of your plugin.
|
|
181
|
+
* @param init The function that will be called when the plugin is loaded.
|
|
182
|
+
* @param settings You can use this parameter to define the settings of the plugin.
|
|
183
|
+
*/
|
|
184
|
+
setPluginInit(
|
|
185
|
+
pluginId: string,
|
|
186
|
+
init: Acode.PluginInit,
|
|
187
|
+
settings?: Acode.PluginSettings,
|
|
188
|
+
): void;
|
|
189
|
+
|
|
190
|
+
/** This method is used to set the unmount function.
|
|
191
|
+
* This function will be called when the plugin is unloaded.
|
|
192
|
+
* You can use this function to clean up the plugin.
|
|
193
|
+
*/
|
|
194
|
+
setPluginUnmount(id: string, unmount: () => void): void;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @param id plugin id
|
|
198
|
+
* @param baseUrl local plugin url
|
|
199
|
+
* @param $page
|
|
200
|
+
*/
|
|
201
|
+
initPlugin(
|
|
202
|
+
id: string,
|
|
203
|
+
baseUrl: string,
|
|
204
|
+
$page: Acode.WCPage,
|
|
205
|
+
options?: Acode.PluginInitOptions,
|
|
206
|
+
): Promise<void>;
|
|
207
|
+
|
|
208
|
+
unmountPlugin(id: string): void;
|
|
209
|
+
|
|
210
|
+
/** This method is used to define a module.
|
|
211
|
+
* @param moduleName The name of the module.
|
|
212
|
+
* @param module The module object. Module name is case insensitive.
|
|
213
|
+
*/
|
|
214
|
+
define(moduleName: string, module: unknown): void;
|
|
215
|
+
|
|
216
|
+
/** This method is used to require a module.
|
|
217
|
+
* @param moduleName The name of the module. Module name is case insensitive.
|
|
218
|
+
* # Example
|
|
219
|
+
* ```js
|
|
220
|
+
* acode.require("say-hello").hello(); // Hello World!
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
require: Acode.Require;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* This method executes a command defined in file src/lib/commands.js.
|
|
227
|
+
* @param command The name of the command. Command name is case insensitive.
|
|
228
|
+
* @param value The value of the command.
|
|
229
|
+
*/
|
|
230
|
+
exec(command: string, value?: unknown): boolean | undefined;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* This method is used to register a formatter.
|
|
234
|
+
* @param pluginId The ID of your plugin.
|
|
235
|
+
* @param extensions An array of file extensions.
|
|
236
|
+
* @param format The function that will be called when the file is formatted.
|
|
237
|
+
*/
|
|
238
|
+
registerFormatter(
|
|
239
|
+
pluginId: string,
|
|
240
|
+
extensions: string[],
|
|
241
|
+
format: () => Promise<void>,
|
|
242
|
+
): void;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* This method is used to unregister a formatter.
|
|
246
|
+
* @param pluginId The ID of your plugin.
|
|
247
|
+
*/
|
|
248
|
+
unregisterFormatter(pluginId: string): void;
|
|
249
|
+
|
|
250
|
+
format(selectIfNull?: boolean): Promise<void>;
|
|
251
|
+
|
|
252
|
+
get formatters(): { id: string; name: string; exts: string[] };
|
|
253
|
+
|
|
254
|
+
getFormatterFor(extensions: string[]): [id: string, name: string][];
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* This method is used to add an icon.
|
|
258
|
+
* @param iconName The name of the icon.
|
|
259
|
+
* @param iconSrc The URL of the icon.
|
|
260
|
+
* @param options Optional settings
|
|
261
|
+
*/
|
|
262
|
+
addIcon(
|
|
263
|
+
iconName: string,
|
|
264
|
+
iconSrc: string,
|
|
265
|
+
options?: Acode.AddIconOptions,
|
|
266
|
+
): void;
|
|
267
|
+
|
|
268
|
+
/** When making Ajax or fetch requests, you need to convert file:// URLs to internal URLs. This method will do it for you. */
|
|
269
|
+
toInternalUrl(url: string): Promise<string>;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Displays a notification in Acode with a title, message and optional configuration.
|
|
273
|
+
* @since v1.10.6, versionCode: 954
|
|
274
|
+
*/
|
|
275
|
+
pushNotification(
|
|
276
|
+
title: string,
|
|
277
|
+
message: string,
|
|
278
|
+
options?: {
|
|
279
|
+
/** Icon for the notification. Can be a URL, base64 encoded image, icon class or SVG string */
|
|
280
|
+
icon?: string;
|
|
281
|
+
|
|
282
|
+
/** Whether notification should auto close. Defaults to true */
|
|
283
|
+
autoClose?: boolean;
|
|
284
|
+
|
|
285
|
+
/** Callback function when notification is clicked */
|
|
286
|
+
action?: () => void;
|
|
287
|
+
|
|
288
|
+
/** Type of notification - can be 'info', 'warning', 'error' or 'success'. Defaults to 'info' */
|
|
289
|
+
type?: "info" | "warning" | "error" | "success";
|
|
290
|
+
},
|
|
291
|
+
): void;
|
|
292
|
+
|
|
293
|
+
/** Installs an Acode plugin from registry with its id by the consent of user.
|
|
294
|
+
* # Example
|
|
295
|
+
*
|
|
296
|
+
* ```js
|
|
297
|
+
* acode.installPlugin("plugin-id", "installer-plugin-name");
|
|
298
|
+
* ```
|
|
299
|
+
* @since v1.10.6, versionCode: 954
|
|
300
|
+
*/
|
|
301
|
+
installPlugin(pluginId: string, installerPluginName: string): Promise<void>;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Creates a new EditorFile instance. This is an alternative to using the EditorFile constructor directly.
|
|
305
|
+
* @param filename Name of the file
|
|
306
|
+
* @param options File creation options
|
|
307
|
+
* @returns A new EditorFile instance
|
|
308
|
+
* @since v1.11.2, versionCode: 958
|
|
309
|
+
*/
|
|
310
|
+
newEditorFile(filename: string, options?: Acode.FileOptions): void;
|
|
311
|
+
|
|
312
|
+
joinUrl: Acode.Url["join"];
|
|
313
|
+
alert: Acode.Alert;
|
|
314
|
+
confirm: Acode.Confirm;
|
|
315
|
+
select: Acode.Select;
|
|
316
|
+
multiPrompt: Acode.MultiPrompt;
|
|
317
|
+
loader: Acode.Loader;
|
|
318
|
+
prompt: Acode.Prompt;
|
|
319
|
+
fsOperation: Acode.FS;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Opens the file browser dialog.
|
|
323
|
+
* @param mode Whether to select files, folders, or both
|
|
324
|
+
* @param info Optional info text to display
|
|
325
|
+
* @param doesOpenLast Should file browser open lastly visited directory?
|
|
326
|
+
* @param defaultDir Default directory to open
|
|
327
|
+
* @returns Selected file or folder information
|
|
328
|
+
*/
|
|
329
|
+
fileBrowser: FileBrowser;
|
|
330
|
+
|
|
331
|
+
get exitAppMessage(): string | undefined;
|
|
332
|
+
|
|
333
|
+
setLoadingMessage(message: string): void;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Wait for a plugin to be fully loaded.
|
|
337
|
+
* Useful for plugins that depend on other plugins.
|
|
338
|
+
* @param pluginId The ID of the plugin to wait for
|
|
339
|
+
* @returns Resolves with true when the plugin is loaded, rejects if plugin fails to load
|
|
340
|
+
* @since v1.11.8
|
|
341
|
+
*/
|
|
342
|
+
waitForPlugin(pluginId: string): Promise<boolean>;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Register a custom file type handler.
|
|
346
|
+
* Allows plugins to handle specific file extensions with custom logic.
|
|
347
|
+
* @param id Unique identifier for the handler
|
|
348
|
+
* @param options Handler configuration
|
|
349
|
+
*/
|
|
350
|
+
registerFileHandler(id: string, options: Acode.FileHandlerOptions): void;
|
|
351
|
+
/**
|
|
352
|
+
* Unregister a previously registered file type handler.
|
|
353
|
+
* @param id The handler id to remove
|
|
354
|
+
*/
|
|
355
|
+
unregisterFileHandler(id: string): void;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/** The acode object is the global object that provides access to the Acode API.
|
|
359
|
+
* You can use this object to access the API methods. */
|
|
360
|
+
declare const acode: Acode;
|
|
361
|
+
|
|
362
|
+
/** The directory where all the assets are stored. */
|
|
363
|
+
declare const ASSETS_DIRECTORY: string;
|
|
364
|
+
|
|
365
|
+
/** The directory where all the cache files are stored. */
|
|
366
|
+
declare const CACHE_STORAGE: string;
|
|
367
|
+
|
|
368
|
+
/** The directory where all the data files are stored. */
|
|
369
|
+
declare const DATA_STORAGE: string;
|
|
370
|
+
|
|
371
|
+
/** The directory where all the plugins are stored. */
|
|
372
|
+
declare const PLUGIN_DIR: string;
|
|
373
|
+
|
|
374
|
+
/** Whether the app supports theme or not. */
|
|
375
|
+
declare const DOES_SUPPORT_THEME: boolean;
|
|
376
|
+
|
|
377
|
+
/** Whether the app is free version or not. */
|
|
378
|
+
declare const IS_FREE_VERSION: boolean;
|
|
379
|
+
|
|
380
|
+
/** The file where all the keybindings are stored. */
|
|
381
|
+
declare const KEYBINDING_FILE: string;
|
|
382
|
+
|
|
383
|
+
/** The Android SDK version. */
|
|
384
|
+
declare const ANDROID_SDK_INT: number;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Logs a message with the specified log level.
|
|
388
|
+
* @param level - The log level.
|
|
389
|
+
* @param message - The message to be logged.
|
|
390
|
+
*/
|
|
391
|
+
declare function log(
|
|
392
|
+
level: "error" | "warn" | "info" | "debug",
|
|
393
|
+
message: unknown,
|
|
394
|
+
): void;
|
|
395
|
+
|
|
396
|
+
declare const ace: Ace;
|
|
397
|
+
|
|
398
|
+
interface Window {
|
|
399
|
+
/** The acode object is the global object that provides access to the Acode API.
|
|
400
|
+
* You can use this object to access the API methods. */
|
|
401
|
+
acode: Acode;
|
|
402
|
+
|
|
403
|
+
/** The directory where all the assets are stored. */
|
|
404
|
+
ASSETS_DIRECTORY: string;
|
|
405
|
+
|
|
406
|
+
/** The directory where all the cache files are stored. */
|
|
407
|
+
CACHE_STORAGE: string;
|
|
408
|
+
|
|
409
|
+
/** The directory where all the data files are stored. */
|
|
410
|
+
DATA_STORAGE: string;
|
|
411
|
+
|
|
412
|
+
/** The directory where all the plugins are stored. */
|
|
413
|
+
PLUGIN_DIR: string;
|
|
414
|
+
|
|
415
|
+
/** Whether the app supports theme or not. */
|
|
416
|
+
DOES_SUPPORT_THEME: boolean;
|
|
417
|
+
|
|
418
|
+
/** Whether the app is free version or not. */
|
|
419
|
+
IS_FREE_VERSION: boolean;
|
|
420
|
+
|
|
421
|
+
/** The file where all the keybindings are stored. */
|
|
422
|
+
KEYBINDING_FILE: string;
|
|
423
|
+
|
|
424
|
+
/** The Android SDK version. */
|
|
425
|
+
ANDROID_SDK_INT: number;
|
|
426
|
+
|
|
427
|
+
tag: typeof tag;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Logs a message with the specified log level.
|
|
431
|
+
* @param level - The log level.
|
|
432
|
+
* @param message - The message to be logged.
|
|
433
|
+
*/
|
|
434
|
+
log: typeof log;
|
|
435
|
+
|
|
436
|
+
ace: Ace;
|
|
437
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare namespace Acode {
|
|
2
|
+
/**
|
|
3
|
+
* The Context Menu API allows you to create and manage custom context menus in your plugin.
|
|
4
|
+
* This API provides an easy way to add menus and other contextual interfaces.
|
|
5
|
+
*/
|
|
6
|
+
interface ContextMenuConstructor {
|
|
7
|
+
/**
|
|
8
|
+
* @param content The HTML content to show in the menu
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
11
|
+
(content: string, options?: ContextMenuOptions): ContextMenu;
|
|
12
|
+
/**
|
|
13
|
+
* @param options Configuration options
|
|
14
|
+
*/
|
|
15
|
+
(options: ContextMenuOptions): ContextMenu;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ContextMenu {
|
|
19
|
+
/** Display the menu. */
|
|
20
|
+
show(): void;
|
|
21
|
+
|
|
22
|
+
/** Hide the menu. */
|
|
23
|
+
hide(): void;
|
|
24
|
+
|
|
25
|
+
/** Remove the menu completely. */
|
|
26
|
+
destroy(): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface ContextMenuOptions {
|
|
30
|
+
/** Left position in pixels. */
|
|
31
|
+
left?: number;
|
|
32
|
+
|
|
33
|
+
/** Top position in pixels. */
|
|
34
|
+
top?: number;
|
|
35
|
+
|
|
36
|
+
/** Bottom position in pixels. */
|
|
37
|
+
bottom?: number;
|
|
38
|
+
|
|
39
|
+
/** Right position in pixels. */
|
|
40
|
+
right?: number;
|
|
41
|
+
|
|
42
|
+
/** CSS transform-origin property. */
|
|
43
|
+
transformOrigin?: string;
|
|
44
|
+
|
|
45
|
+
/** Element that toggles the menu. */
|
|
46
|
+
toggler?: HTMLElement;
|
|
47
|
+
|
|
48
|
+
/** Called when menu is shown. */
|
|
49
|
+
onshow?: () => void;
|
|
50
|
+
|
|
51
|
+
/** Called when menu is hidden. */
|
|
52
|
+
onhide?: () => void;
|
|
53
|
+
|
|
54
|
+
/** Menu items as [text, action] pairs */
|
|
55
|
+
items: [text: string, action: string][];
|
|
56
|
+
|
|
57
|
+
/** Called when an item is clicked. */
|
|
58
|
+
onclick?: (ev: MouseEvent) => void;
|
|
59
|
+
|
|
60
|
+
/** Called when an item is selected. */
|
|
61
|
+
onselect?: (ev: Event) => void;
|
|
62
|
+
|
|
63
|
+
/** Returns HTML string for menu content. */
|
|
64
|
+
innerHTML?: () => string;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference path="./collapsibleList.d.ts" />
|
|
2
|
+
/// <reference path="./contextMenu.d.ts" />
|
|
3
|
+
/// <reference path="./inputhints.d.ts" />
|
|
4
|
+
/// <reference path="./page.d.ts" />
|
|
5
|
+
/// <reference path="./palette.d.ts" />
|
|
6
|
+
/// <reference path="./sideButton.d.ts" />
|
|
7
|
+
/// <reference path="./terminal/index.d.ts" />
|
|
8
|
+
/// <reference path="./toast.d.ts" />
|
|
9
|
+
/// <reference path="./tutorial.d.ts" />
|
|
10
|
+
/// <reference path="./webComponents/index.d.ts" />
|