mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
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:
committed by
Masahiro Wakame
parent
30bc34f9fc
commit
e45bb5393c
@@ -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;
|
||||
Vendored
+14
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user