Skip to content

Commit

Permalink
[TASK] Rewrite DragUploader in TypeScript
Browse files Browse the repository at this point in the history
Change-Id: If1aeff95d06e98e9c5a3725445bc616552c1eb14
Resolves: #82585
Releases: master
Reviewed-on: https://review.typo3.org/55295
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
andreaswolf authored and andreaskienast committed Feb 17, 2018
1 parent 111c29f commit 8d8050e
Show file tree
Hide file tree
Showing 3 changed files with 794 additions and 670 deletions.
44 changes: 44 additions & 0 deletions Build/types/TYPO3/index.d.ts
Expand Up @@ -31,6 +31,21 @@ declare namespace TYPO3 {
public show(title: string, content: any, severity: number, buttons: any[], additionalCssClasses?: string[]): JQuery; // tslint:disable-line:max-line-length
public dismiss(): void;
}
export class Notification {
public readonly Notification: {
NOTICE: -2,
INFO: -1,
OK: 0,
WARNING: 1,
ERROR: 2
};
public notice(title: string, message: string, duration: Number): string;
public info(title: string, message: string, duration: Number): string;
public success(title: string, message: string, duration: Number): string;
public warning(title: string, message: string, duration: Number): string;
public error(title: string, message: string, duration: Number): string;
public showMessage(title: string, message: string, severity: Number, duration?: Number): string;
}
export class Severity {
public readonly notice: number;
public readonly info: number;
Expand Down Expand Up @@ -59,6 +74,10 @@ declare module 'TYPO3/CMS/Backend/Modal' {
export = new TYPO3.CMS.Backend.Modal();
}

declare module 'TYPO3/CMS/Backend/Notification' {
export = new TYPO3.CMS.Backend.Notification();
}

declare module 'TYPO3/CMS/Backend/Severity' {
export = new TYPO3.CMS.Backend.Severity();
}
Expand All @@ -67,6 +86,9 @@ declare module 'TYPO3/CMS/Backend/Severity' {
interface Window {
TYPO3: any;
$: any;
inline: {
delayedImportElement: (objectId: number, table: string, uid: number, type: string) => void
};
}

/**
Expand All @@ -78,10 +100,32 @@ declare module 'TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min' {
}

declare module 'cm/lib/codemirror';
declare module 'moment';
declare module 'TYPO3/CMS/Backend/jsfunc.inline';

/**
* Options for the plugin.
* TODO fix this
*/
interface DragUploaderOptions {
/**
* CSS selector for the element where generated messages are inserted. (required)
*/
outputSelector: string;
/**
* Color of the message text. (optional)
*/
outputColor?: string;
}

interface JQueryTypedEvent<T extends Event> extends JQueryEventObject {
originalEvent: T;
}

/**
* Required to make jQuery plugins "available" in TypeScript
*/
interface JQuery {
clearable(): JQuery;
dragUploader(options?: DragUploaderOptions): JQuery;
}

0 comments on commit 8d8050e

Please sign in to comment.