forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-material.d.ts
240 lines (215 loc) · 8.21 KB
/
angular-material.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.material {
interface IBottomSheetOptions {
templateUrl?: string;
template?: string;
scope?: angular.IScope; // default: new child scope
preserveScope?: boolean; // default: false
controller?: string|Function;
locals?: {[index: string]: any};
targetEvent?: MouseEvent;
resolve?: {[index: string]: angular.IPromise<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
disableParentScroll?: boolean; // default: true
}
interface IBottomSheetService {
show(options: IBottomSheetOptions): angular.IPromise<any>;
hide(response?: any): void;
cancel(response?: any): void;
}
interface IPresetDialog<T> {
title(title: string): T;
textContent(textContent: string): T;
htmlContent(htmlContent: string): T;
ok(ok: string): T;
theme(theme: string): T;
templateUrl(templateUrl?: string): T;
template(template?: string): T;
targetEvent(targetEvent?: MouseEvent): T;
scope(scope?: angular.IScope): T; // default: new child scope
preserveScope(preserveScope?: boolean): T; // default: false
disableParentScroll(disableParentScroll?: boolean): T; // default: true
hasBackdrop(hasBackdrop?: boolean): T; // default: true
clickOutsideToClose(clickOutsideToClose?: boolean): T; // default: false
escapeToClose(escapeToClose?: boolean): T; // default: true
focusOnOpen(focusOnOpen?: boolean): T; // default: true
controller(controller?: string|Function): T;
locals(locals?: {[index: string]: any}): T;
bindToController(bindToController?: boolean): T; // default: false
resolve(resolve?: {[index: string]: angular.IPromise<any>}): T;
controllerAs(controllerAs?: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
onComplete(onComplete?: Function): T;
ariaLabel(ariaLabel: string): T;
}
interface IAlertDialog extends IPresetDialog<IAlertDialog> {
}
interface IConfirmDialog extends IPresetDialog<IConfirmDialog> {
cancel(cancel: string): IConfirmDialog;
}
interface IDialogOptions {
templateUrl?: string;
template?: string;
targetEvent?: MouseEvent;
scope?: angular.IScope; // default: new child scope
preserveScope?: boolean; // default: false
disableParentScroll?: boolean; // default: true
hasBackdrop?: boolean // default: true
clickOutsideToClose?: boolean; // default: false
escapeToClose?: boolean; // default: true
focusOnOpen?: boolean; // default: true
controller?: string|Function;
locals?: {[index: string]: any};
bindToController?: boolean; // default: false
resolve?: {[index: string]: angular.IPromise<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
onComplete?: Function;
}
interface IDialogService {
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise<any>;
confirm(): IConfirmDialog;
alert(): IAlertDialog;
hide(response?: any): void;
cancel(response?: any): void;
}
interface IIcon {
(id: string): angular.IPromise<Element>; // id is a unique ID or URL
}
interface IIconProvider {
icon(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24
iconSet(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24
defaultIconSet(url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24
defaultViewBoxSize(viewBoxSize: number): IIconProvider; // default: 24
defaultFontSet(name: string): IIconProvider;
}
interface IMedia {
(media: string): boolean;
}
interface ISidenavObject {
toggle(): angular.IPromise<void>;
open(): angular.IPromise<void>;
close(): angular.IPromise<void>;
isOpen(): boolean;
isLockedOpen(): boolean;
}
interface ISidenavService {
(component: string): ISidenavObject;
}
interface IToastPreset<T> {
textContent(content: string): T;
action(action: string): T;
highlightAction(highlightAction: boolean): T;
capsule(capsule: boolean): T;
theme(theme: string): T;
hideDelay(delay: number): T;
position(position: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
}
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
}
interface IToastOptions {
templateUrl?: string;
template?: string;
scope?: angular.IScope; // default: new child scope
preserveScope?: boolean; // default: false
hideDelay?: number; // default (ms): 3000
position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left'
controller?: string|Function;
locals?: {[index: string]: any};
bindToController?: boolean; // default: false
resolve?: {[index: string]: angular.IPromise<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
}
interface IToastService {
show(optionsOrPreset: IToastOptions|IToastPreset<any>): angular.IPromise<any>;
showSimple(content: string): angular.IPromise<any>;
simple(): ISimpleToastPreset;
build(): IToastPreset<any>;
updateContent(): void;
hide(response?: any): void;
cancel(response?: any): void;
}
interface IPalette {
0?: string;
50?: string;
100?: string;
200?: string;
300?: string;
400?: string;
500?: string;
600?: string;
700?: string;
800?: string;
900?: string;
A100?: string;
A200?: string;
A400?: string;
A700?: string;
contrastDefaultColor?: string;
contrastDarkColors?: string|string[];
contrastLightColors?: string|string[];
}
interface IThemeHues {
default?: string;
'hue-1'?: string;
'hue-2'?: string;
'hue-3'?: string;
}
interface IThemePalette {
name: string;
hues: IThemeHues;
}
interface IThemeColors {
accent: IThemePalette;
background: IThemePalette;
primary: IThemePalette;
warn: IThemePalette;
}
interface IThemeGrayScalePalette {
1: string;
2: string;
3: string;
4: string;
name: string;
}
interface ITheme {
name: string;
isDark: boolean;
colors: IThemeColors;
foregroundPalette: IThemeGrayScalePalette;
foregroundShadow: string;
accentPalette(name: string, hues?: IThemeHues): ITheme;
primaryPalette(name: string, hues?: IThemeHues): ITheme;
warnPalette(name: string, hues?: IThemeHues): ITheme;
backgroundPalette(name: string, hues?: IThemeHues): ITheme;
dark(isDark?: boolean): ITheme;
}
interface IThemingProvider {
theme(name: string, inheritFrom?: string): ITheme;
definePalette(name: string, palette: IPalette): IThemingProvider;
extendPalette(name: string, palette: IPalette): IPalette;
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
}
interface IDateLocaleProvider {
months: string[];
shortMonths: string[];
days: string[];
shortDays: string[];
dates: string[];
firstDayOfWeek: number;
parseDate(dateString: string): Date;
formatDate(date: Date): string;
monthHeaderFormatter(date: Date): string;
weekNumberFormatter(weekNumber: number): string;
msgCalendar: string;
msgOpenCalendar: string;
}
}