/// import { DataList } from "./DataList"; import { ModalController } from "./Modal"; import { Editor } from "tinymce"; export declare interface MediaObject { id: number; fileSize: number; fileType: string; filename: string; blobReference: string; createdOn: Date; url: string; thumbUrl: string; smallUrl: string; mediumUrl: string; largeUrl: string; uniqueId: string; genericFileType: 'Image' | 'PDF' | 'Word' | 'Photoshop' | 'Excel' | 'PowerPoint' | 'Directory' | 'Audio' | 'Video' | 'Unknown'; downloadUrl: string; downloadUrlHttps: string; icon: string; formattedSize: string; path: string; } export interface MediaOptions { /** * Action for the media service to take when a media item is clicked. */ action: 'insert' | 'attach' | 'select' | string; /** * Selector for any elements that require a refresh of background-image or src (if applicable). */ refresh?: string; /** * Insert/Select Only: Input field to insert image url to. */ size?: string; /** * Select/Gallery Only: Input field to insert image url to. */ target?: string; /** * Insert Only: Input field to insert image url to. */ targetEditor?: Editor; /** * Attach Only: Post url to send the selected media id to when clicked. Must accept mediaId as a parameter. */ url?: string; /** * Called before the action is carried out. */ beforeAction?: (sender?: HTMLElement) => void; /** * Called when the action is complete. */ onAction?: (mediaObject: MediaObject, sender?: HTMLElement) => void; /** * Called before the media list is is fetched. */ onListLoad?: (sender?: HTMLElement) => void; /** * Called before the fetched HTML is rendered to the media list. Must return the data back to datalist to render. */ onListRender?: (html: string, sender?: HTMLElement) => string; /** * Called when media list loading and rendering is complete. */ onListComplete?: (html: string, sender?: HTMLElement) => void; /** * Called when an error occurs. */ onError?: (jqXHR: any, textStatus: any, errorThrown: any) => void; } export declare class MediaService { media: DataList; element: HTMLElement; options: MediaOptions; currentBlade: ModalController; progress: JQuery; progressText: JQuery; uploadButton: HTMLElement; uploader: HTMLElement; progressArea: HTMLElement; dropzone: any; galleryInitialised: boolean; constructor(element: HTMLElement, options: MediaOptions); initUploader(): void; createDirectory(this: MediaService, e: JQuery.ClickEvent): void; deleteDirectory(this: MediaService, e: JQuery.ClickEvent): void; uploadUrl(): string; action(this: MediaService, e: JQuery.ClickEvent): void; show(this: MediaService, mediaObject: MediaObject, sender: JQuery.ClickEvent): void; select(this: MediaService, mediaObject: MediaObject, e: JQuery.ClickEvent): void; insert(this: MediaService, mediaObject: MediaObject, e: JQuery.ClickEvent): void; attach(this: MediaService, mediaObject: MediaObject, e: JQuery.ClickEvent): void; selectedMedia: MediaObject[]; galleryClick(this: MediaService, mediaObject: MediaObject, e: JQuery.ClickEvent): void; galleryAdd(this: MediaService, e: JQuery.ClickEvent): void; isMediaSelected(mediaObject: MediaObject): boolean; static refresh(media: MediaObject, refresh: string): void; delete(this: MediaService, e: JQuery.ClickEvent): void; } export declare class MediaModal { modal: ModalController; list: HTMLElement; service: MediaService; element: HTMLElement; constructor(); initGallery(this: MediaModal, index: number, element: HTMLElement): void; load(this: MediaModal, e: JQuery.ClickEvent): void; clear(this: MediaModal, e: JQuery.ClickEvent): void; }