@univerjs/core 0.15.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,3 +16,10 @@
16
16
  export declare const topLevelDomainSet: Set<string>;
17
17
  export declare function isLegalUrl(url: string): boolean;
18
18
  export declare function normalizeUrl(urlStr: string): string;
19
+ /**
20
+ * Resolve a URL with a base URL, ensuring the path from the base URL is preserved.
21
+ * @param {string} url - The URL to resolve.
22
+ * @param {string} baseURL - The base URL to use for resolution.
23
+ * @returns {string} - The resolved URL.
24
+ */
25
+ export declare function resolveWithBasePath(url: string, baseURL: string): string;
@@ -36,6 +36,7 @@ export { requestImmediateMacroTask } from './common/request-immediate-macro-task
36
36
  export { type ISequenceExecuteResult, sequence, sequenceAsync } from './common/sequence';
37
37
  export { mergeSets } from './common/set';
38
38
  export { UnitModel, type UnitType, UniverInstanceType } from './common/unit';
39
+ export { resolveWithBasePath } from './common/url';
39
40
  export * from './docs/data-model';
40
41
  export { JSON1, JSONX } from './docs/data-model/json-x/json-x';
41
42
  export type { JSONXActions, JSONXPath } from './docs/data-model/json-x/json-x';
@@ -61,7 +62,9 @@ export { IConfirmService, TestConfirmService } from './services/confirm/confirm.
61
62
  export * from './services/context/context';
62
63
  export { ContextService, IContextService } from './services/context/context.service';
63
64
  export { ErrorService, type IError } from './services/error/error.service';
64
- export { IImageIoService, type IImageIoServiceParam, ImageSourceType, ImageUploadStatusType } from './services/image-io/image-io.service';
65
+ export { IImageIoService, ImageSourceType, ImageUploadStatusType } from './services/image-io/image-io.service';
66
+ export type { IImageIoServiceParam } from './services/image-io/image-io.service';
67
+ export { IURLImageService } from './services/image-io/url-image.service';
65
68
  export { type ICreateUnitOptions, IUniverInstanceService, UniverInstanceService } from './services/instance/instance.service';
66
69
  export { LifecycleStages } from './services/lifecycle/lifecycle';
67
70
  export { LifecycleService, LifecycleUnreachableError } from './services/lifecycle/lifecycle.service';
@@ -33,10 +33,6 @@ export interface IEventObserver<T> extends Partial<RxObserver<[T, EventState]>>
33
33
  */
34
34
  export declare class EventSubject<T> extends Subject<[T, EventState]> {
35
35
  private _sortedObservers;
36
- /** @deprecated Use `subscribeEvent` instead. */
37
- subscribe(): Subscription;
38
- /** @deprecated Use `emitEvent` instead. */
39
- next(): void;
40
36
  unsubscribe(): void;
41
37
  complete(): void;
42
38
  subscribeEvent(observer: IEventObserver<T> | ((evt: T, state: EventState) => unknown)): Subscription;
@@ -0,0 +1,22 @@
1
+ import { IDisposable } from '../../common/di';
2
+ export interface IURLImageService {
3
+ /**
4
+ * Get image url or base64.
5
+ * if there is a custom downloader, return the result of the downloader (usually base64).
6
+ * if there is no custom downloader, return the original url.
7
+ * @param url image url
8
+ */
9
+ getImage(url: string): Promise<string>;
10
+ /**
11
+ * Download image to blob
12
+ * @param url image url
13
+ */
14
+ downloadImage(url: string): Promise<Blob>;
15
+ /**
16
+ * Register a custom image downloader for URL images
17
+ * @param downloader The downloader function that takes a URL and returns a base64 string
18
+ * @returns A disposable object to unregister the downloader
19
+ */
20
+ registerURLImageDownloader(downloader: (url: string) => Promise<string>): IDisposable;
21
+ }
22
+ export declare const IURLImageService: import('@wendellhu/redi').IdentifierDecorator<IURLImageService>;
@@ -21,10 +21,6 @@ export interface IResourceManagerService {
21
21
  registerPluginResource: <T = any>(hook: IResourceHook<T>) => IDisposable;
22
22
  disposePluginResource: (pluginName: IResourceName) => void;
23
23
  getAllResourceHooks: () => IResourceHook[];
24
- /**
25
- * @deprecated You should get resource with type specified.
26
- */
27
- getResources(unitId: string): IResources;
28
24
  getResources(unitId: string, type: UniverInstanceType): IResources;
29
25
  getResourcesByType: (unitId: string, type: UniverInstanceType) => IResources;
30
26
  loadResources: (unitId: string, resources?: IResources) => void;
@@ -1,14 +1,10 @@
1
- import { SubscriptionLike, Subject, Subscription } from 'rxjs';
1
+ import { SubscriptionLike, Subject } from 'rxjs';
2
2
  import { IDisposable } from '../common/di';
3
3
  type DisposableLike = IDisposable | SubscriptionLike | (() => void);
4
4
  export declare function toDisposable(disposable: IDisposable): IDisposable;
5
5
  export declare function toDisposable(subscription: SubscriptionLike): IDisposable;
6
6
  export declare function toDisposable(callback: () => void): IDisposable;
7
7
  export declare function toDisposable(v: DisposableLike): IDisposable;
8
- /**
9
- * @deprecated use toDisposable instead
10
- */
11
- export declare function fromObservable(subscription: Subscription): IDisposable;
12
8
  export declare class DisposableCollection implements IDisposable {
13
9
  private readonly _disposables;
14
10
  add(disposable: DisposableLike): {
@@ -11,10 +11,6 @@ export interface IObjectArrayPrimitiveType<T> {
11
11
  }
12
12
  export declare function mapObjectMatrix<T, R>(o: IObjectMatrixPrimitiveType<T>, callback: (row: number, col: number, value: T) => R): IObjectMatrixPrimitiveType<R>;
13
13
  export declare function getArrayLength<T>(o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): number;
14
- /**
15
- * This function has bug of undefined value to be inserted.
16
- * @deprecated
17
- */
18
14
  export declare function insertMatrixArray<T>(index: number, value: T, o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): void;
19
15
  export declare function spliceArray<T>(start: number, count: number, o: IObjectArrayPrimitiveType<T> | IObjectMatrixPrimitiveType<T>): void;
20
16
  export declare function concatMatrixArray<T>(source: IObjectArrayPrimitiveType<T>, target: IObjectArrayPrimitiveType<T>): IObjectArrayPrimitiveType<T>;
@@ -126,6 +126,15 @@ export declare class Worksheet {
126
126
  * @returns {IStyleData} The composed style of the cell
127
127
  */
128
128
  getComposedCellStyleByCellData(row: number, col: number, cellData: Nullable<ICellDataForSheetInterceptor>, rowPriority?: boolean): IStyleData;
129
+ /**
130
+ * Get the composed style of the cell without its own style.
131
+ * @param {number} row The row index of the cell
132
+ * @param {number} col The column index of the cell
133
+ * @param {Nullable<ICellDataForSheetInterceptor>} [cellData] The cell data of the cell.
134
+ * @param {boolean} [rowPriority] If true, row style will precede column style, otherwise use this._isRowStylePrecedeColumnStyle
135
+ * @returns {IStyleData} The composed style of the cell without its own style
136
+ */
137
+ getComposedCellStyleWithoutSelf(row: number, col: number, cellData?: Nullable<ICellDataForSheetInterceptor>, rowPriority?: boolean): IStyleData;
129
138
  /**
130
139
  * Returns WorkSheet Cell Data Matrix
131
140
  * @returns WorkSheet Cell Data Matrix