import { Enums, GlueLayoutDisplayMode, GlueEditChromeLocation, GlueEditChromeTopbarLocation } from '../extensibility'; import { Observable } from 'rxjs/Rx'; export declare module IGlue { interface IGluePageContext { url: string; pageTitle: string; listTitle: string; pageUrl: string; pageId: string; majorVersions: Array; layoutId: string; controls: Array; clientsideCaching?: boolean; checkedOutBy?: string; isCheckOutByCurrentUser?: boolean; } interface IGluePageControl { controlId: string; instanceId: string; scope: string; settings: any; controls: any; zoneId: string; zoneIndex: number; isStatic?: boolean; settingsKey?: string; } interface IGluePageData { layoutId: string; controls: Array; } interface IGluePaneTabMetadata { name: string; icon: string; tooltip: string; } interface IGluePaneContentMetadata { name: string; registerTo: Array<{ tab: string; order: number; }>; modulePath?: string; ngfactoryModulePath?: string; } interface IGluePaneTab { iconCssClass: string; component: any; active?: boolean; } interface IGlueToolbarItemMetadata { location: GlueEditChromeLocation; name: string; modulePath?: string; ngfactoryModulePath?: string; group?: string; order?: number; display?: boolean; } interface IGlueTopbarItemMetadata { location: GlueEditChromeTopbarLocation; name: string; modulePath?: string; ngfactoryModulePath?: string; group?: string; order?: number; } interface IEditChromeComponent { name: string; componentType: any; modulePath?: string; ngsummaryModulePath?: string; display?: boolean; } interface ILayoutTemplate { id: string; title: string; fileName?: string; custom: boolean; majorVersions?: Array; content: ILayoutTemplateDefinition; isDefault?: boolean; } interface IGlueToolbarItemMetadataExtend extends IGlueToolbarItemMetadata, IEditChromeComponent { } interface IGluePaneContentMetadataExtend extends IGluePaneContentMetadata, IEditChromeComponent { } interface IGlueTopbarItemMetadataExtend extends IGlueTopbarItemMetadata, IEditChromeComponent { } interface IGluePageDesigner { columns: Array; zones: Array; template: IGlue.ILayoutTemplate; design: IGlue.ILayoutDesign; pageContext: IGluePageContext; pageLayoutCannotBeFound: boolean; pageCannotBeFound: boolean; getGluePageData: () => Observable; save: () => Observable; publish: () => Observable; undo: () => Observable; onGluePageContextChange: (newPageContext: IGluePageContext, renderCallback?: () => void) => void; } interface IGlueLayoutDesigner { columns: Array; zones: Array; selectedLayoutId: string; currentLayout: IGlue.ILayoutTemplate; design: IGlue.ILayoutDesign; save: (layout: ILayoutTemplate) => Promise; publish: () => Observable; undo: () => Observable; delete: () => Observable; changeLayout: (layout: ILayoutTemplate, renderCallback?: () => void) => void; onLayoutChanged: (callback: () => void) => void; onLayoutSelected: (callback: (layout: ILayoutTemplate) => void) => void; onLayoutUpdated: (callback: (layout: ILayoutTemplate) => void) => void; enableEditing: (enable: boolean) => void; onZoneAdded: (zone: IAddZoneDefinition) => Promise; onZoneSettingsChanged: (zone: IGlue.IZoneDefinition) => Promise; updateLayoutTitle: (templateId: string, title: string) => Promise; cascadeToLeft: (allow: boolean) => void; display: (mode: Enums.GlueLayoutDesignerDisplayMode) => void; exportLayout: () => any; status: { [index: string]: any; }; } interface IGlueEditor { pageDesigner: IGluePageDesigner; layoutDesigner: IGlueLayoutDesigner; display: (mode: GlueLayoutDisplayMode) => void; layoutDisplayMode: GlueLayoutDisplayMode; registerPaneContent(name: string, component: IGluePaneContent): any; unRegisterPaneContent(name: string): any; onPaneComponentDestroyed(name: string): { then: (callback) => void; }; getPaneComponent(name: string): Promise; showSavingNotification: () => void; showSuccessNotification: () => void; onLayoutDisplayModeChanged: (callback: (mode: GlueLayoutDisplayMode) => void) => void; } interface IVersionHistorySettings { resourceId: string; majorVersions: Array; } interface IVersionIdentifier { versionLabel: number; createdAt: Date; } interface IGlueResource { id: string; meta?: string; scope?: string; editingBy?: string; modifiedAt?: Date; versions?: Array; canBeEdited?: boolean; existed?: boolean; } interface IGlueResourceVersion { glueResourceId: string; majorVersion: number; minorVersion: number; meta?: string; scope?: string; content: string; createdBy?: string; createdAt?: string; createdAtSocialTime?: string; } interface IGlueResourceVersionResult { glueResourceVersion: IGlueResourceVersion; isCheckedOutByOtherUser?: boolean; } interface IGlueResourceSaveOperation { glueResourceId: string; onSaved: (version: IGlueResourceVersion) => void; onError: (errorMessage: string) => void; content: any; meta?: any; scope?: string; } interface IGluePaneContent { } interface IVersionHistory extends IGluePaneContent { resource: IGlueResource; configure: (settings: IVersionHistorySettings) => Promise; clearConfiguration: () => void; saveVersion: (saveOperation: IGlueResourceSaveOperation) => void; onVersionSelected: (callback: (version: IGlueResourceVersion) => void) => void; onVersionRestored: (callback: (version: IGlueResourceVersion) => void) => void; onLatestVersionChanged: (callback: (latestVersion: IGlueResourceVersion) => void) => void; addNewMajorVersion: (majorVersion: IVersionIdentifier) => void; } interface IStaticGluePart { controlId?: string; instanceId?: string; scope?: string; cssClass?: string; } interface IGluePartItem { controlId?: string; component?: any; id?: string; title?: string; icon?: string; scope?: string; isStatic?: boolean; editable?: boolean; zoneIndex?: number; enableSettings?: boolean; enableSkeletonLoading?: boolean; cssClass?: string; settings?: any; controls?: any; settingsKey?: string; visibleViewPort?: boolean; gluePartSkeleton?: string; notExistOmniaControlDecorator?: boolean; } interface IGluePartItemPanel { controlId?: string; title?: string; group?: string; icon?: string; } interface ILayoutTemplateDefinition { design: { layout: { zoneWidth: number; columns?: Array; }; zone?: { sizes: Array; }; }; zones?: Array<{ id: string; title: string; editable?: boolean; column: number; row: number; size: number; width?: number; cssClass?: string; inlineStyle?: string; responsive?: IZoneResponsive; controls?: Array; }>; } interface ILayoutDesign { layout?: { makeChange?: boolean; margins?: Array; draggable?: boolean; resizable?: boolean; max_cols?: number; max_rows?: number; visible_cols?: number; visible_rows?: number; min_cols?: number; min_rows?: number; col_width?: number; row_height?: number; cascade?: string; min_width?: number; min_height?: number; fix_to_grid?: boolean; auto_style?: boolean; auto_resize?: boolean; maintain_ratio?: boolean; prefer_new?: boolean; limit_to_screen?: boolean; columns?: Array; }; zone?: { backgroundColor?: string; col?: number; row?: number; sizex?: number; sizey?: number; dragHandle?: string; resizeHandle?: string; borderSize?: number; fixed?: boolean; draggable?: boolean; resizable?: boolean; payload?: any; maxCols?: number; minCols?: number; maxRows?: number; minRows?: number; minWidth?: number; minHeight?: number; sizes?: Array; }; } interface IAddZoneDefinition { id?: string; title?: string; size: number; } interface IZoneDefinition { width?: number; left?: number; top?: number; id?: string; col?: number; row?: number; sizex?: number; cssClass?: string; inlineStyle?: string; isFullWidth?: boolean; controls?: Array; design?: { col?: number; row?: number; sizex?: number; sizey?: number; dragHandle?: string; resizeHandle?: string; borderSize?: number; fixed?: boolean; draggable?: boolean; resizable?: boolean; payload?: any; maxCols?: number; minCols?: number; maxRows?: number; minRows?: number; minWidth?: number; minHeight?: number; }; title?: string; responsive?: IZoneResponsive; hide?: boolean; editable?: boolean; } interface IZoneSize { title: string; size: number; } interface ILayoutSetting { templateId?: string; zones?: Array; } interface ILayoutRow { index: number; width: number; zones?: Array; } interface IGroupZonesByColumn { index: number; width: string; rows?: Array; } interface IZoneResponsive { type?: Enums.GlueZoneResponsiveType; value?: any; } interface IPageSettings { onPageCheckoutStatusChange: (callback: (pageCanBeEdited: boolean, pageIsBeingEditedBy: string) => void) => void; } interface ILayoutSettings { onLayoutCheckoutStatusChange: (callback: (layoutCanBeEdited: boolean, layoutIsBeingEditedBy: string) => void) => void; deleteLayout: (layout: IGlue.ILayoutTemplate) => void; onLayoutTitleChange: (callBack: () => void) => void; } interface IZoneSettings { configure(zone: IZoneDefinition): void; onZoneSettingsConfigured: (callback: () => void) => void; } interface IPagePreview { getAllPreviewModes: () => Array<{ title: string; id: Enums.GluePreviewMode; }>; setPreviewMode: (previewMode: Enums.GluePreviewMode) => void; onPreviewModeSelected: (callback: (previewMode: Enums.GluePreviewMode) => void) => void; } interface IGlueResourceOperationResult { isSuccess: boolean; isCheckedOutByOtherUser: boolean; } interface IGlueLayoutRestoreResult { isCheckedOutByOtherUser: boolean; versionContent: string; } interface ITakeControlResult { isResourceFound: boolean; } }