[BUGFIX] Avoid deprecated methods in DebuggerUtility
[Packages/TYPO3.CMS.git] / Build / types / TYPO3 / index.d.ts
1 /* tslint:disable:max-classes-per-file */
2
3 /**
4 * Currently a mixture between namespace and global object
5 * Add types as you use them
6 */
7 declare namespace TYPO3 {
8 export let Backend: any;
9 export let DebugConsole: any;
10 export let ExtensionManager: any;
11 export let Icons: any;
12 export let InfoWindow: any;
13 export let LoginRefresh: any;
14 export let ModuleMenu: any;
15 export let MultiStepWizard: any;
16 export let Notification: any;
17 export let Modal: any;
18 export let OpendocsMenu: any;
19 export let Permissions: any;
20 export let Severity: any;
21 export let ShortcutMenu: any;
22 export let Storage: any;
23 export let Tooltip: any;
24 export let Utility: any;
25 export let WindowManager: any;
26 export let Wizard: any;
27 export let WorkspacesMenu: any;
28 export let settings: any;
29 export const lang: { [key: string]: string };
30 export const configuration: any;
31 export namespace CMS {
32 export namespace Backend {
33 export class FormEngineValidation {
34 public readonly errorClass: string;
35 public markFieldAsChanged(field: HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement|JQuery): void;
36 public initializeInputFields(): void;
37 public validate(section?: Element): void;
38 public validateField(field: HTMLInputElement|HTMLTextAreaElement|HTMLSelectElement|JQuery, value?: string): void;
39 }
40
41 export namespace FormEngine {
42 export namespace Element {
43 export class SelectTree {
44 public dispatch: {[key: string]: Function};
45 public constructor();
46 public initialize(selector: HTMLElement|JQuery, settings: {[key: string]: any}): boolean;
47 }
48 }
49 }
50
51 // @todo transform to proper interface, once FormEngine.js is migrated to TypeScript
52 export interface OnFieldChangeItem {
53 name: string;
54 data: {[key: string]: string|number|boolean|null}
55 }
56
57 export class FormEngine {
58 public readonly Validation: FormEngineValidation;
59 public legacyFieldChangedCb(): void;
60 public getFieldElement(fieldName: string, appendix?: string, noFallback?: boolean): JQuery;
61 public updateHiddenFieldValueFromSelect(selectFieldEl: HTMLElement, originalFieldEl: HTMLElement): void;
62 public preventFollowLinkIfNotSaved(href: string): boolean;
63 public setSelectOptionFromExternalSource(
64 fieldName: string,
65 value: string,
66 label: string,
67 title: string,
68 exclusiveValues?: string,
69 optionEl?: HTMLOptionElement | JQuery,
70 ): void;
71 public reinitialize(): void;
72 public openPopupWindow(mode: string, params: string): JQuery;
73 public initializeNullNoPlaceholderCheckboxes(): void;
74 public initializeNullWithPlaceholderCheckboxes(): void;
75 public requestFormEngineUpdate(askForUpdate: boolean): void
76 public processOnFieldChange(items: OnFieldChangeItem[]): void
77 }
78
79 export class MultiStepWizard {
80 public addSlide(identifier: string, title: string, content: string, severity: number, callback?: Function): MultiStepWizard;
81 public lockNextStep(): JQuery;
82 public unlockNextStep(): JQuery;
83 public lockPrevStep(): JQuery;
84 public unlockPrevStep(): JQuery;
85 public blurCancelStep(): JQuery;
86 public getComponent(): JQuery;
87 public addFinalProcessingSlide(callback?: Function): JQueryXHR;
88 public show(): MultiStepWizard;
89 public dismiss(): MultiStepWizard;
90 }
91 }
92 }
93 }
94
95 /**
96 * Current AMD/RequireJS modules are returning *instances* of ad-hoc *classes*, make that known to TypeScript
97 */
98 declare module 'TYPO3/CMS/Backend/FormEngineValidation' {
99 const _exported: TYPO3.CMS.Backend.FormEngineValidation;
100 export = _exported;
101 }
102
103 declare module 'TYPO3/CMS/Backend/FormEngine' {
104 const _exported: TYPO3.CMS.Backend.FormEngine;
105 export = _exported;
106 }
107
108 // type definition for global namespace object
109 interface Window {
110 TYPO3: any;
111 $: any; // only required in ImageManipulation.ts
112 require: Function;
113 list_frame: Window;
114 jump: Function;
115 currentSubScript: string;
116 currentModuleLoaded: string;
117 fsMod: { [key: string]: any };
118 nextLoadModuleUrl: string;
119
120 // required for Paste.ts
121 // TODO these should be passed as data attributes
122 pasteAfterLinkTemplate: string;
123 pasteIntoLinkTemplate: string;
124 }
125
126 /**
127 * Needed type declarations for provided libs
128 */
129 declare module 'muuri';
130 declare module 'codemirror';
131 declare module 'flatpickr/flatpickr.min';
132 declare module 'moment';
133 declare module 'TYPO3/CMS/Backend/LegacyTree';
134 declare module 'TYPO3/CMS/Recordlist/LinkBrowser';
135 declare module 'TYPO3/CMS/Dashboard/Contrib/chartjs';
136
137 interface JQueryTypedEvent<T extends Event> extends JQueryEventObject {
138 originalEvent: T;
139 }
140
141 /**
142 * Required to make jQuery plugins "available" in TypeScript
143 */
144 interface JQuery {
145 datetimepicker(options?: any): JQuery;
146
147 dragUploader(options?: any): JQuery;
148
149 // To be able to use devbridge-autocomplete we have to override the definition of jquerui
150 autocomplete(options?: { [key: string]: any }): any;
151 disablePagingAction(): void;
152 }
153
154 interface JQueryStatic {
155 escapeSelector(selector: string): string;
156 }