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