Skip to content

Commit

Permalink
feat: types
Browse files Browse the repository at this point in the history
  • Loading branch information
weird94 committed Jan 2, 2025
1 parent c54b877 commit 2c8e02d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export { AsyncInterceptorManager, composeInterceptors, createAsyncInterceptorKey
export type { Serializable } from './common/json';
export { MemoryCursor } from './common/memory-cursor';
export { mixinClass } from './common/mixin';
export { FBase } from './facade/f-base';
export { FBase, FBaseInitialable } from './facade/f-base';
export { FUniver } from './facade/f-univer';
export { FHooks } from './facade/f-hooks';
export { FBlob, type IFBlobSource } from './facade/f-blob';
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-data-validation/src/facade/f-workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import type { IAddSheetDataValidationCommandParams,
IValidStatusChange } from '@univerjs/sheets-data-validation';
import { type DataValidationStatus, type IDisposable, type IExecutionOptions, type Nullable, type ObjectMatrix, toDisposable } from '@univerjs/core';

import { FWorkbook } from '@univerjs/sheets/facade';
import { AddSheetDataValidationCommand,
RemoveSheetAllDataValidationCommand,
RemoveSheetDataValidationCommand,
Expand All @@ -34,6 +33,7 @@ import { AddSheetDataValidationCommand,
UpdateSheetDataValidationRangeCommand,
UpdateSheetDataValidationSettingCommand,
} from '@univerjs/sheets-data-validation';
import { FWorkbook } from '@univerjs/sheets/facade';
import { filter } from 'rxjs';

export interface IFWorkbookDataValidationMixin {
Expand Down
8 changes: 4 additions & 4 deletions packages/sheets/src/facade/f-range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import type { CellValue, ICellData, IColorStyle, IObjectMatrixPrimitiveType, IRange, IStyleData, ITextDecoration, Nullable, Workbook, Worksheet } from '@univerjs/core';
import type { ISetHorizontalTextAlignCommandParams, ISetStyleCommandParams, ISetTextWrapCommandParams, ISetVerticalTextAlignCommandParams, IStyleTypeValue, SplitDelimiterEnum } from '@univerjs/sheets';
import type { FHorizontalAlignment, FVerticalAlignment } from './utils';
import { BooleanNumber, Dimension, FBase, ICommandService, Inject, Injector, Rectangle, WrapStrategy } from '@univerjs/core';
import { BooleanNumber, Dimension, FBaseInitialable, ICommandService, Inject, Injector, Rectangle, WrapStrategy } from '@univerjs/core';
import { FormulaDataModel, serializeRange, serializeRangeWithSheet } from '@univerjs/engine-formula';
import { addMergeCellsUtil, getAddMergeMutationRangeByType, RemoveWorksheetMergeCommand, SetHorizontalTextAlignCommand, SetRangeValuesCommand, SetStyleCommand, SetTextWrapCommand, SetVerticalTextAlignCommand, SplitTextToColumnsCommand } from '@univerjs/sheets';
import { FWorkbook } from './f-workbook';
Expand All @@ -27,16 +27,16 @@ export type FontLine = 'none' | 'underline' | 'line-through';
export type FontStyle = 'normal' | 'italic';
export type FontWeight = 'normal' | 'bold';

export class FRange extends FBase {
export class FRange extends FBaseInitialable {
constructor(
protected readonly _workbook: Workbook,
protected readonly _worksheet: Worksheet,
protected readonly _range: IRange,
@Inject(Injector) protected readonly _injector: Injector,
@Inject(Injector) protected override readonly _injector: Injector,
@ICommandService protected readonly _commandService: ICommandService,
@Inject(FormulaDataModel) protected readonly _formulaDataModel: FormulaDataModel
) {
super();
super(_injector);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions packages/sheets/src/facade/f-workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
import type { CommandListener, ICommandInfo, IDisposable, IRange, IWorkbookData, LocaleType, Workbook } from '@univerjs/core';
import type { ISetDefinedNameMutationParam } from '@univerjs/engine-formula';
import type { ISetSelectionsOperationParams, ISheetCommandSharedParams } from '@univerjs/sheets';
import { FBase, ICommandService, ILogService, Inject, Injector, IPermissionService, IResourceLoaderService, IUniverInstanceService, LocaleService, mergeWorksheetSnapshotWithDefault, RedoCommand, toDisposable, UndoCommand, UniverInstanceType } from '@univerjs/core';
import { FBaseInitialable, ICommandService, ILogService, Inject, Injector, IPermissionService, IResourceLoaderService, IUniverInstanceService, LocaleService, mergeWorksheetSnapshotWithDefault, RedoCommand, toDisposable, UndoCommand, UniverInstanceType } from '@univerjs/core';
import { IDefinedNamesService } from '@univerjs/engine-formula';
import { CopySheetCommand, getPrimaryForRange, InsertSheetCommand, RemoveSheetCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SetDefinedNameCommand, SetSelectionsOperation, SetWorksheetActiveOperation, SetWorksheetOrderCommand, SheetsSelectionsService, WorkbookEditablePermission } from '@univerjs/sheets';
import { FDefinedName, FDefinedNameBuilder } from './f-defined-name';
import { FPermission } from './f-permission';
import { FRange } from './f-range';
import { FWorksheet } from './f-worksheet';

export class FWorkbook extends FBase {
export class FWorkbook extends FBaseInitialable {
readonly id: string;

constructor(
protected readonly _workbook: Workbook,
@Inject(Injector) protected readonly _injector: Injector,
@Inject(Injector) protected override readonly _injector: Injector,
@Inject(IResourceLoaderService) protected readonly _resourceLoaderService: IResourceLoaderService,
@Inject(SheetsSelectionsService) protected readonly _selectionManagerService: SheetsSelectionsService,
@IUniverInstanceService protected readonly _univerInstanceService: IUniverInstanceService,
Expand All @@ -40,7 +40,7 @@ export class FWorkbook extends FBase {
@Inject(LocaleService) protected readonly _localeService: LocaleService,
@IDefinedNamesService protected readonly _definedNamesService: IDefinedNamesService
) {
super();
super(_injector);

this.id = this._workbook.getUnitId();
}
Expand Down
8 changes: 4 additions & 4 deletions packages/sheets/src/facade/f-worksheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { CustomData, ICellData, IColumnData, IDisposable, IFreeze, IObjectA
import type { ISetColDataCommandParams, ISetGridlinesColorCommandParams, ISetRangeValuesMutationParams, ISetRowDataCommandParams, IToggleGridlinesCommandParams } from '@univerjs/sheets';
import type { FDefinedName } from './f-defined-name';
import type { FWorkbook } from './f-workbook';
import { BooleanNumber, Direction, FBase, ICommandService, ILogService, Inject, Injector, ObjectMatrix, RANGE_TYPE } from '@univerjs/core';
import { BooleanNumber, Direction, FBaseInitialable, ICommandService, ILogService, Inject, Injector, ObjectMatrix, RANGE_TYPE } from '@univerjs/core';
import { deserializeRangeWithSheet } from '@univerjs/engine-formula';
import { CancelFrozenCommand, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, copyRangeStyles, InsertColByRangeCommand, InsertRowByRangeCommand, MoveColsCommand, MoveRowsCommand, RemoveColByRangeCommand, RemoveRowByRangeCommand, SetColDataCommand, SetColHiddenCommand, SetColWidthCommand, SetFrozenCommand, SetGridlinesColorCommand, SetRangeValuesMutation, SetRowDataCommand, SetRowHeightCommand, SetRowHiddenCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetTabColorCommand, SetWorksheetDefaultStyleMutation, SetWorksheetHideCommand, SetWorksheetNameCommand, SetWorksheetRowIsAutoHeightCommand, SetWorksheetShowCommand, SheetsSelectionsService, ToggleGridlinesCommand } from '@univerjs/sheets';
import { FDefinedNameBuilder } from './f-defined-name';
Expand All @@ -34,17 +34,17 @@ interface IFacadeClearOptions {
/**
* Represents a worksheet facade api instance. Which provides a set of methods to interact with the worksheet.
*/
export class FWorksheet extends FBase {
export class FWorksheet extends FBaseInitialable {
constructor(
protected readonly _fWorkbook: FWorkbook,
protected readonly _workbook: Workbook,
protected readonly _worksheet: Worksheet,
@Inject(Injector) protected readonly _injector: Injector,
@Inject(Injector) protected override readonly _injector: Injector,
@Inject(SheetsSelectionsService) protected readonly _selectionManagerService: SheetsSelectionsService,
@Inject(ILogService) protected readonly _logService: ILogService,
@ICommandService protected readonly _commandService: ICommandService
) {
super();
super(_injector);
}

/**
Expand Down

0 comments on commit 2c8e02d

Please sign in to comment.