@univerjs/core
Advanced tools
Comparing version 0.1.13 to 0.1.14
@@ -20,3 +20,2 @@ /** | ||
export { Univer } from './univer'; | ||
export { PluginHolder } from './services/plugin/plugin-holder'; | ||
export { shallowEqual, isRangesEqual, isUnitRangesEqual } from './common/equal'; | ||
@@ -44,3 +43,3 @@ export { isNumeric, isSafeNumeric } from './common/number'; | ||
export { Plugin } from './services/plugin/plugin'; | ||
export { PluginService } from './services/plugin/plugin.service'; | ||
export { PluginService, DependentOn } from './services/plugin/plugin.service'; | ||
export { type CommandListener, CommandService, CommandType, type ICommand, type ICommandInfo, ICommandService, type IExecutionOptions, type IMultiCommand, type IMutation, type IMutationCommonParams, type IMutationInfo, type IOperation, type IOperationInfo, NilCommand, sequenceExecute, sequenceExecuteAsync, } from './services/command/command.service'; | ||
@@ -106,5 +105,5 @@ export { IConfigService } from './services/config/config.service'; | ||
export { DataValidationStatus } from './types/enum/data-validation-status'; | ||
export type { IPermissionTypes } from './services/permission/type'; | ||
export type { IPermissionTypes, WorkbookPermissionPointConstructor } from './services/permission/type'; | ||
export { AuthzIoLocalService } from './services/authz-io/authz-io-local.service'; | ||
export { IAuthzIoService } from './services/authz-io/type'; | ||
export { createDefaultUser } from './services/user-manager/const'; |
@@ -11,5 +11,5 @@ import { Observable } from 'rxjs'; | ||
} | ||
type WorkbookPermissionPointConstructor = new (unitId: string) => IPermissionPoint; | ||
type WorkSheetPermissionPointConstructor = new (unitId: string, subUnitId: string) => IPermissionPoint; | ||
type RangePermissionPointConstructor = new (unitId: string, subUnitId: string, permissionId: string) => IPermissionPoint; | ||
export type WorkbookPermissionPointConstructor = new (unitId: string) => IPermissionPoint; | ||
export type WorkSheetPermissionPointConstructor = new (unitId: string, subUnitId: string) => IPermissionPoint; | ||
export type RangePermissionPointConstructor = new (unitId: string, subUnitId: string, permissionId: string) => IPermissionPoint; | ||
export interface IPermissionTypes { | ||
@@ -44,2 +44,1 @@ rangeTypes?: RangePermissionPointConstructor[]; | ||
export declare const IPermissionService: import('@wendellhu/redi').IdentifierDecorator<IPermissionService>; | ||
export {}; |
@@ -5,5 +5,7 @@ import { Ctor, Injector } from '@wendellhu/redi'; | ||
export type PluginCtor<T extends Plugin> = Ctor<T> & { | ||
export declare const DependentOnSymbol: unique symbol; | ||
export type PluginCtor<T extends Plugin = Plugin> = Ctor<T> & { | ||
type: UniverInstanceType; | ||
pluginName: string; | ||
[DependentOnSymbol]?: PluginCtor[]; | ||
}; | ||
@@ -17,3 +19,3 @@ /** | ||
protected abstract _injector: Injector; | ||
onStarting(_injector: Injector): void; | ||
onStarting(injector: Injector): void; | ||
onReady(): void; | ||
@@ -20,0 +22,0 @@ onRendered(): void; |
import { IDisposable, Injector } from '@wendellhu/redi'; | ||
import { UnitType, UniverInstanceType } from '../../common/unit'; | ||
import { PluginHolder } from './plugin-holder'; | ||
import { Plugin, PluginCtor } from './plugin'; | ||
import { Disposable } from '../../shared/lifecycle'; | ||
import { UniverInstanceType } from '../../common/unit'; | ||
import { LifecycleInitializerService, LifecycleService } from '../lifecycle/lifecycle.service'; | ||
import { ILogService } from '../log/log.service'; | ||
import { Plugin, PluginCtor, PluginRegistry, PluginStore } from './plugin'; | ||
/** | ||
* Use this decorator to declare dependencies among plugins. If a dependent plugin is not registered yet, | ||
* Univer will automatically register it with no configuration. | ||
* | ||
* For example: | ||
* | ||
* ```ts | ||
* @DependentOn(UniverDrawingPlugin, UniverDrawingUIPlugin, UniverSheetsDrawingPlugin) | ||
* export class UniverSheetsDrawingUIPlugin extends Plugin { | ||
* } | ||
* ``` | ||
*/ | ||
export declare function DependentOn(...plugins: PluginCtor<Plugin>[]): (target: PluginCtor<Plugin>) => void; | ||
/** | ||
* This service manages plugin registration. | ||
@@ -13,8 +28,11 @@ */ | ||
private readonly _pluginHoldersForTypes; | ||
private readonly _seenPlugins; | ||
constructor(_injector: Injector); | ||
dispose(): void; | ||
/** Register a plugin into univer. */ | ||
registerPlugin<T extends PluginCtor<Plugin>>(plugin: T, config?: ConstructorParameters<T>[0]): void; | ||
registerPlugin<T extends PluginCtor>(ctor: T, config?: ConstructorParameters<T>[0]): void; | ||
startPluginForType(type: UniverInstanceType): void; | ||
_ensurePluginHolderForType(type: UnitType): PluginHolder; | ||
private _ensurePluginHolderForType; | ||
private _immediateInitPlugin; | ||
private _checkPluginSeen; | ||
private _assertPluginValid; | ||
@@ -26,1 +44,23 @@ private _flushTimer?; | ||
} | ||
export declare class PluginHolder extends Disposable { | ||
private _checkPluginRegistered; | ||
private _registerPlugin; | ||
protected readonly _logService: ILogService; | ||
protected readonly _injector: Injector; | ||
protected readonly _lifecycleService: LifecycleService; | ||
protected readonly _lifecycleInitializerService: LifecycleInitializerService; | ||
protected _started: boolean; | ||
get started(): boolean; | ||
/** Plugin constructors waiting to be initialized. */ | ||
protected readonly _pluginRegistry: PluginRegistry; | ||
/** Stores initialized plugin instances. */ | ||
protected readonly _pluginStore: PluginStore; | ||
constructor(_checkPluginRegistered: (pluginCtor: PluginCtor) => boolean, _registerPlugin: <T extends PluginCtor>(plugin: T, config?: ConstructorParameters<T>[0]) => void, _logService: ILogService, _injector: Injector, _lifecycleService: LifecycleService, _lifecycleInitializerService: LifecycleInitializerService); | ||
dispose(): void; | ||
register<T extends PluginCtor<Plugin>>(pluginCtor: T, config?: ConstructorParameters<T>[0]): void; | ||
immediateInitPlugin<T extends Plugin>(plugin: PluginCtor<T>): void; | ||
start(): void; | ||
flush(): void; | ||
private _initPlugin; | ||
protected _pluginsRunLifecycle(plugins: Plugin[]): void; | ||
} |
@@ -17,3 +17,12 @@ /** | ||
type debounceFn<T extends (...args: any[]) => any> = (this: ThisParameterType<T>, ...args: Parameters<T>) => void; | ||
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): debounceFn<T>; | ||
/** | ||
* Creates a debounced function that delays invoking the provided function until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. | ||
* @template T - The type of the function to be debounced. | ||
* @param {T} func - The function to be debounced. | ||
* @param {number} wait - The number of milliseconds to wait before invoking the function. | ||
* @returns {debounceFn<T> & { cancel: () => void }} - The debounced function, which also has a `cancel` method to cancel the scheduled function call. | ||
*/ | ||
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): debounceFn<T> & { | ||
cancel: () => void; | ||
}; | ||
export {}; |
@@ -100,2 +100,10 @@ import { Class, IKeyValue } from './types'; | ||
static isValidParameter(name: string): boolean; | ||
/** | ||
* As lodash set, via a path string to set value to deep property | ||
* set(obj, 'xx.yy', val) | ||
* @param data | ||
* @param propertyPath | ||
* @param value | ||
*/ | ||
static set(data: Record<string, any>, propertyPath: string, value: any): void; | ||
} |
@@ -294,2 +294,3 @@ import { Nullable } from '../../common/type-util'; | ||
cellValueType?: CellValueType; | ||
isRenderStyle?: BooleanNumber; | ||
} | ||
@@ -296,0 +297,0 @@ export interface ISectionBreakBase { |
{ | ||
"name": "@univerjs/core", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"private": false, | ||
@@ -48,6 +48,2 @@ "description": "Core library for Univer.", | ||
], | ||
"engines": { | ||
"node": ">=16.0.0", | ||
"npm": ">=8.0.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -58,3 +54,3 @@ "@wendellhu/redi": "0.15.2", | ||
"dependencies": { | ||
"@univerjs/protocol": "^0.1.34", | ||
"@univerjs/protocol": "^0.1.36", | ||
"nanoid": "5.0.7", | ||
@@ -71,4 +67,17 @@ "numeral": "^2.0.6", | ||
"vitest": "^1.6.0", | ||
"@univerjs/shared": "0.1.13" | ||
"@univerjs/shared": "0.1.14" | ||
}, | ||
"univerSpace": { | ||
".": { | ||
"import": "./lib/es/index.js", | ||
"require": "./lib/cjs/index.js", | ||
"types": "./lib/types/index.d.ts" | ||
}, | ||
"./*": { | ||
"import": "./lib/es/*", | ||
"require": "./lib/cjs/*", | ||
"types": "./lib/types/index.d.ts" | ||
}, | ||
"./lib/*": "./lib/*" | ||
}, | ||
"scripts": { | ||
@@ -75,0 +84,0 @@ "test": "vitest run", |
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
1011163
18802
203
+ Added@types/node@22.13.1(transitive)
- Removed@types/node@22.13.4(transitive)
Updated@univerjs/protocol@^0.1.36