@sheetxl/sdk 0.8.0-beta.5 → 0.8.0-beta.7
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.
- package/browser/cjs/{BV3LBQXG3kA013a2.cjs → CrcmEew-dr51xpf9.cjs} +1 -1
- package/browser/cjs/CwzIjMpnMKeypivl.cjs +1 -0
- package/browser/cjs/D3Vlh9UOBKtvlXBL.cjs +93 -0
- package/browser/cjs/{D_hl_D3IBlVqjbUu.cjs → E08wpSuqr-UadjSZ.cjs} +1 -1
- package/browser/cjs/{CvjJnxfMX3aal6Zj.cjs → O6F5xVsoF2hTiprv.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{DWJJtu3q6iMfUbbN.mjs → B7v0PdbyuBlceMLG.mjs} +2 -2
- package/browser/esm/{BiUnakUlo61EtntE.mjs → BADV_AABAw-3U9iO.mjs} +1 -1
- package/browser/esm/{CoiupvxiR8tLrCa4.mjs → CFDfAmU2o5HFRTu4.mjs} +2 -2
- package/browser/esm/{CLfbadk6S57dy8sc.mjs → DRpWwH6CWI0QaNlp.mjs} +9549 -8412
- package/browser/esm/{ahTq_KBqu4jWkQ8A.mjs → DkHfJEJlvjDJnXEU.mjs} +2 -2
- package/browser/esm/{B45qhpdlbHHa6-gu.mjs → bSQdR4WlmM40WWFR.mjs} +2 -2
- package/browser/esm/index.mjs +9 -8
- package/browser/esm/{B6t-k7D3HcTIJ-Xl.mjs → tBEZ_r7Bkp7CrFLF.mjs} +2 -2
- package/node/esm/{BP9JmWMpUInDk4OG.mjs → BShIHUY7pxerJVT8.mjs} +1 -1
- package/node/esm/{CDh1Fw2maXvyOhIs.mjs → CWJELJxqO-1z0tJU.mjs} +1 -1
- package/node/esm/{B2dQyLw_fQU5VuXt.mjs → DbAKZ-Ythj1VwgyS.mjs} +1 -1
- package/node/esm/{K4Xw9Ur7uFf9M5Gh.mjs → HMR0po5avaUU1XUZ.mjs} +1 -1
- package/node/esm/index.mjs +11533 -10368
- package/package.json +6 -6
- package/resources/locales/de/model.msg.json +16 -0
- package/resources/locales/en/model.msg.json +16 -0
- package/types/scripting-api.json +6891 -6844
- package/types/scripting.d.ts +493 -137
- package/types/src/calculation/_TableRename.d.ts +13 -0
- package/types/src/calculation/grid/CalcGrid.d.ts +18 -3
- package/types/src/calculation/grid/CalcGridBackend.d.ts +49 -0
- package/types/src/calculation/grid/CalcGridProxy.d.ts +5 -0
- package/types/src/calculation/grid/ICalcGrid.d.ts +37 -0
- package/types/src/calculation/grid/_CalcRequest.d.ts +22 -0
- package/types/src/calculation/state/CalculationContext.d.ts +7 -1
- package/types/src/cell/ICell.d.ts +21 -1
- package/types/src/chart/Chart.d.ts +5 -18
- package/types/src/chart/ChartCollection.d.ts +1 -1
- package/types/src/chart/IChart.d.ts +11 -10
- package/types/src/chart/IChartCollection.d.ts +3 -3
- package/types/src/color/_BuiltInIndexDefs.d.ts +6 -0
- package/types/src/comment/Comment.d.ts +69 -7
- package/types/src/comment/IComment.d.ts +70 -51
- package/types/src/comment/NoteMovable.d.ts +26 -0
- package/types/src/comment/_CommentUtils.d.ts +23 -1
- package/types/src/comment/_NoteBox.d.ts +50 -0
- package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +27 -2
- package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/AndOperator.d.ts +3 -1
- package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/NotOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/OrOperator.d.ts +3 -1
- package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +6 -0
- package/types/src/condition/Condition.d.ts +2 -0
- package/types/src/condition/ICondition.d.ts +59 -2
- package/types/src/condition/_ConditionUtils.d.ts +10 -0
- package/types/src/filter/IFilter.d.ts +76 -1
- package/types/src/movable/AbstractMovableContent.d.ts +54 -0
- package/types/src/movable/Control.d.ts +5 -7
- package/types/src/movable/CustomElement.d.ts +4 -5
- package/types/src/movable/IControl.d.ts +7 -5
- package/types/src/movable/ICustomElement.d.ts +7 -2
- package/types/src/movable/IMovable.d.ts +74 -42
- package/types/src/movable/IMovableCollection.d.ts +6 -0
- package/types/src/movable/Movable.d.ts +53 -32
- package/types/src/numFmt/_FormatCell.d.ts +9 -0
- package/types/src/person/index.d.ts +1 -0
- package/types/src/picture/IPicture.d.ts +7 -1
- package/types/src/picture/Picture.d.ts +5 -4
- package/types/src/primitives/Range.d.ts +31 -1
- package/types/src/primitives/RangeStats.d.ts +7 -2
- package/types/src/primitives/ReferenceRange.d.ts +2 -0
- package/types/src/primitives/stats/AggregateStats.d.ts +49 -15
- package/types/src/primitives/stats/FrequencyStats.d.ts +1 -1
- package/types/src/primitives/stats/Ranked.d.ts +1 -1
- package/types/src/primitives/stats/SortedNumbers.d.ts +2 -2
- package/types/src/shape/IShape.d.ts +6 -4
- package/types/src/shape/Shape.d.ts +5 -10
- package/types/src/sheet/ISheet.d.ts +3 -2
- package/types/src/sheet/Sheet.d.ts +73 -21
- package/types/src/sheet/SheetCell.d.ts +1 -1
- package/types/src/sheet/_SheetFilterUtils.d.ts +17 -0
- package/types/src/sheet/_SheetStateTypes.d.ts +18 -0
- package/types/src/sheet/_SheetUtils.d.ts +15 -0
- package/types/src/sheetHeader/ISheetHeader.d.ts +17 -0
- package/types/src/sheetHeader/SheetHeader.d.ts +11 -0
- package/types/src/slicer/ISlicer.d.ts +7 -2
- package/types/src/slicer/Slicer.d.ts +5 -9
- package/types/src/table/AnchoredTable.d.ts +46 -6
- package/types/src/table/ITable.d.ts +10 -1
- package/types/src/table/ITableCollection.d.ts +10 -0
- package/types/src/table/_FilterField.d.ts +9 -1
- package/types/src/text/richtext/IRichText.d.ts +36 -0
- package/types/src/text/richtext/index.d.ts +1 -0
- package/types/src/transaction/ITransaction.d.ts +11 -0
- package/types/src/transaction/Transaction.d.ts +2 -0
- package/browser/cjs/By2s44r4eRFvMq6H.cjs +0 -93
- package/browser/cjs/Nt1C8528otcBXJ2J.cjs +0 -1
|
@@ -4,19 +4,23 @@ import { IHistory } from '../history';
|
|
|
4
4
|
import { IResource, IResourceCollection } from '../resource';
|
|
5
5
|
import { ITransaction } from '../transaction';
|
|
6
6
|
import { IAnchored } from '../anchored';
|
|
7
|
-
import { IModel } from '../model';
|
|
8
7
|
import { IMovable } from './IMovable';
|
|
8
|
+
import { IMovableCollection } from './IMovableCollection';
|
|
9
9
|
import { AbstractAnchored } from '../anchored/AbstractAnchored';
|
|
10
10
|
import { Anchored } from '../anchored/Anchored';
|
|
11
11
|
export declare class Movable<J extends IMovable.JSON = IMovable.JSON, STATE extends State = State> extends AbstractAnchored<STATE, IMovable.Events> {
|
|
12
|
-
static instanceCounter: number;
|
|
13
12
|
protected _content: Movable.Content;
|
|
14
|
-
|
|
15
|
-
private _contentListenerRemove;
|
|
16
|
-
private _optionsMovable;
|
|
13
|
+
protected _optionsMovable: Movable.ConstructorOptions<J>;
|
|
17
14
|
constructor(options: Movable.ConstructorOptions<J>);
|
|
18
15
|
/** {@inheritDoc IMovable.getContent} */
|
|
19
|
-
getContent():
|
|
16
|
+
getContent<T extends IMovable.IContent = IMovable.IContent>(): T;
|
|
17
|
+
/** {@inheritDoc IMovable.delete} */
|
|
18
|
+
delete(options?: ITransaction.OperationOptions): void;
|
|
19
|
+
/**
|
|
20
|
+
* Removes this movable because its content is being deleted.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
_deleteFromContent(): void;
|
|
20
24
|
protected _processAfterStateChange(state: STATE, commit: ITransaction.ICommit): void;
|
|
21
25
|
protected _processZIndex(): void;
|
|
22
26
|
protected _processContainerSelect(_selected: boolean, _first: boolean): IRange.Coords | void;
|
|
@@ -38,14 +42,6 @@ export declare class Movable<J extends IMovable.JSON = IMovable.JSON, STATE exte
|
|
|
38
42
|
protected _toHtml(): Promise<string> | string;
|
|
39
43
|
/** For easy overriding in subclass to implement ISnapshot */
|
|
40
44
|
protected _toImage(): Promise<Blob> | Blob;
|
|
41
|
-
/** {@inheritDoc IMovable.setName} */
|
|
42
|
-
setName(name: string): this;
|
|
43
|
-
/** {@inheritDoc IMovable.getName} */
|
|
44
|
-
getName(): string | null;
|
|
45
|
-
/** {@inheritDoc IMovable.setDescription} */
|
|
46
|
-
setDescription(description: string): this;
|
|
47
|
-
/** {@inheritDoc IMovable.getDescription} */
|
|
48
|
-
getDescription(): string | null;
|
|
49
45
|
/** {@inheritDoc IMovable.setHidden} */
|
|
50
46
|
setHidden(hidden?: boolean): this;
|
|
51
47
|
/** {@inheritDoc IMovable.isHidden} */
|
|
@@ -77,12 +73,31 @@ export declare class Movable<J extends IMovable.JSON = IMovable.JSON, STATE exte
|
|
|
77
73
|
/** {@inheritDoc IMovable.setAnchorType} */
|
|
78
74
|
setAnchorType(type: IAnchored.Type): this;
|
|
79
75
|
protected _processContainerShift(options: Anchored.ShiftOptions): IRange.Coords | null | void;
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Where this goes when a shift removes every cell it was anchored to, or `null` to delete the
|
|
78
|
+
* content with its cells, which is what a picture or a chart does.
|
|
79
|
+
*/
|
|
80
|
+
protected _processContainerRemoved(): IMovable.AnchorOffset | null;
|
|
81
|
+
/**
|
|
82
|
+
* The cells and offsets of an anchor that names a cell for both corners.
|
|
83
|
+
*/
|
|
84
|
+
private _locationFromAnchor;
|
|
85
|
+
/**
|
|
86
|
+
* The rows or columns under this movable changed size.
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* A movable that sizes with its cells has nothing to store: its bounds are read from its cells.
|
|
90
|
+
* One that does not is placed in pixels, so the cells those pixels fall on are found again.
|
|
91
|
+
*/
|
|
82
92
|
protected _processContainerLayout(): void;
|
|
83
93
|
protected _processAnchorCoords(): void;
|
|
84
94
|
protected enrichOffset(offset: IMovable.OffsetCoords, x: number, y: number): IMovable.OffsetCoords;
|
|
85
95
|
protected _fromJSON(json: IMovable.JSON): void;
|
|
96
|
+
/**
|
|
97
|
+
* The anchor as it is saved: the cells of both corners and any non-zero offsets into them.
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
_getAnchorJSON(): IMovable.AnchorOffset;
|
|
86
101
|
toJSON(toResourceId?: (resource: IResource) => number | null): IMovable.JSON;
|
|
87
102
|
/** {@inheritDoc IMovable.isIMovable} */
|
|
88
103
|
get isIMovable(): true;
|
|
@@ -96,19 +111,10 @@ export declare class Movable<J extends IMovable.JSON = IMovable.JSON, STATE exte
|
|
|
96
111
|
* {@link Movable}
|
|
97
112
|
*/
|
|
98
113
|
export declare namespace Movable {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
getTypeDescription(): string;
|
|
104
|
-
/**
|
|
105
|
-
* Movable content must be deletable; the movable deletes its content when it is removed.
|
|
106
|
-
*/
|
|
107
|
-
delete(options?: ITransaction.OperationOptions): void;
|
|
108
|
-
/**
|
|
109
|
-
* A description for the instance.
|
|
110
|
-
*/
|
|
111
|
-
getDescription?(): string;
|
|
114
|
+
/**
|
|
115
|
+
* What a movable needs of its content beyond {@link IMovable.IContent}.
|
|
116
|
+
*/
|
|
117
|
+
interface Content<J = any> extends IMovable.IContent {
|
|
112
118
|
/**
|
|
113
119
|
* Create a json object.
|
|
114
120
|
*/
|
|
@@ -199,6 +205,15 @@ export declare namespace Movable {
|
|
|
199
205
|
processZIndex: () => void;
|
|
200
206
|
processSelection: (selected: boolean, first: boolean) => IRange.Coords | void;
|
|
201
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* What a copy hands to the collection it is copied to.
|
|
210
|
+
*/
|
|
211
|
+
interface AddOptions<J = any> extends IMovableCollection.AddOptions<J> {
|
|
212
|
+
/**
|
|
213
|
+
* The alternative text of the content.
|
|
214
|
+
*/
|
|
215
|
+
altText?: string;
|
|
216
|
+
}
|
|
202
217
|
}
|
|
203
218
|
interface MovableOffsets {
|
|
204
219
|
tl: Point;
|
|
@@ -207,13 +222,19 @@ interface MovableOffsets {
|
|
|
207
222
|
interface State extends AbstractAnchored.State {
|
|
208
223
|
/** Single rectangle — this type is never anchored to more than one range. */
|
|
209
224
|
anchorCoords: IRange.Coords;
|
|
210
|
-
name?: string | null;
|
|
211
|
-
description?: string | null;
|
|
212
225
|
hidden?: boolean;
|
|
213
226
|
rotation?: number;
|
|
214
227
|
lockAspectRatio?: boolean | null;
|
|
215
228
|
offsets?: MovableOffsets;
|
|
216
|
-
|
|
229
|
+
/**
|
|
230
|
+
* Where a movable that does not size with its cells is placed, in pixels. `null` for one that
|
|
231
|
+
* does: its bounds are read from its cells and offsets.
|
|
232
|
+
*
|
|
233
|
+
* @remarks
|
|
234
|
+
* An absolute movable is placed by all of it. A movable that moves with its cells is placed by
|
|
235
|
+
* its cell, and only the size is read from here.
|
|
236
|
+
*/
|
|
237
|
+
pixelBounds?: Bounds | null;
|
|
217
238
|
}
|
|
218
239
|
export {};
|
|
219
240
|
//# sourceMappingURL=Movable.d.ts.map
|
|
@@ -3,6 +3,15 @@ import { IColor } from '../color';
|
|
|
3
3
|
import { IStyle } from '../style';
|
|
4
4
|
import { NumberFormatRef } from './BuiltInFormats';
|
|
5
5
|
import { Parsed, ParserOptions } from './NumberFormatParser';
|
|
6
|
+
/**
|
|
7
|
+
* The text a value shows under a number format: the `displayText` of {@link parseNumberFormat}
|
|
8
|
+
* without a cell or its style.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* For a reader of many cells that wants only their text (a filter judging a column): what a cell
|
|
12
|
+
* shows follows from its value and its format, and a run of cells shares the format.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatDisplayText(runtime: IRuntime, value: Scalar, numberFormat: NumberFormatRef): string;
|
|
6
15
|
export declare function parseNumberFormat(runtime: IRuntime, value: Scalar, style: IStyle, type: ScalarType, numberFormat: NumberFormatRef, parseColor: (val: any) => IColor): Parsed;
|
|
7
16
|
/**
|
|
8
17
|
* The unformatted text for a number.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Size } from '@sheetxl/utils';
|
|
2
2
|
import { IListener } from '../listener';
|
|
3
|
+
import { ITransaction } from '../transaction';
|
|
3
4
|
import { IResource } from '../resource';
|
|
4
5
|
import { IModel } from '../model';
|
|
6
|
+
import { IMovable } from '../movable';
|
|
5
7
|
/**
|
|
6
8
|
* Interface for working with Pictures (both Images and SVG).
|
|
7
9
|
*/
|
|
8
|
-
export interface IPicture extends IModel {
|
|
10
|
+
export interface IPicture extends IModel, IMovable.IContent {
|
|
9
11
|
toJSON(toResourceId?: (resource: IResource) => number | null): IPicture.JSON;
|
|
12
|
+
/**
|
|
13
|
+
* Deletes the picture, and with it the movable that places it.
|
|
14
|
+
*/
|
|
15
|
+
delete(options?: ITransaction.OperationOptions): void;
|
|
10
16
|
/**
|
|
11
17
|
* Returns the resource associated with this picture.
|
|
12
18
|
*/
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { IResource } from '../resource';
|
|
2
|
-
import {
|
|
2
|
+
import { AbstractMovableContent } from '../movable/AbstractMovableContent';
|
|
3
3
|
import { IPicture } from './IPicture';
|
|
4
|
-
interface State extends
|
|
4
|
+
interface State extends AbstractMovableContent.State {
|
|
5
5
|
effects?: string[];
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Implementation for {@link IPicture}.
|
|
9
9
|
*/
|
|
10
|
-
export declare class Picture extends
|
|
10
|
+
export declare class Picture extends AbstractMovableContent<State, IPicture.JSON> implements IPicture {
|
|
11
11
|
private _resource;
|
|
12
12
|
private _details?;
|
|
13
13
|
private _dataUrl?;
|
|
14
14
|
constructor(options: Picture.ConstructorOptions);
|
|
15
15
|
/** {@inheritDoc IPicture.getType} */ getType(): string;
|
|
16
16
|
toJSON(toResourceId?: (resource: IResource) => number | null): IPicture.JSON;
|
|
17
|
+
/** {@inheritDoc IMovable.IContent.getTypeDescription} */
|
|
17
18
|
getTypeDescription(): string;
|
|
18
19
|
/** @internal */
|
|
19
20
|
protected _asDataUrl(): Promise<string>;
|
|
@@ -50,7 +51,7 @@ export declare namespace Picture {
|
|
|
50
51
|
/**
|
|
51
52
|
* Options for creating an IPicture.
|
|
52
53
|
*/
|
|
53
|
-
interface ConstructorOptions extends
|
|
54
|
+
interface ConstructorOptions extends AbstractMovableContent.ConstructorOptions<IPicture.JSON> {
|
|
54
55
|
resource?: IResource;
|
|
55
56
|
/**
|
|
56
57
|
* Returns an IResource from the resourceId or null if not found.
|
|
@@ -53,7 +53,11 @@ export declare class Range<T extends Scalar = Scalar> implements IRange<T> {
|
|
|
53
53
|
choose<TS extends Scalar = T>(from: (IRange<TS> | TS)[], selectFn: (value: TS, coords: IRange.CellCoords, range: IRange<T>) => MaybeError<number>, options?: IRange.ValuesOptions): this;
|
|
54
54
|
/** @inheritdoc IRange.clear */
|
|
55
55
|
clear(): this;
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* @inheritdoc IRange.clone
|
|
58
|
+
* @param options Read options for the clone, over this range's own: a `processRowSkip` here is
|
|
59
|
+
* a clone that reads without those rows.
|
|
60
|
+
*/
|
|
57
61
|
clone(options?: IRange.IteratorOptions, isLiteral?: boolean, isDirectScalar?: boolean): this;
|
|
58
62
|
/** @inheritdoc IRange.compute */
|
|
59
63
|
compute(fn: (range: IRange) => IRange): this;
|
|
@@ -258,6 +262,32 @@ export declare class Range<T extends Scalar = Scalar> implements IRange<T> {
|
|
|
258
262
|
* (`SUMPRODUCT(--ISNUMBER(SEARCH(...)))` → 0).
|
|
259
263
|
*/
|
|
260
264
|
protected _untyped(): this;
|
|
265
|
+
/** This range's options without its skips: for a result whose cells are laid out anew. */
|
|
266
|
+
protected _optionsFresh(): Omit<IRange.IteratorOptions, 'axis'> & {
|
|
267
|
+
axis?: IRange.Axis;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* This range's options for a result over the same grid at `coords`: its skips count from this
|
|
271
|
+
* range's origin and cover its shape, so a result whose origin moved (a slice) asks them with
|
|
272
|
+
* the difference, and one that grew (a resize) asks them for the cells it had and leaves the
|
|
273
|
+
* rest alone. `null` coords - a result laid out anew - carry no skip.
|
|
274
|
+
*
|
|
275
|
+
* @remarks
|
|
276
|
+
* The rule the skips follow: a result whose cells sit where this range's do (a slice, a fill, a
|
|
277
|
+
* resize, a map) keeps them, since it is written over a copy of this grid and the cells the skip
|
|
278
|
+
* left alone still hold what the source does; one laid out anew (`empty()`, a compaction, a
|
|
279
|
+
* reflow) drops them ({@link _optionsFresh}).
|
|
280
|
+
*/
|
|
281
|
+
protected _optionsAt(coords: IRange.Coords | null): Omit<IRange.IteratorOptions, 'axis'> & {
|
|
282
|
+
axis?: IRange.Axis;
|
|
283
|
+
};
|
|
284
|
+
/** Whether this range's own options skip anything. */
|
|
285
|
+
protected _hasSkips(): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Iterator options with their skips asked in the GRID's indexes rather than this range's: what
|
|
288
|
+
* the grid's own iterators take. The options themselves when they skip nothing.
|
|
289
|
+
*/
|
|
290
|
+
protected _skipsOnGrid<O extends IRange.IteratorOptions>(options: O): O;
|
|
261
291
|
protected _createBuilder(axis?: IRange.Axis): Tuple.IBuilder;
|
|
262
292
|
/**
|
|
263
293
|
* Writes `region` into `values`: its clears first, unless `fresh` (a grid that stores nothing
|
|
@@ -9,6 +9,11 @@ export declare class RangeStats implements IRangeStats {
|
|
|
9
9
|
protected _iteratorOptions?: IRange.IteratorOptions;
|
|
10
10
|
protected _segmentCache: AggSegmentCache;
|
|
11
11
|
protected _ZoneSizeMinor: number;
|
|
12
|
+
/**
|
|
13
|
+
* The first row and column of the range whose options these are, which its `processRowSkip` /
|
|
14
|
+
* `processColumnSkip` count from; `undefined` when the options skip nothing.
|
|
15
|
+
*/
|
|
16
|
+
protected _skipOrigin: IRange.CellCoords | undefined;
|
|
12
17
|
protected _sortedNumbers: SortedNumbers | undefined;
|
|
13
18
|
protected _aggregates: IRangeStats.Aggregates | undefined;
|
|
14
19
|
protected _typedCounts: Readonly<Record<ScalarType, number>> | undefined;
|
|
@@ -25,7 +30,7 @@ export declare class RangeStats implements IRangeStats {
|
|
|
25
30
|
protected _frequencies: Readonly<IRangeStats.IFrequency> | undefined;
|
|
26
31
|
protected _ranked: readonly Scalar[] | undefined;
|
|
27
32
|
protected _lastNumber: number | null | undefined;
|
|
28
|
-
constructor(runtime: IRuntime, grid: ISparseGrid<Scalar>, range: IRange | null, localCoords?: readonly (IRange.Coords | null)[], options?: IRange.IteratorOptions, segmentCache?: AggSegmentCache, zoneSizeMinor?: number);
|
|
33
|
+
constructor(runtime: IRuntime, grid: ISparseGrid<Scalar>, range: IRange | null, localCoords?: readonly (IRange.Coords | null)[], options?: IRange.IteratorOptions, segmentCache?: AggSegmentCache, zoneSizeMinor?: number, skipOrigin?: IRange.CellCoords);
|
|
29
34
|
/**
|
|
30
35
|
* The values grid this instance measures. Its owner re-points the cache when the map is
|
|
31
36
|
* replaced, which a clone of the map is.
|
|
@@ -40,13 +45,13 @@ export declare class RangeStats implements IRangeStats {
|
|
|
40
45
|
getCoords(): IRange.Coords | null;
|
|
41
46
|
/** @inheritdoc IRangeStats.getSize */
|
|
42
47
|
getSize(): number;
|
|
43
|
-
/** @inheritdoc IRangeStats.getCount */
|
|
44
48
|
/**
|
|
45
49
|
* The instance's one walk (see `_raw`), taken with errors as population — the contract of
|
|
46
50
|
* every consumer that counts. Reused by the aggregate path when the instance's own error
|
|
47
51
|
* policy has no side effect to replay.
|
|
48
52
|
*/
|
|
49
53
|
protected _walk(): AggResults | null;
|
|
54
|
+
/** @inheritdoc IRangeStats.getCount */
|
|
50
55
|
getCount(): number;
|
|
51
56
|
/** @inheritdoc IRangeStats.getAggregates */
|
|
52
57
|
getAggregates(options?: IRange.IteratorOptions): Readonly<IRangeStats.Aggregates>;
|
|
@@ -44,6 +44,8 @@ export declare class ReferenceRange extends Range implements IReferenceRange {
|
|
|
44
44
|
hasError(): boolean;
|
|
45
45
|
/** @inheritdoc IRange.slice */
|
|
46
46
|
slice(coords: Partial<IRange.Coords>): this;
|
|
47
|
+
/** @inheritdoc Range.clone */
|
|
48
|
+
clone(options?: IRange.IteratorOptions, isLiteral?: boolean, isDirectScalar?: boolean): this;
|
|
47
49
|
/**
|
|
48
50
|
* @internal
|
|
49
51
|
* The reference DEMOTED to its values: a plain `Range` over the same grid and coords, with no
|
|
@@ -37,8 +37,52 @@ export type AggResults = {
|
|
|
37
37
|
export type AggSegmentCache = {
|
|
38
38
|
coerce: unknown;
|
|
39
39
|
byRun: WeakMap<IListLike<Scalar>, AggResults[]>;
|
|
40
|
+
/**
|
|
41
|
+
* The segments of a walk that SKIPS cells (`IRange.IteratorOptions.processRowSkip`), by the
|
|
42
|
+
* skip and the origin it counts from: a segment's content then depends on which cells the skip
|
|
43
|
+
* leaves out, and a caller that keeps one skip (the engine's, per hidden set) keeps its zones.
|
|
44
|
+
*/
|
|
45
|
+
bySkip: WeakMap<SkipProcessor, Map<number, WeakMap<IListLike<Scalar>, AggResults[]>>>;
|
|
40
46
|
};
|
|
41
47
|
export declare const createAggSegmentCache: () => AggSegmentCache;
|
|
48
|
+
/** A skip as `IRange.IteratorOptions.processRowSkip` gives one: the index to read at or past `index`. */
|
|
49
|
+
export type SkipProcessor = (index: number, reverse?: boolean) => number;
|
|
50
|
+
/**
|
|
51
|
+
* A skip a walk honors, on one axis of the grid: the range's callback, which counts from the
|
|
52
|
+
* range's origin on that axis, asked with a grid index less that origin.
|
|
53
|
+
*/
|
|
54
|
+
export interface WalkSkip {
|
|
55
|
+
readonly skip: SkipProcessor;
|
|
56
|
+
readonly origin: number;
|
|
57
|
+
}
|
|
58
|
+
/** The skips of a walk, by the grid's axes. */
|
|
59
|
+
export interface WalkSkips {
|
|
60
|
+
/** The skip along the grid's major axis: a run it skips is left out whole. */
|
|
61
|
+
readonly major: WalkSkip | null;
|
|
62
|
+
/** The skip along the grid's minor axis: the cells of a run it skips. */
|
|
63
|
+
readonly minor: WalkSkip | null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The skips `options` ask for, by the grid's axes; `null` when it asks for none.
|
|
67
|
+
*
|
|
68
|
+
* @param origin The range's first row and column on the grid, which its callbacks count from.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveSkips(options: IRange.IteratorOptions | undefined, isColumn: boolean, origin: IRange.CellCoords | undefined): WalkSkips | null;
|
|
71
|
+
/** Whether the skip leaves out the grid index. */
|
|
72
|
+
export declare const isSkipped: (skip: WalkSkip, index: number) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The grid index to read at or past `index` (at or before, when `reverse`): `index` itself when
|
|
75
|
+
* the skip reads it. A walk moves straight to it, so a hidden block costs one call, not one per
|
|
76
|
+
* cell.
|
|
77
|
+
*/
|
|
78
|
+
export declare const nextRead: (skip: WalkSkip, index: number, reverse?: boolean) => number;
|
|
79
|
+
/**
|
|
80
|
+
* How many cells of `coords` a read under `options` takes in: the population blanks are counted
|
|
81
|
+
* from. A skipped cell is outside it, so it is never a blank.
|
|
82
|
+
*
|
|
83
|
+
* @param origin As {@link resolveSkips}.
|
|
84
|
+
*/
|
|
85
|
+
export declare function countReadCells(options: IRange.IteratorOptions | undefined, coords: IRange.Coords, origin: IRange.CellCoords | undefined): number;
|
|
42
86
|
export declare const resolveAggSegmentCache: (grid: ISparseGrid<Scalar>, inherit?: AggSegmentCache) => AggSegmentCache;
|
|
43
87
|
/**
|
|
44
88
|
* The default minor zone size for segment caching.
|
|
@@ -61,13 +105,13 @@ export declare const EmptyAggregates: Readonly<IRangeStats.Aggregates>;
|
|
|
61
105
|
*
|
|
62
106
|
* @remarks
|
|
63
107
|
* Results are built using a segment cache keyed by run identity (`segmentsByRun`).
|
|
64
|
-
* The cache is
|
|
65
|
-
*
|
|
66
|
-
*
|
|
108
|
+
* The cache is grid-scoped (see `resolveAggSegmentCache`), so segment aggregates computed for
|
|
109
|
+
* one coord shape are reused by any other shape over the same grid lineage that overlaps the
|
|
110
|
+
* same run segments.
|
|
67
111
|
*
|
|
68
112
|
* Returns `null` when the grid is empty.
|
|
69
113
|
*/
|
|
70
|
-
export declare function iterateAndCollectStats(runtime: IRuntime, grid: ISparseGrid<Scalar>, range: IRange | null, localCoords: readonly (IRange.Coords | null)[], optionsIterator: IRange.IteratorOptions | undefined, segmentCache: AggSegmentCache, zoneSizeMinor: number): AggResults | null;
|
|
114
|
+
export declare function iterateAndCollectStats(runtime: IRuntime, grid: ISparseGrid<Scalar>, range: IRange | null, localCoords: readonly (IRange.Coords | null)[], optionsIterator: IRange.IteratorOptions | undefined, segmentCache: AggSegmentCache, zoneSizeMinor: number, skipOrigin?: IRange.CellCoords): AggResults | null;
|
|
71
115
|
/**
|
|
72
116
|
* The value Excel added LAST — the final numeric member in ROW-major order, which is the
|
|
73
117
|
* traversal Excel's accumulators use (measured: `probe-sum-cancel-order.ps1`, two mirrored 2-D
|
|
@@ -87,7 +131,7 @@ export declare function iterateAndCollectStats(runtime: IRuntime, grid: ISparseG
|
|
|
87
131
|
* `(row, col)` is used rather than reverse iteration because the grid's run iterator has no
|
|
88
132
|
* reverse, and this way the result is independent of the grid's axis.
|
|
89
133
|
*/
|
|
90
|
-
export declare function findLastNumber(runtime: IRuntime, grid: ISparseGrid<Scalar>, range: IRange | null, localCoords: readonly (IRange.Coords | null)[], optionsIterator: IRange.IteratorOptions | undefined): number | undefined;
|
|
134
|
+
export declare function findLastNumber(runtime: IRuntime, grid: ISparseGrid<Scalar>, range: IRange | null, localCoords: readonly (IRange.Coords | null)[], optionsIterator: IRange.IteratorOptions | undefined, skipOrigin?: IRange.CellCoords): number | undefined;
|
|
91
135
|
/**
|
|
92
136
|
* Resolves an iterator's `coerce` option into the callable pair the scans use.
|
|
93
137
|
*
|
|
@@ -106,14 +150,4 @@ export declare function resolveCoerce(runtime: IRuntime, optionsIterator: IRange
|
|
|
106
150
|
* Computes derived fields (average, variance, stdDev) and normalizes missing-number fields to null.
|
|
107
151
|
*/
|
|
108
152
|
export declare function buildAggregates(raw: AggResults | null): Readonly<IRangeStats.Aggregates>;
|
|
109
|
-
/**
|
|
110
|
-
* Calculates an optimal zone size for a given grid minor dimension.
|
|
111
|
-
*
|
|
112
|
-
* @remarks
|
|
113
|
-
* Strategy: target ~128 segments per full column/row to balance cache granularity
|
|
114
|
-
* (smaller = better reuse for small queries) vs. iteration overhead (fewer = faster
|
|
115
|
-
* full-column scans). Result is rounded up to the nearest power of 2 and clamped to
|
|
116
|
-
* [256, 16384].
|
|
117
|
-
*/
|
|
118
|
-
export declare function calculateZoneSize(maxMinorDimension: number): number;
|
|
119
153
|
//# sourceMappingURL=AggregateStats.d.ts.map
|
|
@@ -79,7 +79,7 @@ export declare class FrequencyStats implements IRangeStats.IFrequency {
|
|
|
79
79
|
* (a custom `filterFn` restricts the population in a way nothing else already counts) and the
|
|
80
80
|
* scan's own `visitedCount` is used — exact when not truncated, an undercount when truncated.
|
|
81
81
|
*/
|
|
82
|
-
static fromGrid(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined, options: IRangeStats.GetFrequenciesOptions | undefined, defaultCompareFn: (a: Scalar, b: Scalar) => number, blankCount: number, totalCount: number | undefined): FrequencyStats;
|
|
82
|
+
static fromGrid(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined, options: IRangeStats.GetFrequenciesOptions | undefined, defaultCompareFn: (a: Scalar, b: Scalar) => number, blankCount: number, totalCount: number | undefined, skipOrigin?: IRange.CellCoords): FrequencyStats;
|
|
83
83
|
/**
|
|
84
84
|
* Builds an instance directly from an already-merged group map — used by
|
|
85
85
|
* {@link CompositeRangeStats}, which merges its children's own (already-scanned) frequencies
|
|
@@ -10,7 +10,7 @@ import { ISparseGrid } from '../../collections';
|
|
|
10
10
|
* `includeBlanks` is handled separately: one synthetic `null` candidate is offered per blank
|
|
11
11
|
* cell, capped at `limit` offers (any beyond that can never displace a kept member).
|
|
12
12
|
*/
|
|
13
|
-
export declare function collectRanked(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined, options: IRangeStats.GetRankedOptions | undefined, defaultCompareFn: (a: Scalar, b: Scalar) => number): readonly Scalar[];
|
|
13
|
+
export declare function collectRanked(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined, options: IRangeStats.GetRankedOptions | undefined, defaultCompareFn: (a: Scalar, b: Scalar) => number, skipOrigin?: IRange.CellCoords): readonly Scalar[];
|
|
14
14
|
/**
|
|
15
15
|
* Merges each child's own top-`limit` into the composite's true top-`limit`.
|
|
16
16
|
*
|
|
@@ -22,7 +22,7 @@ export declare class SortedNumbers implements IRangeStats.ISortedNumbers {
|
|
|
22
22
|
* Collects the numeric values within `localCoords` from the grid and returns an instance
|
|
23
23
|
* over them (sorted ascending).
|
|
24
24
|
*/
|
|
25
|
-
static fromGrid(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined): SortedNumbers;
|
|
25
|
+
static fromGrid(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined, skipOrigin?: IRange.CellCoords): SortedNumbers;
|
|
26
26
|
/** @inheritdoc IRangeStats.ISortedNumbers.getLarge */
|
|
27
27
|
getLarge(k: number): number | null;
|
|
28
28
|
/** @inheritdoc IRangeStats.ISortedNumbers.getSmall */
|
|
@@ -45,6 +45,6 @@ export declare class SortedNumbers implements IRangeStats.ISortedNumbers {
|
|
|
45
45
|
* Collects all numeric values from the range coords and returns them sorted ascending.
|
|
46
46
|
* Called at most once per instance lifetime (result is cached on `_sortedNumbers`).
|
|
47
47
|
*/
|
|
48
|
-
protected static _collectNumbers(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined): readonly number[];
|
|
48
|
+
protected static _collectNumbers(grid: ISparseGrid, localCoords: readonly (IRange.Coords | null)[], iteratorOptions: IRange.IteratorOptions | undefined, skipOrigin?: IRange.CellCoords): readonly number[];
|
|
49
49
|
}
|
|
50
50
|
//# sourceMappingURL=SortedNumbers.d.ts.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Point, Rectangle } from '@sheetxl/utils';
|
|
2
2
|
import { IListener } from '../listener';
|
|
3
|
+
import { ITransaction } from '../transaction';
|
|
3
4
|
import { IResource } from '../resource';
|
|
4
5
|
import { IModel } from '../model';
|
|
6
|
+
import { IMovable } from '../movable';
|
|
5
7
|
import { IHyperlink } from '../hyperlink';
|
|
6
8
|
import { IFill } from '../fill';
|
|
7
9
|
import { IStroke } from '../fill/IStroke';
|
|
@@ -17,16 +19,16 @@ import { ITextFrame } from '../text/ITextFrame';
|
|
|
17
19
|
* Reading only: a shape's preset and its text. An imported shape is otherwise kept as the source
|
|
18
20
|
* wrote it and saved back unchanged.
|
|
19
21
|
*/
|
|
20
|
-
export interface IShape extends IModel {
|
|
22
|
+
export interface IShape extends IModel, IMovable.IContent {
|
|
21
23
|
toJSON(toResourceId?: (resource: IResource) => number | null): IShape.JSON | null;
|
|
22
24
|
/**
|
|
23
25
|
* Returns the name of the shape.
|
|
24
26
|
*/
|
|
25
|
-
getName(): string;
|
|
27
|
+
getName(): string | null;
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* Deletes the shape, and with it the movable that places it.
|
|
28
30
|
*/
|
|
29
|
-
|
|
31
|
+
delete(options?: ITransaction.OperationOptions): void;
|
|
30
32
|
/**
|
|
31
33
|
* Returns the kind of shape this is: its preset geometry.
|
|
32
34
|
*
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { IResource, IResourceCollection } from '../resource';
|
|
2
|
-
import {
|
|
2
|
+
import { AbstractMovableContent } from '../movable/AbstractMovableContent';
|
|
3
3
|
import { ITextFrame } from '../text/ITextFrame';
|
|
4
4
|
import { IShape } from './IShape';
|
|
5
|
-
interface State extends
|
|
5
|
+
interface State extends AbstractMovableContent.State {
|
|
6
6
|
data?: any;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Implementation for {@link IShape}.
|
|
10
10
|
*/
|
|
11
|
-
export declare class Shape extends
|
|
11
|
+
export declare class Shape extends AbstractMovableContent<State, IShape.JSON> implements IShape {
|
|
12
12
|
/** The state `_facts` was read from; a new state object is a new read. */
|
|
13
13
|
private _factsSource;
|
|
14
14
|
private _facts;
|
|
15
15
|
constructor(options: Shape.ConstructorOptions);
|
|
16
16
|
/** {@inheritDoc IModel.getType} */
|
|
17
17
|
getType(): string;
|
|
18
|
-
/** {@inheritDoc IShape.getName} */
|
|
19
|
-
getName(): string;
|
|
20
|
-
/** {@inheritDoc Movable.Content.getDescription} */
|
|
21
|
-
getDescription(): string;
|
|
22
18
|
/** {@inheritDoc IShape.getShapeType} */
|
|
23
19
|
getShapeType(): string;
|
|
24
20
|
/** {@inheritDoc IShape.getTextFrame} */
|
|
@@ -27,7 +23,7 @@ export declare class Shape extends AbstractModel<State, IShape.JSON> implements
|
|
|
27
23
|
private _getFacts;
|
|
28
24
|
/** {@inheritDoc Movable.Content.toJSON} */
|
|
29
25
|
toJSON(_toResourceId?: (resource: IResource) => number | null): IShape.JSON | null;
|
|
30
|
-
/** {@inheritDoc
|
|
26
|
+
/** {@inheritDoc IMovable.IContent.getTypeDescription} */
|
|
31
27
|
getTypeDescription(): string;
|
|
32
28
|
get [Symbol.toStringTag](): string;
|
|
33
29
|
toString(): string;
|
|
@@ -44,7 +40,7 @@ export declare namespace Shape {
|
|
|
44
40
|
/**
|
|
45
41
|
* Options for creating a shape.
|
|
46
42
|
*/
|
|
47
|
-
interface ConstructorOptions extends
|
|
43
|
+
interface ConstructorOptions extends AbstractMovableContent.ConstructorOptions<IShape.JSON> {
|
|
48
44
|
/**
|
|
49
45
|
* Returns an IResource from the resourceId or null if not found.
|
|
50
46
|
*/
|
|
@@ -57,7 +53,6 @@ export declare namespace Shape {
|
|
|
57
53
|
* Allow for the default lock aspect ratio to be overwritten.
|
|
58
54
|
*/
|
|
59
55
|
defaultLockAspectRatio?: boolean;
|
|
60
|
-
getName(): string;
|
|
61
56
|
}
|
|
62
57
|
}
|
|
63
58
|
export {};
|
|
@@ -369,14 +369,15 @@ export interface ISheet extends ITransaction.ITransactional, IListener.ISource<I
|
|
|
369
369
|
*
|
|
370
370
|
* @param update Cell Update
|
|
371
371
|
* @param coords Optional CellCoord
|
|
372
|
+
* @param options How the update is read. See {@link ICell.CreateCellOptions}.
|
|
372
373
|
* @returns A detached ICell
|
|
373
374
|
*
|
|
374
375
|
* @remarks
|
|
375
|
-
* * Useful for previewing values such as tooltip.
|
|
376
|
+
* * Useful for previewing values such as tooltip, or what typed text would be entered as.
|
|
376
377
|
* * Does not add to the sheet but provides a standalone ICell.
|
|
377
378
|
* * If the coords are passed it will return disconnect cell update for that value.
|
|
378
379
|
*/
|
|
379
|
-
createCell(update: ICell.Update, coords?: IRange.FixableCellCoords): ICell;
|
|
380
|
+
createCell(update: ICell.Update, coords?: IRange.FixableCellCoords, options?: ICell.CreateCellOptions): ICell;
|
|
380
381
|
/**
|
|
381
382
|
* Parses a formula expression and returns a *transient* formula object anchored to this sheet.
|
|
382
383
|
*
|