Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6334 from vidartf/interfaces
Token refactor/cleanup
- Loading branch information
Showing
73 changed files
with
1,770 additions
and
1,095 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
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,113 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
import { IChangedArgs } from '@jupyterlab/coreutils'; | ||
|
||
import { Token } from '@phosphor/coreutils'; | ||
|
||
import { IDisposable } from '@phosphor/disposable'; | ||
|
||
import { ISignal } from '@phosphor/signaling'; | ||
|
||
/* tslint:disable */ | ||
/** | ||
* The theme manager token. | ||
*/ | ||
export const IThemeManager = new Token<IThemeManager>( | ||
'@jupyterlab/apputils:IThemeManager' | ||
); | ||
/* tslint:enable */ | ||
|
||
/** | ||
* An interface for a theme manager. | ||
*/ | ||
export interface IThemeManager { | ||
/** | ||
* Get the name of the current theme. | ||
*/ | ||
readonly theme: string | null; | ||
|
||
/** | ||
* The names of the registered themes. | ||
*/ | ||
readonly themes: ReadonlyArray<string>; | ||
|
||
/** | ||
* A signal fired when the application theme changes. | ||
*/ | ||
readonly themeChanged: ISignal<this, IChangedArgs<string>>; | ||
|
||
/** | ||
* Load a theme CSS file by path. | ||
* | ||
* @param path - The path of the file to load. | ||
*/ | ||
loadCSS(path: string): Promise<void>; | ||
|
||
/** | ||
* Register a theme with the theme manager. | ||
* | ||
* @param theme - The theme to register. | ||
* | ||
* @returns A disposable that can be used to unregister the theme. | ||
*/ | ||
register(theme: IThemeManager.ITheme): IDisposable; | ||
|
||
/** | ||
* Set the current theme. | ||
*/ | ||
setTheme(name: string): Promise<void>; | ||
|
||
/** | ||
* Test whether a given theme is light. | ||
*/ | ||
isLight(name: string): boolean; | ||
|
||
/** | ||
* Test whether a given theme styles scrollbars, | ||
* and if the user has scrollbar styling enabled. | ||
*/ | ||
themeScrollbars(name: string): boolean; | ||
} | ||
|
||
/** | ||
* A namespace for the `IThemeManager` sub-types. | ||
*/ | ||
export namespace IThemeManager { | ||
/** | ||
* An interface for a theme. | ||
*/ | ||
export interface ITheme { | ||
/** | ||
* The display name of the theme. | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Whether the theme is light or dark. Downstream authors | ||
* of extensions can use this information to customize their | ||
* UI depending upon the current theme. | ||
*/ | ||
isLight: boolean; | ||
|
||
/** | ||
* Whether the theme includes styling for the scrollbar. | ||
* If set to false, this theme will leave the native scrollbar untouched. | ||
*/ | ||
themeScrollbars?: boolean; | ||
|
||
/** | ||
* Load the theme. | ||
* | ||
* @returns A promise that resolves when the theme has loaded. | ||
*/ | ||
load(): Promise<void>; | ||
|
||
/** | ||
* Unload the theme. | ||
* | ||
* @returns A promise that resolves when the theme has unloaded. | ||
*/ | ||
unload(): Promise<void>; | ||
} | ||
} |
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,40 +1,11 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
import { Token } from '@phosphor/coreutils'; | ||
|
||
import { IEditorFactoryService } from './factory'; | ||
|
||
import { IEditorMimeTypeService } from './mimetype'; | ||
|
||
import '../style/index.css'; | ||
|
||
export * from './editor'; | ||
export * from './jsoneditor'; | ||
export * from './widget'; | ||
export * from './factory'; | ||
export * from './mimetype'; | ||
|
||
/* tslint:disable */ | ||
/** | ||
* Code editor services token. | ||
*/ | ||
export const IEditorServices = new Token<IEditorServices>( | ||
'@jupyterlab/codeeditor:IEditorServices' | ||
); | ||
/* tslint:enable */ | ||
|
||
/** | ||
* Code editor services. | ||
*/ | ||
export interface IEditorServices { | ||
/** | ||
* The code editor factory. | ||
*/ | ||
readonly factoryService: IEditorFactoryService; | ||
|
||
/** | ||
* The editor mime type service. | ||
*/ | ||
readonly mimeTypeService: IEditorMimeTypeService; | ||
} | ||
export * from './tokens'; |
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,32 @@ | ||
// Copyright (c) Jupyter Development Team. | ||
// Distributed under the terms of the Modified BSD License. | ||
|
||
import { Token } from '@phosphor/coreutils'; | ||
|
||
import { IEditorFactoryService } from './factory'; | ||
|
||
import { IEditorMimeTypeService } from './mimetype'; | ||
|
||
/* tslint:disable */ | ||
/** | ||
* Code editor services token. | ||
*/ | ||
export const IEditorServices = new Token<IEditorServices>( | ||
'@jupyterlab/codeeditor:IEditorServices' | ||
); | ||
/* tslint:enable */ | ||
|
||
/** | ||
* Code editor services. | ||
*/ | ||
export interface IEditorServices { | ||
/** | ||
* The code editor factory. | ||
*/ | ||
readonly factoryService: IEditorFactoryService; | ||
|
||
/** | ||
* The editor mime type service. | ||
*/ | ||
readonly mimeTypeService: IEditorMimeTypeService; | ||
} |
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
Oops, something went wrong.