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.
Files changed (79) hide show
  1. package/README.md +8 -0
  2. package/index.d.ts +91 -0
  3. package/package.json +26 -0
  4. package/src/ace/index.d.ts +1 -0
  5. package/src/ace/modelist.d.ts +22 -0
  6. package/src/acode.d.ts +437 -0
  7. package/src/components/collapsibleList.d.ts +11 -0
  8. package/src/components/contextMenu.d.ts +66 -0
  9. package/src/components/index.d.ts +10 -0
  10. package/src/components/inputhints.d.ts +45 -0
  11. package/src/components/page.d.ts +22 -0
  12. package/src/components/palette.d.ts +21 -0
  13. package/src/components/sideButton.d.ts +35 -0
  14. package/src/components/terminal/index.d.ts +1 -0
  15. package/src/components/terminal/terminalManager.d.ts +113 -0
  16. package/src/components/toast.d.ts +20 -0
  17. package/src/components/tutorial.d.ts +13 -0
  18. package/src/components/webComponents/index.d.ts +1 -0
  19. package/src/components/webComponents/wcPage.d.ts +85 -0
  20. package/src/dialogs/alert.d.ts +15 -0
  21. package/src/dialogs/box.d.ts +45 -0
  22. package/src/dialogs/color.d.ts +15 -0
  23. package/src/dialogs/confirm.d.ts +16 -0
  24. package/src/dialogs/index.d.ts +8 -0
  25. package/src/dialogs/loader.d.ts +44 -0
  26. package/src/dialogs/multiPrompt.d.ts +16 -0
  27. package/src/dialogs/prompt.d.ts +47 -0
  28. package/src/dialogs/select.d.ts +66 -0
  29. package/src/fileSystem.d.ts +113 -0
  30. package/src/handlers/index.d.ts +3 -0
  31. package/src/handlers/intent.d.ts +47 -0
  32. package/src/handlers/keyboard.d.ts +30 -0
  33. package/src/handlers/windowResize.d.ts +13 -0
  34. package/src/index.d.ts +12 -0
  35. package/src/lib/actionStack.d.ts +60 -0
  36. package/src/lib/editorFile.d.ts +344 -0
  37. package/src/lib/editorManager.d.ts +127 -0
  38. package/src/lib/fileList.d.ts +70 -0
  39. package/src/lib/fonts.d.ts +29 -0
  40. package/src/lib/index.d.ts +9 -0
  41. package/src/lib/openFolder.d.ts +102 -0
  42. package/src/lib/projects.d.ts +28 -0
  43. package/src/lib/selectionMenu.d.ts +19 -0
  44. package/src/lib/settings.d.ts +155 -0
  45. package/src/pages/fileBrowser/fileBrowser.d.ts +65 -0
  46. package/src/pages/fileBrowser/index.d.ts +1 -0
  47. package/src/pages/index.d.ts +1 -0
  48. package/src/plugins/customtabs/CustomTabs.d.ts +57 -0
  49. package/src/plugins/customtabs/index.d.ts +1 -0
  50. package/src/plugins/index.d.ts +4 -0
  51. package/src/plugins/system/System.d.ts +550 -0
  52. package/src/plugins/system/index.d.ts +1 -0
  53. package/src/plugins/terminal/Executor.d.ts +155 -0
  54. package/src/plugins/terminal/Terminal.d.ts +123 -0
  55. package/src/plugins/terminal/index.d.ts +2 -0
  56. package/src/plugins/websocket/WebSocket.d.ts +224 -0
  57. package/src/plugins/websocket/index.d.ts +1 -0
  58. package/src/sideBarApps.d.ts +39 -0
  59. package/src/test.ts +517 -0
  60. package/src/theme/builder.d.ts +188 -0
  61. package/src/theme/index.d.ts +2 -0
  62. package/src/theme/list.d.ts +29 -0
  63. package/src/utils/KeyboardEvent.d.ts +19 -0
  64. package/src/utils/Url.d.ts +65 -0
  65. package/src/utils/color.d.ts +51 -0
  66. package/src/utils/encodings.d.ts +24 -0
  67. package/src/utils/helpers.d.ts +102 -0
  68. package/src/utils/index.d.ts +5 -0
  69. package/types/ace/VERSION +1 -0
  70. package/types/ace/ace-modes.d.ts +1724 -0
  71. package/types/ace/index.d.ts +1176 -0
  72. package/types/ace/types/ace-ext.d.ts +720 -0
  73. package/types/ace/types/ace-lib.d.ts +302 -0
  74. package/types/ace/types/ace-modules.d.ts +5293 -0
  75. package/types/ace/types/ace-snippets.d.ts +406 -0
  76. package/types/ace/types/ace-theme.d.ts +437 -0
  77. package/types/html-tag-js.d.ts +680 -0
  78. package/types/require.d.ts +412 -0
  79. package/types/xterm.d.ts +1908 -0
@@ -0,0 +1,127 @@
1
+ declare namespace Acode {
2
+ /**
3
+ * The editorManager allows to interact with the Editor Instance and listen to various events
4
+ * of Acode app with the help of various methods and Properties.
5
+ * Basically for interacting with the opened files and tabs.
6
+ */
7
+ interface EditorManager {
8
+ /** This property returns a list of all files. */
9
+ files: EditorFile[];
10
+
11
+ onupdate: () => void;
12
+ /**
13
+ * This property returns the current file.
14
+ */
15
+ activeFile: EditorFile;
16
+
17
+ /**
18
+ * Adds a file to the manager's file list and updates the UI.
19
+ * @param file - The file to be added.
20
+ */
21
+ addFile(file: EditorFile): void;
22
+
23
+ /**
24
+ * This is an instance of the Ace editor.
25
+ */
26
+ editor: Ace.Editor;
27
+
28
+ /**
29
+ * This function gets files from the list of opened files.
30
+ * @param test the file id, uri, repo, or gist to find the file.
31
+ * @param type the type of test.
32
+ */
33
+ getFile(test: string, type: "uri" | "id" | "name"): EditorFile;
34
+
35
+ /**
36
+ * This function switches the tab to the given file id.
37
+ */
38
+ switchFile(id: string): void;
39
+
40
+ /**
41
+ * This function returns the number of unsaved files.
42
+ */
43
+ hasUnsavedFiles(): number;
44
+
45
+ /**
46
+ * Gets the height of the editor
47
+ */
48
+ getEditorHeight(editor: Ace.Editor): number;
49
+
50
+ /**
51
+ * Gets the height of the editor
52
+ */
53
+ getEditorWidth(editor: Ace.Editor): number;
54
+
55
+ /**
56
+ * container: HTMLElement
57
+ */
58
+ container: HTMLElement;
59
+
60
+ /**
61
+ * The header element
62
+ */
63
+ header: HTMLElement;
64
+
65
+ /**
66
+ * Whether the editor is currently scrolling.
67
+ */
68
+ readonly isScrolling: boolean;
69
+
70
+ readonly TIMEOUT_VALUE: number;
71
+
72
+ readonly openFileList: HTMLElement;
73
+
74
+ /** This function adds a listener for the specified event. */
75
+ on(
76
+ event:
77
+ | "file-content-changed"
78
+ | "file-loaded"
79
+ | "remove-file"
80
+ | "save-file"
81
+ | "switch-file",
82
+ listener: (file: EditorFile) => void,
83
+ ): void;
84
+ on(
85
+ event: "add-folder" | "remove-folder" | "update-folder",
86
+ listener: (ev: { url: string; name: string }) => void,
87
+ ): void;
88
+ on(event: EditorEvent, listener: (...args: any[]) => void): void;
89
+
90
+ /** This function removes a listener for the specified event. */
91
+ off(event: string, listener: (...args: any[]) => void): void;
92
+
93
+ /** This function emits an event with the specified arguments. */
94
+ emit(event: EditorEvent, ...args: any[]): void;
95
+ }
96
+
97
+ /** Editor Event */
98
+ type EditorEvent =
99
+ | "add-folder"
100
+ | "change"
101
+ | "file-content-changed"
102
+ | "file-loaded"
103
+ | "init-open-file-list"
104
+ | "new-file"
105
+ | "remove-file"
106
+ | "remove-folder"
107
+ | "rename-file"
108
+ | "save-file"
109
+ | "switch-file"
110
+ | "update-folder";
111
+ }
112
+
113
+ /**
114
+ * The editorManager allows to interact with the Editor Instance and listen to various events
115
+ * of Acode app with the help of various methods and Properties.
116
+ * Basically for interacting with the opened files and tabs.
117
+ */
118
+ declare const editorManager: Acode.EditorManager;
119
+
120
+ interface Window {
121
+ /**
122
+ * The editorManager allows to interact with the Editor Instance and listen to various events
123
+ * of Acode app with the help of various methods and Properties.
124
+ * Basically for interacting with the opened files and tabs.
125
+ */
126
+ editorManager: Acode.EditorManager;
127
+ }
@@ -0,0 +1,70 @@
1
+ declare namespace Acode {
2
+ /**
3
+ * The File List API provides functionality to manage and interact with files and folders in the Acode workspace.
4
+ * It returns a tree structure representing the file system hierarchy.
5
+ */
6
+ interface FileList {
7
+ /** Get all files in a folder */
8
+ (dir: string | (() => object)): Tree[];
9
+
10
+ /**
11
+ * Adds event listener for file list
12
+ * @param event - Event name
13
+ * @param callback - Callback function
14
+ */
15
+ on(event: FileListEvent, callback: (tree: Tree) => void): void;
16
+
17
+ /**
18
+ * Removes event listener for file list
19
+ * @param event - Event name
20
+ * @param callback - Callback function
21
+ */
22
+ off(event: FileListEvent, callback: (tree: Tree) => void): void;
23
+ }
24
+
25
+ interface Tree {
26
+ /** Name of the file/folder */
27
+ name: string;
28
+
29
+ /** Absolute URL path */
30
+ url: string;
31
+
32
+ /** Relative path */
33
+ path: string;
34
+
35
+ /** Child files/folders (if directory) */
36
+ children: Tree[];
37
+
38
+ /** Parent folder reference */
39
+ parent: Tree;
40
+
41
+ /** Whether root is in open folder list */
42
+ readonly isConnected: boolean;
43
+
44
+ /** Root folder reference */
45
+ readonly root: Tree;
46
+
47
+ /**
48
+ * Updates the file/folder URL and name
49
+ */
50
+ update(url: string, name?: string): void;
51
+
52
+ /** Converts tree to JSON representation */
53
+ toJSON(): TreeJson;
54
+ }
55
+
56
+ interface TreeJson {
57
+ name: string;
58
+ url: string;
59
+ path: string;
60
+ parent: string;
61
+ isDirectory: boolean;
62
+ }
63
+
64
+ type FileListEvent =
65
+ | "add-file"
66
+ | "remove-file"
67
+ | "add-folder"
68
+ | "remove-folder"
69
+ | "refresh";
70
+ }
@@ -0,0 +1,29 @@
1
+ declare namespace Acode {
2
+ /**
3
+ * A straightforward API for managing fonts in your Acode project.
4
+ */
5
+ interface Fonts {
6
+ /**
7
+ * Adds a new font to your project.
8
+ * @param name Unique identifier for the font
9
+ * @param css CSS @font-face declaration
10
+ */
11
+ add(name: string, css: string): void;
12
+
13
+ addCustom: (name: string, css: string) => void;
14
+
15
+ /** Retrieves a specific font's details. */
16
+ get(name: string): { name: string; css: string } | undefined;
17
+
18
+ /** Lists all available font names. */
19
+ getNames(): string[];
20
+
21
+ remove: (name: string) => boolean;
22
+
23
+ has: (name: string) => boolean;
24
+
25
+ setFont: (name: string) => Promise<void>;
26
+
27
+ loadFont: (name: string) => Promise<string>;
28
+ }
29
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference path="./actionStack.d.ts" />
2
+ /// <reference path="./editorFile.d.ts" />
3
+ /// <reference path="./editorManager.d.ts" />
4
+ /// <reference path="./fileList.d.ts" />
5
+ /// <reference path="./fonts.d.ts" />
6
+ /// <reference path="./openFolder.d.ts" />
7
+ /// <reference path="./projects.d.ts" />
8
+ /// <reference path="./selectionMenu.d.ts" />
9
+ /// <reference path="./settings.d.ts" />
@@ -0,0 +1,102 @@
1
+ declare namespace Acode {
2
+ interface OpenFolder {
3
+ /**
4
+ * @param path The path of the folder to be opened.
5
+ */
6
+ (path: string, options?: OpenFolderOptions): void;
7
+
8
+ /**
9
+ * Adds file or folder to the list if expanded.
10
+ * @param url Url of file or folder to add
11
+ * @param type is file or folder
12
+ */
13
+ add(url: string, type: "file" | "folder"): void;
14
+
15
+ /** Renames an existing file or folder. */
16
+ renameItem(oldFile: string, newFile: string, newFilename: string): void;
17
+
18
+ /** Removes an existing file or folder. */
19
+ removeItem(url: string): void;
20
+
21
+ /** Removes multiple folders based on a URL pattern */
22
+ removeFolders(url: string): void;
23
+
24
+ /**
25
+ * Find the folder that contains the url
26
+ * @param {String} url
27
+ * @returns {Folder}
28
+ */
29
+ find(url: string): void;
30
+ }
31
+
32
+ type OpenFolderOptions = {
33
+ /** A name to be assigned to the folder. If not provided, the folder's name from the file system will be used. */
34
+ name?: string;
35
+ } & Partial<Pick<Folder, "id" | "saveState" | "listFiles" | "listState">>;
36
+
37
+ /** The addedFolder object is the global object which returns an Array of object.
38
+ * This object provides essential properties and methods to interact with the currently
39
+ * opened folders in the sidenav of Acode app.
40
+ * Use these properties and methods to manipulate folder states, reload contents,
41
+ * and manage folder visibility effectively.
42
+ */
43
+ type AddedFolder = Folder[];
44
+
45
+ interface Folder {
46
+ /** An ID to be assigned to the folder. If not provided, an ID will be automatically generated. */
47
+ id: string;
48
+
49
+ /** The URL of the folder. */
50
+ url: string;
51
+
52
+ /** The title of the folder. */
53
+ title: string;
54
+
55
+ /** List all files recursively. */
56
+ listFiles: boolean;
57
+
58
+ /**
59
+ * Indicates whether the state of the folder should be saved when the user closes it.
60
+ * @default true
61
+ */
62
+ saveState: boolean;
63
+
64
+ /** The HTML element of the folder. */
65
+ $node: Collapsible;
66
+
67
+ clipBoard: ClipBoard;
68
+
69
+ /** Removes the folder from the sidenav. */
70
+ remove: () => void;
71
+
72
+ /** Reloads the folder. */
73
+ reload: () => void;
74
+
75
+ /** The state of the folders in the folder. K -> dir, V -> open */
76
+ listState: Map<string, boolean>;
77
+ }
78
+
79
+ interface ClipBoard {
80
+ url?: string;
81
+ $el?: HTMLElement;
82
+ action?: "cut" | "copy";
83
+ }
84
+ }
85
+
86
+ /** The addedFolder object is the global object which returns an Array of object.
87
+ * This object provides essential properties and methods to interact with the currently
88
+ * opened folders in the sidenav of Acode app.
89
+ * Use these properties and methods to manipulate folder states, reload contents,
90
+ * and manage folder visibility effectively.
91
+ */
92
+ declare const addedFolder: Acode.AddedFolder;
93
+
94
+ interface Window {
95
+ /** The addedFolder object is the global object which returns an Array of object.
96
+ * This object provides essential properties and methods to interact with the currently
97
+ * opened folders in the sidenav of Acode app.
98
+ * Use these properties and methods to manipulate folder states, reload contents,
99
+ * and manage folder visibility effectively.
100
+ */
101
+ addedFolder: Acode.AddedFolder;
102
+ }
@@ -0,0 +1,28 @@
1
+ declare namespace Acode {
2
+ /**
3
+ * This provide methods to manipulate project templates. This includes listing available projects, retrieving specific project details, and setting new project templates.
4
+ * This is particularly useful for creating and managing templates for different types of projects(frameworks), such as HTML templates, react, etc.
5
+ */
6
+ interface Projects {
7
+ /**
8
+ * Returns an array of objects, each containing the name and icon of a project.
9
+ */
10
+ list(): { name: string; icon: string }[];
11
+
12
+ /**
13
+ * Takes a project name as an argument and returns an object containing the files and icon of that project.
14
+ */
15
+ get(
16
+ name: string,
17
+ ): { files: Record<string, string>; icon: string } | undefined;
18
+
19
+ /**
20
+ * Adds a new project template. It takes the project name, a function that returns a map of files, and an icon source as arguments.
21
+ */
22
+ set(
23
+ project: string,
24
+ files: () => Promise<Record<string, string>>,
25
+ iconSrc: string,
26
+ ): void;
27
+ }
28
+ }
@@ -0,0 +1,19 @@
1
+ declare namespace Acode {
2
+ interface SelectionMenu {
3
+ /**
4
+ * The add method allows you to add new items to the selection menu.
5
+ * @param onclick A function that gets executed when the menu item is clicked.
6
+ * @param text The icon or text to display in the menu.
7
+ * @param mode Specifies when this item should be shown in the selection menu. The possible values are:
8
+ * 'selected': Show when some text is selected.
9
+ * 'all': Show regardless of text selection.
10
+ * @param readOnly A boolean value that determines whether the item should be shown in read-only mode.
11
+ */
12
+ add(
13
+ onclick: (ev?: MouseEvent) => void,
14
+ text: string,
15
+ mode: "selected" | "all",
16
+ readOnly?: boolean,
17
+ ): void;
18
+ }
19
+ }
@@ -0,0 +1,155 @@
1
+ declare namespace Acode {
2
+ /**
3
+ * The Settings module provides a way to interact with Acode's settings, allowing you to read, update and listen for changes to settings values.
4
+ */
5
+ interface Settings {
6
+ readonly QUICKTOOLS_ROWS: number;
7
+ readonly QUICKTOOLS_GROUP_CAPACITY: number;
8
+ readonly QUICKTOOLS_GROUPS: number;
9
+ readonly QUICKTOOLS_TRIGGER_MODE_TOUCH: string;
10
+ readonly QUICKTOOLS_TRIGGER_MODE_CLICK: string;
11
+ readonly OPEN_FILE_LIST_POS_HEADER: string;
12
+ readonly OPEN_FILE_LIST_POS_SIDEBAR: string;
13
+ readonly OPEN_FILE_LIST_POS_BOTTOM: string;
14
+ readonly KEYBOARD_MODE_NO_SUGGESTIONS: string;
15
+ readonly KEYBOARD_MODE_NO_SUGGESTIONS_AGGRESSIVE: string;
16
+ readonly KEYBOARD_MODE_NORMAL: string;
17
+ readonly CONSOLE_ERUDA: string;
18
+ readonly CONSOLE_LEGACY: string;
19
+ readonly PREVIEW_MODE_INAPP: string;
20
+ readonly PREVIEW_MODE_BROWSER: string;
21
+
22
+ uiSettings: any;
23
+
24
+ value: ISettings;
25
+
26
+ init(): Promise<void>;
27
+
28
+ /**
29
+ * Updates one or more settings.
30
+ * @param settings Object containing settings to update.
31
+ * @param showToast Whether to show a confirmation toast (default: true).
32
+ * @param save Whether to save settings (default: true).
33
+ */
34
+ update(
35
+ settings: Partial<ISettings>,
36
+ showToast: boolean,
37
+ save: boolean,
38
+ ): Promise<void>;
39
+
40
+ /**
41
+ * Resets settings to default values.
42
+ * @param setting The name of the setting to reset. If setting is not provided, all settings will be reset.
43
+ */
44
+ reset(setting?: string): Promise<void>;
45
+
46
+ /**
47
+ * Adds an event listener
48
+ * @param event Event name in format 'update:setting' or 'reset'
49
+ * @param callback Function to call when event occurs
50
+ */
51
+ on<K extends keyof ISettings>(
52
+ event: `update:${K}`,
53
+ callback: (value: ISettings[K]) => void,
54
+ ): void;
55
+ on(event: "reset", callback: (value: ISettings) => void): void;
56
+
57
+ /**
58
+ * Removes an event listener from the settings.
59
+ * @param event Event name in format 'update:setting' or 'reset'
60
+ * @param callback Function to remove
61
+ */
62
+ off<K extends keyof ISettings>(
63
+ event: `update:${K}`,
64
+ callback: (value: ISettings[K]) => void,
65
+ ): void;
66
+ off(event: "reset", callback: (value: ISettings) => void): void;
67
+
68
+ /**
69
+ * Gets the value of the setting.
70
+ * @param setting Name of the setting to get.
71
+ */
72
+ get<K extends keyof ISettings>(setting: K): ISettings[K];
73
+
74
+ applyAnimationSetting(): Promise<void>;
75
+ applyLangSetting(): Promise<void>;
76
+ }
77
+
78
+ interface ISettings {
79
+ animation: string;
80
+ appTheme: string;
81
+ autosave: number;
82
+ fileBrowser: {
83
+ showHiddenFiles: boolean;
84
+ sortByName: boolean;
85
+ };
86
+ formatter: Record<string, unknown>;
87
+ maxFileSize: number;
88
+ serverPort: number;
89
+ previewPort: number;
90
+ showConsoleToggler: boolean;
91
+ previewMode: string;
92
+ disableCache: boolean;
93
+ useCurrentFileForPreview: boolean;
94
+ host: string;
95
+ search: {
96
+ caseSensitive: boolean;
97
+ regExp: boolean;
98
+ wholeWord: boolean;
99
+ };
100
+ lang: string;
101
+ fontSize: string;
102
+ editorTheme: string;
103
+ textWrap: boolean;
104
+ softTab: boolean;
105
+ tabSize: number;
106
+ retryRemoteFsAfterFail: boolean;
107
+ linenumbers: boolean;
108
+ formatOnSave: boolean;
109
+ fadeFoldWidgets: boolean;
110
+ autoCorrect: boolean;
111
+ openFileListPos: string;
112
+ quickTools: number;
113
+ quickToolsTriggerMode: string;
114
+ editorFont: string;
115
+ vibrateOnTap: boolean;
116
+ fullscreen: boolean;
117
+ floatingButton: boolean;
118
+ liveAutoCompletion: boolean;
119
+ showPrintMargin: boolean;
120
+ printMargin: number;
121
+ scrollbarSize: number;
122
+ showSpaces: boolean;
123
+ confirmOnExit: boolean;
124
+ lineHeight: number;
125
+ leftMargin: number;
126
+ checkFiles: boolean;
127
+ desktopMode: boolean;
128
+ console: string;
129
+ keyboardMode: string;
130
+ rememberFiles: boolean;
131
+ rememberFolders: boolean;
132
+ diagonalScrolling: boolean;
133
+ reverseScrolling: boolean;
134
+ teardropTimeout: number;
135
+ teardropSize: number;
136
+ scrollSpeed: string;
137
+ customTheme: Record<string, string>;
138
+ relativeLineNumbers: boolean;
139
+ elasticTabstops: boolean;
140
+ rtlText: boolean;
141
+ hardWrap: boolean;
142
+ useTextareaForIME: boolean;
143
+ touchMoveThreshold: number;
144
+ quicktoolsItems: unknown[];
145
+ excludeFolders: string[];
146
+ defaultFileEncoding: string;
147
+ inlineAutoCompletion: boolean;
148
+ colorPreview: boolean;
149
+ maxRetryCount: number;
150
+ showRetryToast: boolean;
151
+ showSideButtons: boolean;
152
+ showAnnotations: boolean;
153
+ pluginsDisabled: Record<string, boolean>;
154
+ }
155
+ }
@@ -0,0 +1,65 @@
1
+ type BrowseMode = "file" | "folder" | "both";
2
+
3
+ interface SelectedFile {
4
+ type: "file" | "folder";
5
+ url: string;
6
+ name: string;
7
+ }
8
+
9
+ interface DefaultDir {
10
+ name: string;
11
+ url: string;
12
+ }
13
+
14
+ interface FileBrowser {
15
+ /**
16
+ * Opens the file browser.
17
+ * @param mode Specify file browser mode
18
+ * @param info A small message to show what the file browser is opened for
19
+ * @param doesOpenLast Should file browser open lastly visited directory?
20
+ * @param defaultDir Default directory to open
21
+ * @returns Selected file or folder information
22
+ */
23
+ (
24
+ mode?: BrowseMode,
25
+ info?: string,
26
+ doesOpenLast?: boolean,
27
+ ...defaultDir: DefaultDir[]
28
+ ): Promise<SelectedFile>;
29
+
30
+ /**
31
+ * Opens the selected file in the editor.
32
+ * @param res The selected file result from file browser
33
+ */
34
+ openFile(res: SelectedFile & { mode?: string }): void;
35
+
36
+ /**
37
+ * Handles file open errors.
38
+ * @param err Error object with optional code property
39
+ */
40
+ openFileError(err: { code?: number }): void;
41
+
42
+ /**
43
+ * Opens the selected folder.
44
+ * @param res The selected folder result from file browser
45
+ */
46
+ openFolder(res: SelectedFile): Promise<void>;
47
+
48
+ /**
49
+ * Handles folder open errors.
50
+ * @param err Error object with optional code property
51
+ */
52
+ openFolderError(err: { code?: number }): void;
53
+
54
+ /**
55
+ * Opens the selected file or folder based on its type.
56
+ * @param res The selected result from file browser
57
+ */
58
+ open(res: SelectedFile): void;
59
+
60
+ /**
61
+ * Handles open errors (delegates to openFileError).
62
+ * @param err Error object with optional code property
63
+ */
64
+ openError(err: { code?: number }): void;
65
+ }
@@ -0,0 +1 @@
1
+ /// <reference path="./fileBrowser.d.ts" />
@@ -0,0 +1 @@
1
+ /// <reference path="./fileBrowser/index.d.ts" />
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Options for opening a URL in Chrome Custom Tabs.
3
+ */
4
+ interface CustomTabsOptions {
5
+ /**
6
+ * The toolbar color for the Custom Tab.
7
+ * Accepts any valid CSS color string (e.g., '#FF5733', 'rgb(255,87,51)', 'red').
8
+ */
9
+ toolbarColor?: string;
10
+
11
+ /**
12
+ * Whether to show the page title in the toolbar.
13
+ * @default true
14
+ */
15
+ showTitle?: boolean;
16
+ }
17
+
18
+ /**
19
+ * Chrome Custom Tabs plugin for Cordova.
20
+ * Opens URLs in a Chrome Custom Tab, providing a seamless in-app browsing experience
21
+ * with faster loading times compared to launching the default browser.
22
+ * Falls back to the default browser if Custom Tabs are not available.
23
+ */
24
+ interface CustomTabs {
25
+ /**
26
+ * Opens a URL in a Chrome Custom Tab.
27
+ *
28
+ * @param url - The URL to open.
29
+ * @param options - Optional configuration for the Custom Tab appearance.
30
+ * @param success - Callback called when the Custom Tab is successfully launched.
31
+ * @param error - Callback called if an error occurs while opening the URL.
32
+ *
33
+ * @example
34
+ * // Open a URL with default options
35
+ * CustomTabs.open('https://example.com');
36
+ *
37
+ * @example
38
+ * // Open with custom toolbar color
39
+ * CustomTabs.open(
40
+ * 'https://example.com',
41
+ * { toolbarColor: '#6200EE', showTitle: true },
42
+ * () => console.log('Opened successfully'),
43
+ * (err) => console.error('Failed to open:', err)
44
+ * );
45
+ */
46
+ open(
47
+ url: string,
48
+ options?: CustomTabsOptions,
49
+ success?: () => void,
50
+ error?: (message: string) => void,
51
+ ): void;
52
+ }
53
+
54
+ /**
55
+ * Global CustomTabs instance for opening URLs in Chrome Custom Tabs.
56
+ */
57
+ declare const CustomTabs: CustomTabs;
@@ -0,0 +1 @@
1
+ /// <reference path="./CustomTabs.d.ts" />
@@ -0,0 +1,4 @@
1
+ /// <reference path="./customtabs/index.d.ts" />
2
+ /// <reference path="./system/index.d.ts" />
3
+ /// <reference path="./terminal/index.d.ts" />
4
+ /// <reference path="./websocket/index.d.ts" />