@univerjs/core
Advanced tools
Comparing version 0.1.0-beta.1 to 0.1.0-beta.2
@@ -16,2 +16,3 @@ /** | ||
*/ | ||
import type { Nullable } from '../../shared'; | ||
import type { IDocumentBody, IDocumentData, IDocumentRenderConfig } from '../../types/interfaces/i-document-data'; | ||
@@ -66,2 +67,3 @@ import { type IPaddingData } from '../../types/interfaces/i-style-data'; | ||
apply(mutations: DocMutationParams[]): DocMutationParams[]; | ||
sliceBody(startOffset: number, endOffset: number): Nullable<IDocumentBody>; | ||
private _updateApply; | ||
@@ -68,0 +70,0 @@ private _deleteApply; |
@@ -46,7 +46,9 @@ /** | ||
export * from './shared'; | ||
export { deserializeRangeForR1C1 } from './sheets/r1c1-reference'; | ||
export type { IComposeInterceptors, IInterceptor, InterceptorHandler } from './common/interceptor'; | ||
export { composeInterceptors, createInterceptorKey, InterceptorManager } from './common/interceptor'; | ||
export { normalizeTextRuns } from './docs/data-model/apply-utils/common'; | ||
export type { PluginCtor } from './plugin/plugin'; | ||
export { Range } from './sheets/range'; | ||
export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, } from './sheets/reference'; | ||
export { deserializeRangeWithSheet, getAbsoluteRefTypeWithSingleString, getAbsoluteRefTypeWitString, type IAbsoluteRefTypeForRange, serializeRange, serializeRangeToRefString, serializeRangeWithSheet, serializeRangeWithSpreadsheet, UNIT_NAME_REGEX, } from './sheets/reference'; | ||
export { Styles } from './sheets/styles'; | ||
@@ -53,0 +55,0 @@ export { SheetViewModel } from './sheets/view-model'; |
@@ -107,3 +107,3 @@ /** | ||
registerCommand(command: ICommand): IDisposable; | ||
registerAsMultipleCommand(command: ICommand): IDisposable; | ||
registerMultipleCommand(command: ICommand): IDisposable; | ||
executeCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): Promise<R>; | ||
@@ -122,5 +122,13 @@ syncExecuteCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): R; | ||
export declare const ICommandService: import("@wendellhu/redi").IdentifierDecorator<ICommandService>; | ||
/** | ||
* The registry of commands. | ||
*/ | ||
export declare class CommandRegistry { | ||
private readonly _commands; | ||
registerCommand(command: ICommand): IDisposable; | ||
getCommand(id: string): [ICommand] | null; | ||
} | ||
export declare class CommandService implements ICommandService { | ||
private readonly _injector; | ||
private readonly _log; | ||
private readonly _logService; | ||
private readonly _commandRegistry; | ||
@@ -132,5 +140,5 @@ private readonly _beforeCommandExecutionListeners; | ||
private _commandExecutionStack; | ||
constructor(_injector: Injector, _log: ILogService); | ||
constructor(_injector: Injector, _logService: ILogService); | ||
registerCommand(command: ICommand): IDisposable; | ||
registerAsMultipleCommand(command: ICommand): IDisposable; | ||
registerMultipleCommand(command: ICommand): IDisposable; | ||
beforeCommandExecuted(listener: CommandListener): IDisposable; | ||
@@ -137,0 +145,0 @@ onCommandExecuted(listener: (commandInfo: ICommandInfo) => void): IDisposable; |
@@ -24,3 +24,3 @@ /** | ||
getConfig<T>(id: string): Nullable<T>; | ||
setConfig(id: string, value: any): void; | ||
setConfig(id: string, value: unknown): void; | ||
deleteConfig(id: string): void; | ||
@@ -31,4 +31,4 @@ } | ||
getConfig<T>(id: string): Nullable<T>; | ||
setConfig(id: string, value: any): void; | ||
setConfig(id: string, value: unknown): void; | ||
deleteConfig(id: string): void; | ||
} |
@@ -19,3 +19,3 @@ /** | ||
export interface IContextService { | ||
contextChanged$: Observable<void>; | ||
readonly contextChanged$: Observable<void>; | ||
getContextValue(key: string): boolean; | ||
@@ -22,0 +22,0 @@ setContextValue(key: string, value: boolean): void; |
@@ -23,3 +23,3 @@ /** | ||
unitId: string; | ||
subComponentId: string; | ||
subUnitId: string; | ||
} | ||
@@ -26,0 +26,0 @@ export interface IFloatingObjectManagerSearchItemParam extends IFloatingObjectManagerSearchParam { |
@@ -21,11 +21,29 @@ /** | ||
import { LifecycleStages } from './lifecycle'; | ||
/** | ||
* This service controls the lifecycle of a Univer instance. Other modules can | ||
* inject this service to read the current lifecycle stage or subscribe to | ||
* lifecycle changes. | ||
*/ | ||
export declare class LifecycleService extends Disposable { | ||
private readonly _logService; | ||
private _lifecycle$; | ||
lifecycle$: Observable<LifecycleStages>; | ||
readonly lifecycle$: Observable<LifecycleStages>; | ||
constructor(_logService: ILogService); | ||
get stage(): LifecycleStages; | ||
set stage(stage: LifecycleStages); | ||
dispose(): void; | ||
/** | ||
* Subscribe to lifecycle changes and all previous stages and the current | ||
* stage will be emitted immediately. | ||
* @returns | ||
*/ | ||
subscribeWithPrevious(): Observable<LifecycleStages>; | ||
private _reportProgress; | ||
} | ||
/** | ||
* This service is used to initialize modules on a certain lifecycle stage. | ||
* Refer to `runOnLifecycle` and `OnLifecycle` for more details. | ||
* | ||
* @internal | ||
*/ | ||
export declare class LifecycleInitializerService extends Disposable { | ||
@@ -32,0 +50,0 @@ private _lifecycleService; |
@@ -21,6 +21,8 @@ /** | ||
WARN = 2, | ||
VERBOSE = 3 | ||
INFO = 3, | ||
VERBOSE = 4 | ||
} | ||
type ArgsType = any[]; | ||
export interface ILogService { | ||
debug(...args: ArgsType): void; | ||
log(...args: ArgsType): void; | ||
@@ -34,2 +36,3 @@ warn(...args: ArgsType): void; | ||
private _logLevel; | ||
debug(...args: ArgsType): void; | ||
log(...args: ArgsType): void; | ||
@@ -39,3 +42,4 @@ warn(...args: ArgsType): void; | ||
setLogLevel(logLevel: LogLevel): void; | ||
private _log; | ||
} | ||
export {}; |
@@ -36,3 +36,3 @@ /** | ||
private readonly _collection; | ||
protected disposeWithMe(disposable: IDisposable): IDisposable; | ||
protected disposeWithMe(disposable: IDisposable | SubscriptionLike): IDisposable; | ||
dispose(): void; | ||
@@ -39,0 +39,0 @@ } |
@@ -30,4 +30,4 @@ /** | ||
export declare function spliceArray<T>(start: number, count: number, o: IObjectArrayPrimitiveType<T>): void; | ||
export declare function concatMatrixArray<T>(source: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>, target: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>; | ||
export declare function sliceMatrixArray<T>(start: number, end: number, matrixArray: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>; | ||
export declare function concatMatrixArray<T>(source: IObjectArrayPrimitiveType<T>, target: IObjectArrayPrimitiveType<T>): IObjectArrayPrimitiveType<T>; | ||
export declare function sliceMatrixArray<T>(start: number, end: number, matrixArray: IObjectArrayPrimitiveType<T>): IObjectArrayPrimitiveType<T>; | ||
export declare function moveMatrixArray<T>(fromIndex: number, count: number, toIndex: number, o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): void; | ||
@@ -34,0 +34,0 @@ /** |
@@ -18,2 +18,3 @@ /** | ||
import { AbsoluteRefType } from '../types/interfaces/i-range'; | ||
export declare const UNIT_NAME_REGEX = "'?\\[((?![\\/?:\"<>|*\\\\]).)*?\\]"; | ||
export interface IGridRangeName { | ||
@@ -24,2 +25,6 @@ unitId: string; | ||
} | ||
export interface IAbsoluteRefTypeForRange { | ||
startAbsoluteRefType: AbsoluteRefType; | ||
endAbsoluteRefType?: AbsoluteRefType; | ||
} | ||
/** | ||
@@ -34,9 +39,3 @@ * | ||
*/ | ||
export declare function getAbsoluteRefTypeWitString(refString: string): { | ||
startAbsoluteRefType: AbsoluteRefType; | ||
endAbsoluteRefType: AbsoluteRefType; | ||
} | { | ||
startAbsoluteRefType: AbsoluteRefType; | ||
endAbsoluteRefType?: undefined; | ||
}; | ||
export declare function getAbsoluteRefTypeWitString(refString: string): IAbsoluteRefTypeForRange; | ||
/** | ||
@@ -63,2 +62,7 @@ * Serialize an `IRange` into a string. | ||
export declare function serializeRangeToRefString(gridRangeName: IGridRangeName): string; | ||
export declare function handleRefStringInfo(refString: string): { | ||
refBody: string; | ||
sheetName: string; | ||
unitId: string; | ||
}; | ||
export declare function deserializeRangeWithSheet(refString: string): IGridRangeName; |
@@ -51,2 +51,3 @@ /** | ||
private _count; | ||
get name(): string; | ||
constructor(workbookData: Partial<IWorkbookData> | undefined, _log: ILogService); | ||
@@ -57,2 +58,3 @@ dispose(): void; | ||
getSnapshot(): IWorkbookData; | ||
getName(): string; | ||
getUnitId(): string; | ||
@@ -131,5 +133,21 @@ getRev(): number; | ||
load(config: IWorkbookData): void; | ||
/** | ||
* Check if sheet name is unique | ||
* @param name sheet name | ||
* @returns True if sheet name is unique | ||
*/ | ||
checkSheetName(name: string): boolean; | ||
/** | ||
* Check whether the sheet name is unique and generate a new unique sheet name | ||
* @param name sheet name | ||
* @returns Unique sheet name | ||
*/ | ||
uniqueSheetName(name?: string): string; | ||
/** | ||
* Automatically generate new sheet name | ||
* @param name sheet name | ||
* @returns New sheet name | ||
*/ | ||
generateNewSheetName(name: string): string; | ||
/** | ||
* Get the range array based on the range string and sheet id | ||
@@ -136,0 +154,0 @@ * |
@@ -50,1 +50,2 @@ /** | ||
export declare function isNullCell(cell: Nullable<ICellData>): boolean; | ||
export declare function isCellV(cell: Nullable<ICellData | ICellV>): boolean; |
@@ -25,2 +25,3 @@ /** | ||
s: BooleanNumber; | ||
c?: BooleanNumber; | ||
cl?: IColorStyle; | ||
@@ -27,0 +28,0 @@ t?: TextDecoration; |
{ | ||
"name": "@univerjs/core", | ||
"version": "0.1.0-beta.1", | ||
"version": "0.1.0-beta.2", | ||
"description": "Core library for Univer.", | ||
@@ -39,3 +39,3 @@ "keywords": [], | ||
"dependencies": { | ||
"@wendellhu/redi": "^0.12.12", | ||
"@wendellhu/redi": "^0.12.13", | ||
"dayjs": "^1.11.10", | ||
@@ -48,8 +48,8 @@ "nanoid": "5.0.4", | ||
"@types/numeral": "^2.0.5", | ||
"@vitest/coverage-istanbul": "^1.1.0", | ||
"@vitest/coverage-istanbul": "^1.1.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.0.10", | ||
"vite-plugin-dts": "^3.6.4", | ||
"vite-plugin-dts": "^3.7.0", | ||
"vite-plugin-externals": "^0.6.2", | ||
"vitest": "^1.1.0" | ||
"vitest": "^1.1.1" | ||
}, | ||
@@ -56,0 +56,0 @@ "peerDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
857957
149
16100
Updated@wendellhu/redi@^0.12.13