Adding logging interface to adal.d.ts (#9640)

* Added logging interfaces to the adal typings

* Added test cases

* Updating test case
This commit is contained in:
Alex Bettadapur
2016-06-19 13:17:51 +09:00
committed by Masahiro Wakame
parent 30bc34f9fc
commit e45bb5393c
2 changed files with 22 additions and 1 deletions
+8
View File
@@ -12,4 +12,12 @@ var config : adal.Config = {
var auth = new AuthenticationContext(config);
Logging.log = (message: string) => {
console.log(message);
}
Logging.level = 4;
auth.info("Logging message");
var userName: string = auth.getCachedUser().userName;
+14 -1
View File
@@ -4,9 +4,10 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var AuthenticationContext: adal.AuthenticationContextStatic;
declare var Logging: adal.Logging;
declare module 'adal' {
export = AuthenticationContext;
export = { AuthenticationContext, Logging };
}
declare namespace adal {
@@ -36,6 +37,18 @@ declare namespace adal {
stateResponse: string,
requestType: string
}
interface Logging {
log: (message: string) => void;
level: LoggingLevel;
}
enum LoggingLevel {
ERROR = 0,
WARNING = 1,
INFO = 2,
VERBOSE = 3
}
interface AuthenticationContextStatic {
new (config: Config): AuthenticationContext;