Skip to content

Commit

Permalink
Move token to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Sep 5, 2023
1 parent 7f3ca56 commit 01bd241
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
9 changes: 3 additions & 6 deletions packages/lab/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ import { ReadonlyPartialJSONObject } from '@lumino/coreutils';

import { fullScreenIcon, RISEIcon } from './icons';

import {
RisePreview,
IRisePreviewTracker,
RisePreviewFactory
} from './preview';
import { RisePreview, RisePreviewFactory } from './preview';
import { IRisePreviewTracker } from './tokens';

export { IRisePreviewTracker } from './preview';
export { IRisePreviewTracker } from './tokens';

/**
* Command IDs namespace for JupyterLab RISE extension
Expand Down
22 changes: 2 additions & 20 deletions packages/lab/src/preview.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
IFrame,
ToolbarButton,
IWidgetTracker,
Toolbar
} from '@jupyterlab/apputils';
import { IFrame, ToolbarButton, Toolbar } from '@jupyterlab/apputils';

import {
ABCWidgetFactory,
Expand All @@ -19,7 +14,7 @@ import { refreshIcon } from '@jupyterlab/ui-components';

import { CommandRegistry } from '@lumino/commands';

import { PromiseDelegate, Token } from '@lumino/coreutils';
import { PromiseDelegate } from '@lumino/coreutils';

import { Message } from '@lumino/messaging';

Expand All @@ -29,19 +24,6 @@ import { Widget } from '@lumino/widgets';

import { fullScreenIcon, RISEIcon } from './icons';

/**
* A class that tracks Rise Preview widgets.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface IRisePreviewTracker extends IWidgetTracker<RisePreview> {}

/**
* The Rise Preview tracker token.
*/
export const IRisePreviewTracker = new Token<IRisePreviewTracker>(
'jupyterlab-rise:IRisePreviewTracker'
);

/**
* A DocumentWidget that shows a Rise preview in an IFrame.
*/
Expand Down
16 changes: 16 additions & 0 deletions packages/lab/src/tokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { IWidgetTracker } from '@jupyterlab/apputils';
import { Token } from '@lumino/coreutils';
import type { RisePreview } from './preview';

/**
* A class that tracks Rise Preview widgets.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface IRisePreviewTracker extends IWidgetTracker<RisePreview> {}

/**
* The Rise Preview tracker token.
*/
export const IRisePreviewTracker = new Token<IRisePreviewTracker>(
'jupyterlab-rise:IRisePreviewTracker'
);

0 comments on commit 01bd241

Please sign in to comment.