-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
488 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,6 @@ | |
"avoidEscape": true | ||
} | ||
], | ||
}, | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { Disposable } from "./common/disposable"; | ||
|
||
export type AzureAppConfiguration = { | ||
// methods for advanced features, e.g. refresh() | ||
} & ReadonlyMap<string, unknown>; | ||
/** | ||
* API to trigger refresh operation. | ||
*/ | ||
refresh(): Promise<void>; | ||
|
||
/** | ||
* API to register callback listeners, which will be called only when a refresh operation successfully updates key-values. | ||
* | ||
* @param listener Callback funtion to be registered. | ||
* @param thisArg Optional. Value to use as this when executing callback. | ||
*/ | ||
onRefresh(listener: () => any, thisArg?: any): Disposable; | ||
} & ReadonlyMap<string, any>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
import { WatchedSetting } from "./WatchedSetting"; | ||
|
||
export const DefaultRefreshIntervalInMs = 30 * 1000; | ||
export const MinimumRefreshIntervalInMs = 1 * 1000; | ||
|
||
export interface RefreshOptions { | ||
/** | ||
* Specifies the interval for refresh to really update the values. | ||
* Default value is 30 seconds. Must be greater than 1 second. | ||
* Any refresh operation triggered will not update the value for a key until after the interval. | ||
*/ | ||
refreshIntervalInMs?: number; | ||
|
||
/** | ||
* Specifies settings to be watched, to determine whether the provider triggers a refresh. | ||
*/ | ||
watchedSettings: WatchedSetting[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export interface WatchedSetting { | ||
key: string; | ||
label?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
export class Disposable { | ||
private disposed = false; | ||
constructor(private callOnDispose: () => any) { } | ||
|
||
dispose() { | ||
if (!this.disposed) { | ||
this.callOnDispose(); | ||
} | ||
this.disposed = true; | ||
} | ||
|
||
} |
Oops, something went wrong.