[TASK] Cleanup TypeScript type defintions and editorconfig
[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 Icons: any;
11 export let InfoWindow: any;
12 export let ModuleMenu: any;
13 export let Notification: any;
14 export let Modal: any;
15 export let Popover: any;
16 export let Severity: any;
17 export let ShortcutMenu: any;
18 export let Storage: any;
19 export let Utility: any;
20 export const lang: any;
21 export const settings: any;
22 export namespace CMS {
23 export namespace Backend {
24 export class FormEngineValidation {
25 public readonly errorClass: string;
26 }
27
28 export class FormEngine {
29 public readonly Validation: FormEngineValidation;
30 }
31 }
32 }
33 }
34
35 declare namespace TBE_EDITOR {
36 export let fieldChanged: Function;
37 }
38
39 /**
40 * Current AMD/RequireJS modules are returning *instances* of ad-hoc *classes*, make that known to TypeScript
41 */
42 declare module 'TYPO3/CMS/Backend/FormEngineValidation' {
43 export = new TYPO3.CMS.Backend.FormEngineValidation();
44 }
45
46 declare module 'TYPO3/CMS/Backend/FormEngine' {
47 export = new TYPO3.CMS.Backend.FormEngine();
48 }
49
50 // type definition for global namespace object
51 interface Window {
52 TYPO3: any;
53 $: any;
54 startInModule: Array<string>;
55 inline: {
56 delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void
57 };
58 rawurlencode: Function;
59 list_frame: Window;
60 jump: Function;
61 currentSubScript: string;
62 currentModuleLoaded: string;
63 fsMod: { [key: string]: any };
64 nextLoadModuleUrl: string;
65 }
66
67 /**
68 * Needed type declarations for provided libs
69 */
70 declare module 'TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min' {
71 import * as imagesloaded from 'imagesloaded';
72 export = imagesloaded;
73 }
74
75 declare module 'cm/lib/codemirror';
76 declare module 'moment';
77
78 interface JQueryTypedEvent<T extends Event> extends JQueryEventObject {
79 originalEvent: T;
80 }
81
82 /**
83 * Required to make jQuery plugins "available" in TypeScript
84 */
85 interface JQuery {
86 clearable(options?: any): JQuery;
87
88 datetimepicker(options?: any): JQuery;
89
90 dragUploader(options?: any): JQuery;
91
92 // To be able to use twbs/bootstrap-slider we have to override the definition of jquerui
93 slider(options: { [key: string]: any }): any;
94
95 // To be able to use jquery/autocomplete-slider we have to override the definition of jquerui
96 autocomplete(options?: { [key: string]: any }): any;
97 }