[TASK] Migrate SelectElementTree to TypeScript
[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 Notification: any;
16 export let Modal: any;
17 export let OpendocsMenu: any;
18 export let Permissions: any;
19 export let Severity: any;
20 export let ShortcutMenu: any;
21 export let Storage: any;
22 export let Tooltip: any;
23 export let Utility: any;
24 export let Wizard: any;
25 export let settings: any;
26 export const lang: { [key: string]: string };
27 export const configuration: any;
28 export namespace CMS {
29 export namespace Backend {
30 export class FormEngineValidation {
31 public readonly errorClass: string;
32 public markFieldAsChanged($field: JQuery): void;
33 public initializeInputFields(): void;
34 public validate(): void;
35 }
36
37 export namespace FormEngine {
38 export namespace Element {
39 export class SelectTree {
40 public dispatch: {[key: string]: Function};
41 public constructor();
42 public initialize(selector: HTMLElement|JQuery, settings: {[key: string]: any}): boolean;
43 }
44 }
45 }
46
47 export class FormEngine {
48 public readonly Validation: FormEngineValidation;
49 public legacyFieldChangedCb(): void;
50 public getFieldElement(fieldName: string, appendix?: string, noFallback?: boolean): JQuery;
51 public updateHiddenFieldValueFromSelect(selectFieldEl: HTMLElement, originalFieldEl: HTMLElement): void;
52 public preventFollowLinkIfNotSaved(href: string): boolean;
53 public setSelectOptionFromExternalSource(
54 fieldName: string,
55 value: string,
56 label: string,
57 title: string,
58 exclusiveValues?: string,
59 $optionEl?: JQuery,
60 ): void;
61 public reinitialize(): void;
62 }
63
64 export class Wizard {
65 public addSlide(identifier: string, title: string, content: string, severity: number, callback?: Function): Wizard;
66 public lockNextStep(): JQuery;
67 public unlockNextStep(): JQuery;
68 public getComponent(): JQuery;
69 public addFinalProcessingSlide(callback?: Function): JQueryXHR;
70 public show(): Wizard;
71 public dismiss(): Wizard;
72 }
73 }
74 }
75 }
76
77 declare namespace TBE_EDITOR {
78 export let fieldChanged: Function;
79 }
80
81 /**
82 * Current AMD/RequireJS modules are returning *instances* of ad-hoc *classes*, make that known to TypeScript
83 */
84 declare module 'TYPO3/CMS/Backend/FormEngineValidation' {
85 export = new TYPO3.CMS.Backend.FormEngineValidation();
86 }
87
88 declare module 'TYPO3/CMS/Backend/FormEngine' {
89 export = new TYPO3.CMS.Backend.FormEngine();
90 }
91
92 declare module 'TYPO3/CMS/Backend/FormEngine/Element/SelectTree' {
93 export = TYPO3.CMS.Backend.FormEngine.Element.SelectTree;
94 }
95
96 declare module 'TYPO3/CMS/Backend/Wizard' {
97 export = new TYPO3.CMS.Backend.Wizard();
98 }
99
100 // type definition for global namespace object
101 interface Window {
102 TYPO3: any;
103 $: any;
104 startInModule: Array<string>;
105 inline: {
106 delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void,
107 };
108 rawurlencode: Function;
109 require: Function;
110 list_frame: Window;
111 jump: Function;
112 currentSubScript: string;
113 currentModuleLoaded: string;
114 fsMod: { [key: string]: any };
115 nextLoadModuleUrl: string;
116
117 // required for Paste.ts
118 // TODO these should be passed as data attributes
119 pasteAfterLinkTemplate: string;
120 pasteIntoLinkTemplate: string;
121 }
122
123 /**
124 * Needed type declarations for provided libs
125 */
126 declare module 'TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min' {
127 import * as imagesloaded from 'imagesloaded';
128 export = imagesloaded;
129 }
130
131
132 declare module 'TYPO3/CMS/Recordlist/LinkBrowser';
133 declare module 'TYPO3/CMS/Backend/LegacyTree';
134
135 declare module 'cm/lib/codemirror';
136 declare module 'moment';
137
138 interface JQueryTypedEvent<T extends Event> extends JQueryEventObject {
139 originalEvent: T;
140 }
141
142 /**
143 * Required to make jQuery plugins "available" in TypeScript
144 */
145 interface JQuery {
146 dataTableExt: any;
147
148 search(term?: string): JQuery;
149
150 draw(): JQuery;
151
152 clearable(options?: any): JQuery;
153
154 datetimepicker(options?: any): JQuery;
155
156 dragUploader(options?: any): JQuery;
157
158 t3FormEngineFlexFormElement(options?: any): JQuery;
159
160 // To be able to use twbs/bootstrap-slider we have to override the definition of jquerui
161 slider(options: { [key: string]: any }): any;
162
163 // To be able to use jquery/autocomplete-slider we have to override the definition of jquerui
164 autocomplete(options?: { [key: string]: any }): any;
165 disablePagingAction(): void;
166 }