Skip to content

Commit

Permalink
refactor: align naming convention
Browse files Browse the repository at this point in the history
Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Sep 15, 2023
1 parent 133dff4 commit 49ab913
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { IUiSettingsClient } from '../ui_settings';
import { SavedObjectsStart } from '../saved_objects';
import { AppCategory } from '../../types';
import { ScopedHistory } from './scoped_history';
import { WorkspaceStart } from '../workspace';
import { WorkspacesStart } from '../workspace';

/**
* Accessibility status of an application.
Expand Down Expand Up @@ -335,8 +335,8 @@ export interface AppMountContext {
injectedMetadata: {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
};
/** {@link WorkspaceService} */
workspaces: WorkspaceStart;
/** {@link WorkspacesService} */
workspaces: WorkspacesStart;
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/public/core_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import { ContextService } from './context';
import { IntegrationsService } from './integrations';
import { CoreApp } from './core_app';
import type { InternalApplicationSetup, InternalApplicationStart } from './application/types';
import { WorkspaceService } from './workspace';
import { WorkspacesService } from './workspace';

interface Params {
rootDomElement: HTMLElement;
Expand Down Expand Up @@ -111,7 +111,7 @@ export class CoreSystem {

private readonly rootDomElement: HTMLElement;
private readonly coreContext: CoreContext;
private readonly workspaces: WorkspaceService;
private readonly workspaces: WorkspacesService;
private fatalErrorsSetup: FatalErrorsSetup | null = null;

constructor(params: Params) {
Expand Down Expand Up @@ -140,7 +140,7 @@ export class CoreSystem {
this.rendering = new RenderingService();
this.application = new ApplicationService();
this.integrations = new IntegrationsService();
this.workspaces = new WorkspaceService();
this.workspaces = new WorkspacesService();

this.coreContext = { coreId: Symbol('core'), env: injectedMetadata.env };

Expand Down
16 changes: 8 additions & 8 deletions src/core/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import {
HandlerParameters,
} from './context';
import { Branding } from '../types';
import { WorkspaceStart, WorkspaceSetup } from './workspace';
import { WorkspacesStart, WorkspacesSetup } from './workspace';

export type { Logos } from '../common';
export { PackageInfo, EnvironmentMode } from '../server/types';
Expand Down Expand Up @@ -241,8 +241,8 @@ export interface CoreSetup<TPluginsStart extends object = object, TStart = unkno
};
/** {@link StartServicesAccessor} */
getStartServices: StartServicesAccessor<TPluginsStart, TStart>;
/** {@link WorkspaceSetup} */
workspaces: WorkspaceSetup;
/** {@link WorkspacesSetup} */
workspaces: WorkspacesSetup;
}

/**
Expand Down Expand Up @@ -297,8 +297,8 @@ export interface CoreStart {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
getBranding: () => Branding;
};
/** {@link WorkspaceStart} */
workspaces: WorkspaceStart;
/** {@link WorkspacesStart} */
workspaces: WorkspacesStart;
}

export {
Expand Down Expand Up @@ -349,8 +349,8 @@ export {
export { __osdBootstrap__ } from './osd_bootstrap';

export {
WorkspaceStart,
WorkspaceSetup,
WorkspaceService,
WorkspacesStart,
WorkspacesSetup,
WorkspacesService,
WorkspaceObservables,
} from './workspace';
6 changes: 3 additions & 3 deletions src/core/public/workspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
export {
WorkspaceStart,
WorkspaceService,
WorkspaceSetup,
WorkspacesStart,
WorkspacesService,
WorkspacesSetup,
WorkspaceObservables,
} from './workspaces_service';
10 changes: 5 additions & 5 deletions src/core/public/workspace/workspaces_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ enum WORKSPACE_ERROR {
/**
* @public
*/
export interface WorkspaceSetup extends WorkspaceObservables {
export interface WorkspacesSetup extends WorkspaceObservables {
registerWorkspaceMenuRender: (render: WorkspaceMenuRenderFn) => void;
}

export interface WorkspaceStart extends WorkspaceObservables {
export interface WorkspacesStart extends WorkspaceObservables {
renderWorkspaceMenu: () => JSX.Element | null;
}

export class WorkspaceService implements CoreService<WorkspaceSetup, WorkspaceStart> {
export class WorkspacesService implements CoreService<WorkspacesSetup, WorkspacesStart> {
private currentWorkspaceId$ = new BehaviorSubject<string>('');
private workspaceList$ = new BehaviorSubject<WorkspaceAttribute[]>([]);
private currentWorkspace$ = new BehaviorSubject<WorkspaceAttribute | null>(null);
Expand Down Expand Up @@ -80,7 +80,7 @@ export class WorkspaceService implements CoreService<WorkspaceSetup, WorkspaceSt
);
}

public setup(): WorkspaceSetup {
public setup(): WorkspacesSetup {
return {
currentWorkspaceId$: this.currentWorkspaceId$,
currentWorkspace$: this.currentWorkspace$,
Expand All @@ -98,7 +98,7 @@ export class WorkspaceService implements CoreService<WorkspaceSetup, WorkspaceSt
}: {
application: InternalApplicationStart;
http: HttpSetup;
}): WorkspaceStart {
}): WorkspacesStart {
const observables = {
currentWorkspaceId$: this.currentWorkspaceId$,
currentWorkspace$: this.currentWorkspace$,
Expand Down

0 comments on commit 49ab913

Please sign in to comment.