-
-
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
1 parent
8e9b2e9
commit 7eb662e
Showing
2 changed files
with
46 additions
and
39 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
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,5 +1,42 @@ | ||
import { Token } from '@lumino/coreutils'; | ||
import { ISignal, Signal } from '@lumino/signaling'; | ||
|
||
export type IDatalayerConfig = { | ||
apiServerUrl: string; | ||
launcherCategory: string; | ||
whiteLabel: boolean; | ||
}; | ||
|
||
export type IDatalayer = { | ||
configuration: DatalayerConfiguration; | ||
ready: Promise<void>; | ||
}; | ||
|
||
export const IDatalayer = new Token<IDatalayer>('@datalayer/core:plugin'); | ||
|
||
export class DatalayerConfiguration { | ||
private _configuration?: IDatalayerConfig; | ||
private _configurationChanged: Signal< | ||
DatalayerConfiguration, | ||
IDatalayerConfig | undefined | ||
>; | ||
constructor() { | ||
this._configurationChanged = new Signal< | ||
DatalayerConfiguration, | ||
IDatalayerConfig | undefined | ||
>(this); | ||
} | ||
set configuration(configuration: IDatalayerConfig | undefined) { | ||
this._configuration = configuration; | ||
this._configurationChanged.emit(configuration); | ||
} | ||
get configuration() { | ||
return this._configuration; | ||
} | ||
get configurationChanged(): ISignal< | ||
DatalayerConfiguration, | ||
IDatalayerConfig | undefined | ||
> { | ||
return this._configurationChanged; | ||
} | ||
} |