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