f0512070a8557d810f121756805008f9adc7d7a7
[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 DebugConsole: any;
9 export let InfoWindow: any;
10 export let Popover: any;
11 export let ShortcutMenu: any;
12 export let Storage: any;
13 export let Utility: any;
14 export const lang: any;
15 export const settings: any;
16 export namespace CMS {
17 export namespace Backend {
18 export class FormEngineValidation {
19 public readonly errorClass: string;
20 }
21 export class FormEngine {
22 public readonly Validation: FormEngineValidation;
23 }
24 export class Modal {
25 public readonly sizes: {[key: string]: string};
26 public readonly styles: {[key: string]: string};
27 public readonly types: {[key: string]: string};
28 public currentModal: JQuery;
29 public advanced(configuration: object): any;
30 public confirm(title: string, content: any, severity: number, buttons: any[], additionalCssClasses?: string[]): JQuery; // tslint:disable-line:max-line-length
31 public show(title: string, content: any, severity: number, buttons: any[], additionalCssClasses?: string[]): JQuery; // tslint:disable-line:max-line-length
32 public dismiss(): void;
33 }
34 export class Severity {
35 public readonly notice: number;
36 public readonly info: number;
37 public readonly ok: number;
38 public readonly warning: number;
39 public readonly: number;
40 public getCssClass(severity: number): string;
41 }
42 }
43 }
44 }
45
46 /**
47 * Current AMD/RequireJS modules are returning *instances* of ad-hoc *classes*, make that known to TypeScript
48 */
49
50 declare module 'TYPO3/CMS/Backend/FormEngineValidation' {
51 export = new TYPO3.CMS.Backend.FormEngineValidation();
52 }
53
54 declare module 'TYPO3/CMS/Backend/FormEngine' {
55 export = new TYPO3.CMS.Backend.FormEngine();
56 }
57
58 declare module 'TYPO3/CMS/Backend/Modal' {
59 export = new TYPO3.CMS.Backend.Modal();
60 }
61
62 declare module 'TYPO3/CMS/Backend/Severity' {
63 export = new TYPO3.CMS.Backend.Severity();
64 }
65
66 // type definition for global namespace object
67 interface Window {
68 TYPO3: any;
69 $: any;
70 }
71
72 /**
73 * Needed type declarations for provided libs
74 */
75 declare module 'TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min' {
76 import * as imagesloaded from 'imagesloaded';
77 export = imagesloaded;
78 }
79
80 declare module 'cm/lib/codemirror';
81
82 /**
83 * Required to make jQuery plugins "available" in TypeScript
84 */
85 interface JQuery {
86 clearable(): JQuery;
87 }