mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Added interfaces for Angular Material $mdPanel service, MdPanelPosition type, and MdPanelAnimation type as part of release 1.1.0-rc.5 (2016-06-03). Updated IDialogService show method to include previously added IPromptDialog.
This commit is contained in:
+73
-1
@@ -92,7 +92,7 @@ declare namespace angular.material {
|
||||
}
|
||||
|
||||
interface IDialogService {
|
||||
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise<any>;
|
||||
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog|IPromptDialog): angular.IPromise<any>;
|
||||
confirm(): IConfirmDialog;
|
||||
alert(): IAlertDialog;
|
||||
prompt(): IPromptDialog;
|
||||
@@ -277,4 +277,76 @@ declare namespace angular.material {
|
||||
grey: IPalette;
|
||||
'blue-grey': IPalette;
|
||||
}
|
||||
|
||||
interface IPanelConfig {
|
||||
template?: string;
|
||||
templateUrl?: string;
|
||||
controller?: string|Function;
|
||||
controllerAs?: string;
|
||||
bindToController?: boolean; // default: true
|
||||
locals?: {[index: string]: any};
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
attachTo?: string|JQuery|Element;
|
||||
panelClass?: string;
|
||||
zIndex?: number; // default: 80
|
||||
position?: IPanelPosition;
|
||||
clickOutsideToClose?: boolean; // default: false
|
||||
escapeToClose?: boolean; // default: false
|
||||
trapFocus?: boolean; // default: false
|
||||
focusOnOpen?: boolean; // default: true
|
||||
fullscreen?: boolean; // default: false
|
||||
animation?: IPanelAnimation;
|
||||
hasBackdrop?: boolean // default: false
|
||||
disableParentScroll?: boolean; // default: false
|
||||
onDomAdded?: Function;
|
||||
onOpenComplete?: Function;
|
||||
onRemoving?: Function;
|
||||
onDomRemoved?: Function;
|
||||
origin?: string|JQuery|Element;
|
||||
}
|
||||
|
||||
interface IPanelRef {
|
||||
id: string;
|
||||
config: IPanelConfig;
|
||||
isAttached: boolean;
|
||||
open(): angular.IPromise<any>;
|
||||
close(): angular.IPromise<any>;
|
||||
attach(): angular.IPromise<any>;
|
||||
detach(): angular.IPromise<any>;
|
||||
show(): angular.IPromise<any>;
|
||||
hide(): angular.IPromise<any>;
|
||||
destroy(): void;
|
||||
addClass(newClass: string): void;
|
||||
removeClass(oldClass: string): void;
|
||||
toggleClass(toggleClass: string): void;
|
||||
focusOnOpen(): void;
|
||||
}
|
||||
|
||||
interface IPanelPosition {
|
||||
absolute(): IPanelPosition;
|
||||
relativeTo(someElement: string|JQuery|Element): IPanelPosition;
|
||||
top(opt_top: string): IPanelPosition; // default: '0'
|
||||
bottom(opt_bottom: string): IPanelPosition; // default: '0'
|
||||
left(opt_left: string): IPanelPosition; // default: '0'
|
||||
right(opt_right: string): IPanelPosition; // default: '0'
|
||||
centerHorizontally(): IPanelPosition;
|
||||
centerVertically(): IPanelPosition;
|
||||
center(): IPanelPosition;
|
||||
addPanelPosition(xPosition: string, yPosition: string): IPanelPosition;
|
||||
withOffsetX(offsetX: string): IPanelPosition;
|
||||
withOffsetY(offsetY: string): IPanelPosition;
|
||||
}
|
||||
|
||||
interface IPanelAnimation {
|
||||
openFrom(from: string|Element|Event|{top: number, left: number}): IPanelAnimation;
|
||||
closeTo(to: string|Element|{top: number, left: number}): IPanelAnimation;
|
||||
withAnimation(cssClass: string|{open: string, close: string}): IPanelAnimation;
|
||||
}
|
||||
|
||||
interface IPanelService {
|
||||
create(opt_config: IPanelConfig): IPanelRef;
|
||||
open(opt_config: IPanelConfig): angular.IPromise<IPanelRef>;
|
||||
newPanelPosition(): IPanelPosition;
|
||||
newPanelAnimation(): IPanelAnimation;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user