@sheetxl/sdk 0.8.0-beta.7 → 0.8.0-beta.9
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/BAtZ8a7H7zsRvWqe.cjs +90 -0
- package/browser/cjs/CQPMWBxBUmkORmxV.cjs +1 -0
- package/browser/cjs/{E08wpSuqr-UadjSZ.cjs → CvQ1tIq7wZ7HIGPq.cjs} +1 -1
- package/browser/cjs/CwvGOe42j8KpAF0v.cjs +1 -0
- package/browser/cjs/{O6F5xVsoF2hTiprv.cjs → DCOqoH-T4Ux_1dQj.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{tBEZ_r7Bkp7CrFLF.mjs → BdHD3v-u8irI1XhZ.mjs} +2 -2
- package/browser/esm/{bSQdR4WlmM40WWFR.mjs → C8btlUQcQwNyzHY3.mjs} +2 -2
- package/browser/esm/{B7v0PdbyuBlceMLG.mjs → CF3VfWX7bJu8kO_Z.mjs} +2 -2
- package/browser/esm/{BADV_AABAw-3U9iO.mjs → D3ll0ybMQOP4uPyW.mjs} +1 -1
- package/browser/esm/{DRpWwH6CWI0QaNlp.mjs → DXmFrSnh3xSBfoD7.mjs} +8146 -7694
- package/browser/esm/{CFDfAmU2o5HFRTu4.mjs → DzgIc4oyekwA-fkl.mjs} +96 -96
- package/browser/esm/{DkHfJEJlvjDJnXEU.mjs → Iw280tlGmTHKDqzd.mjs} +2 -2
- package/browser/esm/index.mjs +919 -593
- package/node/esm/{CWJELJxqO-1z0tJU.mjs → B_FOXd5PSfVcg0ED.mjs} +1 -1
- package/node/esm/{HMR0po5avaUU1XUZ.mjs → BzgnLKSVfN-mrMSW.mjs} +1 -1
- package/node/esm/{BShIHUY7pxerJVT8.mjs → D4PsEIRHxAahp5kn.mjs} +1 -1
- package/node/esm/{DbAKZ-Ythj1VwgyS.mjs → dinqlP3jU8gDOjso.mjs} +1 -1
- package/node/esm/index.mjs +11373 -10575
- package/package.json +7 -6
- package/resources/locales/de/model.msg.json +19 -0
- package/resources/locales/en/model.msg.json +25 -0
- package/types/scripting-api.json +6847 -6401
- package/types/scripting-enums.json +101 -21
- package/types/scripting.d.ts +1949 -457
- package/types/src/calculation/Calculation.d.ts +37 -45
- package/types/src/calculation/grid/CalcGrid.d.ts +12 -4
- package/types/src/calculation/grid/CalcGridBackend.d.ts +0 -6
- package/types/src/calculation/grid/CalcGridProxy.d.ts +1 -6
- package/types/src/calculation/grid/ICalcGrid.d.ts +12 -4
- package/types/src/calculation/grid/_CalcRequest.d.ts +4 -9
- package/types/src/cell/ICell.d.ts +3 -3
- package/types/src/cell/ICellHeader.d.ts +24 -2
- package/types/src/cellRange/ICellRange.d.ts +67 -3
- package/types/src/cellRange/ICellRanges.d.ts +12 -12
- package/types/src/chart/Chart.d.ts +2 -13
- package/types/src/condition/AnchoredConditional.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/ColorOperator.d.ts +4 -0
- package/types/src/condition/BuiltInOperators/IconOperator.d.ts +4 -0
- package/types/src/condition/ICondition.d.ts +36 -28
- package/types/src/condition/_ConditionUtils.d.ts +32 -8
- package/types/src/fill/IFill.d.ts +46 -11
- package/types/src/fill/IStroke.d.ts +34 -42
- package/types/src/filter/IFilter.d.ts +51 -6
- package/types/src/hyperlink/IHyperlink.d.ts +8 -0
- package/types/src/index.d.ts +1 -0
- package/types/src/movable/AbstractMovableContent.d.ts +6 -0
- package/types/src/movable/FormControl.d.ts +206 -0
- package/types/src/movable/IFormControl.d.ts +424 -0
- package/types/src/movable/IMovable.d.ts +37 -8
- package/types/src/movable/IMovableCollection.d.ts +19 -1
- package/types/src/movable/Movable.d.ts +20 -0
- package/types/src/movable/MovableContentRegistry.d.ts +64 -0
- package/types/src/movable/_BuiltInContents.d.ts +2 -0
- package/types/src/movable/_DrawnBounds.d.ts +33 -0
- package/types/src/movable/_RotatedFrame.d.ts +20 -0
- package/types/src/movable/index.d.ts +6 -4
- package/types/src/numFmt/BuiltInFormats.d.ts +5 -0
- package/types/src/numFmt/_NumFmtUtils.d.ts +0 -1
- package/types/src/numFmt/vendor/numfmt/_sheetxl.d.ts +6 -0
- package/types/src/outline/IOutline.d.ts +186 -0
- package/types/src/outline/Outline.d.ts +157 -0
- package/types/src/outline/index.d.ts +2 -0
- package/types/src/shape/GeometryPreset.d.ts +197 -0
- package/types/src/shape/IGeometry.d.ts +398 -0
- package/types/src/shape/IShape.d.ts +177 -204
- package/types/src/shape/Shape.d.ts +39 -13
- package/types/src/shape/ShapeStyleUtils.d.ts +48 -0
- package/types/src/shape/_Geometry.d.ts +14 -0
- package/types/src/shape/_GeometryLoader.d.ts +21 -0
- package/types/src/shape/_builtIn/_BuiltInChunks.d.ts +10 -0
- package/types/src/shape/_builtIn/_BuiltInDef.d.ts +9 -0
- package/types/src/shape/_builtIn/arrows.d.ts +6 -0
- package/types/src/shape/_builtIn/basic.d.ts +6 -0
- package/types/src/shape/_builtIn/callouts.d.ts +6 -0
- package/types/src/shape/_builtIn/flowchart.d.ts +6 -0
- package/types/src/shape/_builtIn/lines.d.ts +6 -0
- package/types/src/shape/_builtIn/math.d.ts +6 -0
- package/types/src/shape/_builtIn/other.d.ts +6 -0
- package/types/src/shape/_builtIn/rectangles.d.ts +6 -0
- package/types/src/shape/_builtIn/starsBanners.d.ts +6 -0
- package/types/src/shape/geometry/_strokeEnds.d.ts +7 -0
- package/types/src/shape/geometry/format.d.ts +3 -0
- package/types/src/shape/geometry/geometry.d.ts +84 -0
- package/types/src/shape/geometry/guides.d.ts +54 -0
- package/types/src/shape/geometry/handles.d.ts +14 -0
- package/types/src/shape/geometry/index.d.ts +7 -0
- package/types/src/shape/geometry/lineEnds.d.ts +53 -0
- package/types/src/shape/geometry/paths.d.ts +35 -0
- package/types/src/shape/geometry/segments.d.ts +114 -0
- package/types/src/shape/index.d.ts +2 -0
- package/types/src/sheet/ISheet.d.ts +10 -45
- package/types/src/sheet/Sheet.d.ts +19 -5
- package/types/src/sheet/SheetRange.d.ts +16 -1
- package/types/src/sheet/_SheetUtils.d.ts +10 -2
- package/types/src/sheetHeader/ISheetHeader.d.ts +4 -0
- package/types/src/sheetHeader/SheetCellHeader.d.ts +4 -0
- package/types/src/sheetHeader/SheetHeader.d.ts +10 -0
- package/types/src/sheetHeader/_HeaderUtils.d.ts +3 -1
- package/types/src/sheetView/ISheetView.d.ts +17 -0
- package/types/src/sheetView/SheetView.d.ts +4 -0
- package/types/src/table/AnchoredTable.d.ts +7 -2
- package/types/src/text/IText.d.ts +182 -0
- package/types/src/text/ITextFrame.d.ts +85 -0
- package/types/src/text/TextRotation.d.ts +3 -3
- package/types/src/text/TextStacked.d.ts +2 -2
- package/types/src/theme/ITheme.d.ts +24 -0
- package/types/src/workbook/Workbook.d.ts +16 -5
- package/browser/cjs/CrcmEew-dr51xpf9.cjs +0 -1
- package/browser/cjs/CwzIjMpnMKeypivl.cjs +0 -1
- package/browser/cjs/D3Vlh9UOBKtvlXBL.cjs +0 -93
- package/types/src/movable/Control.d.ts +0 -55
- package/types/src/movable/IControl.d.ts +0 -86
- package/types/src/movable/IGroup.d.ts +0 -30
- package/types/src/shape/_ShapeXml.d.ts +0 -28
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { ITransaction } from '../transaction';
|
|
2
|
+
import { IResource } from '../resource';
|
|
3
|
+
import { IFormControl, ICaptioned, ILinked, IButton, ICheckBox, IOptionButton, IGroupBox, ILabel, IRangedControl, IScrollBar, ISpinner, IListControl, IListBox, IDropDown } from './IFormControl';
|
|
4
|
+
import { AbstractMovableContent } from './AbstractMovableContent';
|
|
5
|
+
interface State<J extends IFormControl.JSON> extends AbstractMovableContent.State {
|
|
6
|
+
data?: J;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Implementation for {@link IFormControl}: what every kind shares. On its own it is the kinds with
|
|
10
|
+
* nothing of their own (edit box, dialog, and a kind this version does not know), told apart by
|
|
11
|
+
* the type they are created with.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FormControl<J extends IFormControl.JSON = IFormControl.JSON> extends AbstractMovableContent<State<J>, J> implements IFormControl {
|
|
14
|
+
private readonly _type;
|
|
15
|
+
private readonly _typeDescription;
|
|
16
|
+
constructor(options: FormControl.ConstructorOptions<J>);
|
|
17
|
+
/** {@inheritDoc IModel.getType} */
|
|
18
|
+
getType(): string;
|
|
19
|
+
/** {@inheritDoc IMovable.IContent.getTypeDescription} */
|
|
20
|
+
getTypeDescription(): string;
|
|
21
|
+
/** {@inheritDoc IFormControl.getShapeId} */
|
|
22
|
+
getShapeId(): number | null;
|
|
23
|
+
/** {@inheritDoc IFormControl.getMacro} */
|
|
24
|
+
getMacro(): string | null;
|
|
25
|
+
/** {@inheritDoc IFormControl.setMacro} */
|
|
26
|
+
setMacro(macro: string | null, options?: ITransaction.OperationOptions): this;
|
|
27
|
+
/** {@inheritDoc Movable.Content.toJSON} */
|
|
28
|
+
toJSON(_toResourceId?: (resource: IResource) => number | null): J | null;
|
|
29
|
+
/** {@inheritDoc IFormControl.isIFormControl} */
|
|
30
|
+
get isIFormControl(): true;
|
|
31
|
+
protected _data(): J | null;
|
|
32
|
+
/**
|
|
33
|
+
* Writes fields into the control's data as one operation. A field set to `undefined` is
|
|
34
|
+
* removed, so the JSON only ever says what differs from the default.
|
|
35
|
+
*/
|
|
36
|
+
protected _set(fields: Partial<J>, message: string, options?: ITransaction.OperationOptions): this;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The kinds that show text ({@link ICaptioned}): a button, a group box, a label.
|
|
40
|
+
*/
|
|
41
|
+
export declare abstract class CaptionedControl<J extends IFormControl.JSON & ICaptioned.JSON> extends FormControl<J> implements ICaptioned {
|
|
42
|
+
/** {@inheritDoc ICaptioned.getCaption} */
|
|
43
|
+
getCaption(): string | null;
|
|
44
|
+
/** {@inheritDoc ICaptioned.setCaption} */
|
|
45
|
+
setCaption(caption: string | null, options?: ITransaction.OperationOptions): this;
|
|
46
|
+
/** {@inheritDoc ICaptioned.getFont} */
|
|
47
|
+
getFont(): ICaptioned.Font | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The kinds a cell mirrors ({@link ILinked}) that show no text: scroll bars, spinners, lists.
|
|
51
|
+
*/
|
|
52
|
+
export declare abstract class LinkedControl<J extends IFormControl.JSON & ILinked.JSON> extends FormControl<J> implements ILinked {
|
|
53
|
+
/** {@inheritDoc ILinked.getLinkedCell} */
|
|
54
|
+
getLinkedCell(): string | null;
|
|
55
|
+
/** {@inheritDoc ILinked.setLinkedCell} */
|
|
56
|
+
setLinkedCell(address: string | null, options?: ITransaction.OperationOptions): this;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The kinds that both show text and are mirrored by a cell: a check box, an option button.
|
|
60
|
+
*/
|
|
61
|
+
export declare abstract class CaptionedLinkedControl<J extends IFormControl.JSON & ICaptioned.JSON & ILinked.JSON> extends CaptionedControl<J> implements ILinked {
|
|
62
|
+
/** {@inheritDoc ILinked.getLinkedCell} */
|
|
63
|
+
getLinkedCell(): string | null;
|
|
64
|
+
/** {@inheritDoc ILinked.setLinkedCell} */
|
|
65
|
+
setLinkedCell(address: string | null, options?: ITransaction.OperationOptions): this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Implementation for {@link IButton}.
|
|
69
|
+
*/
|
|
70
|
+
export declare class Button extends CaptionedControl<IButton.JSON> implements IButton {
|
|
71
|
+
constructor(options: FormControl.KindOptions<IButton.JSON>);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Implementation for {@link IGroupBox}.
|
|
75
|
+
*/
|
|
76
|
+
export declare class GroupBox extends CaptionedControl<IGroupBox.JSON> implements IGroupBox {
|
|
77
|
+
constructor(options: FormControl.KindOptions<IGroupBox.JSON>);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Implementation for {@link ILabel}.
|
|
81
|
+
*/
|
|
82
|
+
export declare class Label extends CaptionedControl<ILabel.JSON> implements ILabel {
|
|
83
|
+
constructor(options: FormControl.KindOptions<ILabel.JSON>);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Implementation for {@link ICheckBox}.
|
|
87
|
+
*/
|
|
88
|
+
export declare class CheckBox extends CaptionedLinkedControl<ICheckBox.JSON> implements ICheckBox {
|
|
89
|
+
constructor(options: FormControl.KindOptions<ICheckBox.JSON>);
|
|
90
|
+
/** {@inheritDoc ICheckBox.isChecked} */
|
|
91
|
+
isChecked(): boolean;
|
|
92
|
+
/** {@inheritDoc ICheckBox.setChecked} */
|
|
93
|
+
setChecked(checked: boolean, options?: ITransaction.OperationOptions): this;
|
|
94
|
+
/** {@inheritDoc ICheckBox.isMixed} */
|
|
95
|
+
isMixed(): boolean;
|
|
96
|
+
/** {@inheritDoc ICheckBox.setMixed} */
|
|
97
|
+
setMixed(mixed: boolean, options?: ITransaction.OperationOptions): this;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Implementation for {@link IOptionButton}.
|
|
101
|
+
*/
|
|
102
|
+
export declare class OptionButton extends CaptionedLinkedControl<IOptionButton.JSON> implements IOptionButton {
|
|
103
|
+
constructor(options: FormControl.KindOptions<IOptionButton.JSON>);
|
|
104
|
+
/** {@inheritDoc IOptionButton.isChecked} */
|
|
105
|
+
isChecked(): boolean;
|
|
106
|
+
/** {@inheritDoc IOptionButton.setChecked} */
|
|
107
|
+
setChecked(checked: boolean, options?: ITransaction.OperationOptions): this;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* What {@link ScrollBar} and {@link Spinner} share.
|
|
111
|
+
*/
|
|
112
|
+
export declare abstract class RangedControl<J extends IRangedControl.JSON> extends LinkedControl<J> implements IRangedControl {
|
|
113
|
+
/** {@inheritDoc IRangedControl.getValue} */
|
|
114
|
+
getValue(): number | null;
|
|
115
|
+
/** {@inheritDoc IRangedControl.setValue} */
|
|
116
|
+
setValue(value: number | null, options?: ITransaction.OperationOptions): this;
|
|
117
|
+
/** {@inheritDoc IRangedControl.getMin} */
|
|
118
|
+
getMin(): number | null;
|
|
119
|
+
/** {@inheritDoc IRangedControl.setMin} */
|
|
120
|
+
setMin(min: number | null, options?: ITransaction.OperationOptions): this;
|
|
121
|
+
/** {@inheritDoc IRangedControl.getMax} */
|
|
122
|
+
getMax(): number | null;
|
|
123
|
+
/** {@inheritDoc IRangedControl.setMax} */
|
|
124
|
+
setMax(max: number | null, options?: ITransaction.OperationOptions): this;
|
|
125
|
+
/** {@inheritDoc IRangedControl.getIncrement} */
|
|
126
|
+
getIncrement(): number | null;
|
|
127
|
+
/** {@inheritDoc IRangedControl.setIncrement} */
|
|
128
|
+
setIncrement(increment: number | null, options?: ITransaction.OperationOptions): this;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Implementation for {@link IScrollBar}.
|
|
132
|
+
*/
|
|
133
|
+
export declare class ScrollBar extends RangedControl<IScrollBar.JSON> implements IScrollBar {
|
|
134
|
+
constructor(options: FormControl.KindOptions<IScrollBar.JSON>);
|
|
135
|
+
/** {@inheritDoc IScrollBar.getPageIncrement} */
|
|
136
|
+
getPageIncrement(): number | null;
|
|
137
|
+
/** {@inheritDoc IScrollBar.setPageIncrement} */
|
|
138
|
+
setPageIncrement(increment: number | null, options?: ITransaction.OperationOptions): this;
|
|
139
|
+
/** {@inheritDoc IScrollBar.isHorizontal} */
|
|
140
|
+
isHorizontal(): boolean;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Implementation for {@link ISpinner}.
|
|
144
|
+
*/
|
|
145
|
+
export declare class Spinner extends RangedControl<ISpinner.JSON> implements ISpinner {
|
|
146
|
+
constructor(options: FormControl.KindOptions<ISpinner.JSON>);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* What {@link ListBox} and {@link DropDown} share.
|
|
150
|
+
*/
|
|
151
|
+
export declare abstract class ListControl<J extends IListControl.JSON> extends LinkedControl<J> implements IListControl {
|
|
152
|
+
/** {@inheritDoc IListControl.getItems} */
|
|
153
|
+
getItems(): readonly string[];
|
|
154
|
+
/** {@inheritDoc IListControl.setItems} */
|
|
155
|
+
setItems(items: readonly string[], options?: ITransaction.OperationOptions): this;
|
|
156
|
+
/** {@inheritDoc IListControl.getListFillRange} */
|
|
157
|
+
getListFillRange(): string | null;
|
|
158
|
+
/** {@inheritDoc IListControl.setListFillRange} */
|
|
159
|
+
setListFillRange(address: string | null, options?: ITransaction.OperationOptions): this;
|
|
160
|
+
/** {@inheritDoc IListControl.getSelectedIndex} */
|
|
161
|
+
getSelectedIndex(): number | null;
|
|
162
|
+
/** {@inheritDoc IListControl.setSelectedIndex} */
|
|
163
|
+
setSelectedIndex(index: number | null, options?: ITransaction.OperationOptions): this;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Implementation for {@link IListBox}.
|
|
167
|
+
*/
|
|
168
|
+
export declare class ListBox extends ListControl<IListBox.JSON> implements IListBox {
|
|
169
|
+
constructor(options: FormControl.KindOptions<IListBox.JSON>);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Implementation for {@link IDropDown}.
|
|
173
|
+
*/
|
|
174
|
+
export declare class DropDown extends ListControl<IDropDown.JSON> implements IDropDown {
|
|
175
|
+
constructor(options: FormControl.KindOptions<IDropDown.JSON>);
|
|
176
|
+
/** {@inheritDoc IDropDown.getDropStyle} */
|
|
177
|
+
getDropStyle(): IDropDown.DropStyle | null;
|
|
178
|
+
/** {@inheritDoc IDropDown.getDropLines} */
|
|
179
|
+
getDropLines(): number | null;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Interfaces for creating form controls.
|
|
183
|
+
*
|
|
184
|
+
* @see
|
|
185
|
+
* ### **Interface**
|
|
186
|
+
*
|
|
187
|
+
* {@link FormControl}
|
|
188
|
+
*/
|
|
189
|
+
export declare namespace FormControl {
|
|
190
|
+
/**
|
|
191
|
+
* Options for creating a kind of form control, which knows its own type.
|
|
192
|
+
*/
|
|
193
|
+
interface KindOptions<J extends IFormControl.JSON> extends AbstractMovableContent.ConstructorOptions<J> {
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Options for creating a form control of a kind with nothing of its own.
|
|
197
|
+
*/
|
|
198
|
+
interface ConstructorOptions<J extends IFormControl.JSON> extends KindOptions<J> {
|
|
199
|
+
/** The content type ({@link IFormControl.Type}). */
|
|
200
|
+
type: string;
|
|
201
|
+
/** What the kind is called to a person: `Edit Box`. */
|
|
202
|
+
typeDescription?: string;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
export {};
|
|
206
|
+
//# sourceMappingURL=FormControl.d.ts.map
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { IListener } from '../listener';
|
|
2
|
+
import { ITransaction } from '../transaction';
|
|
3
|
+
import { IResource } from '../resource';
|
|
4
|
+
import { IModel } from '../model';
|
|
5
|
+
import { IMovable } from './IMovable';
|
|
6
|
+
/**
|
|
7
|
+
* What every form control shares — a button, a check box, a scroll bar placed on a sheet.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* A form control is a movable whose content is one of Excel's legacy controls: the movable places
|
|
11
|
+
* it and the content models what it is. Each kind is its own content type
|
|
12
|
+
* ({@link IFormControl.Type}) and its own interface, composed from this and two facets: the kinds
|
|
13
|
+
* that show text ({@link ICaptioned}) and the kinds that hold a value a cell can mirror
|
|
14
|
+
* ({@link ILinked}). A control owns its state — a check box with no linked cell is still checked
|
|
15
|
+
* or not.
|
|
16
|
+
*
|
|
17
|
+
* **PLACEHOLDER** - This is under development and not made public yet.
|
|
18
|
+
*/
|
|
19
|
+
export interface IFormControl extends IModel, IMovable.IContent {
|
|
20
|
+
/**
|
|
21
|
+
* Returns the id of the shape that draws this control, or `null` if it has none.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* The link to the shape in the sheet's legacy drawing, which is what keeps the two over the same
|
|
25
|
+
* cells when rows and columns move.
|
|
26
|
+
*/
|
|
27
|
+
getShapeId(): number | null;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the name of the macro the control runs when used, or `null` if it has none.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Any kind may run one: a button when clicked, a check box when toggled, a scroll bar when moved.
|
|
33
|
+
*/
|
|
34
|
+
getMacro(): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the name of the macro the control runs when used.
|
|
37
|
+
*
|
|
38
|
+
* @param macro The name, or `null` for none.
|
|
39
|
+
*/
|
|
40
|
+
setMacro(macro: string | null, options?: ITransaction.OperationOptions): this;
|
|
41
|
+
toJSON(toResourceId?: (resource: IResource) => number | null): IFormControl.JSON | null;
|
|
42
|
+
/**
|
|
43
|
+
* Deletes the control, and with it the movable that places it.
|
|
44
|
+
*/
|
|
45
|
+
delete(options?: ITransaction.OperationOptions): void;
|
|
46
|
+
/** For runtime type checking. */
|
|
47
|
+
readonly isIFormControl: true;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* {@inheritDoc IFormControl}
|
|
51
|
+
* @see
|
|
52
|
+
* ### **Interface**
|
|
53
|
+
*
|
|
54
|
+
* {@link IFormControl}
|
|
55
|
+
*/
|
|
56
|
+
export declare namespace IFormControl {
|
|
57
|
+
/**
|
|
58
|
+
* The kinds of form control, which are the content types a movable reports for them.
|
|
59
|
+
*/
|
|
60
|
+
const Type: {
|
|
61
|
+
/** {@link IButton}: runs its macro when clicked. */
|
|
62
|
+
readonly Button: "button";
|
|
63
|
+
/** {@link ICheckBox}: on, off or mixed; writes a boolean to its linked cell. */
|
|
64
|
+
readonly CheckBox: "checkBox";
|
|
65
|
+
/** {@link IOptionButton}: one of a group; the group's linked cell holds the chosen index. */
|
|
66
|
+
readonly OptionButton: "optionButton";
|
|
67
|
+
/** {@link IListBox}: a list of items; writes the index of the chosen one. */
|
|
68
|
+
readonly ListBox: "listBox";
|
|
69
|
+
/** {@link IDropDown}: a list that drops down; writes the index of the chosen one. */
|
|
70
|
+
readonly DropDown: "dropDown";
|
|
71
|
+
/** {@link IScrollBar}: a thumb in a trough; writes a number. */
|
|
72
|
+
readonly ScrollBar: "scrollBar";
|
|
73
|
+
/** {@link ISpinner}: two arrows; writes a number. */
|
|
74
|
+
readonly Spinner: "spinner";
|
|
75
|
+
/** {@link IGroupBox}: a frame around other controls. */
|
|
76
|
+
readonly GroupBox: "groupBox";
|
|
77
|
+
/** {@link ILabel}: text, nothing more. */
|
|
78
|
+
readonly Label: "label";
|
|
79
|
+
/** A text field. Dialog sheets only. {@link IFormControl} only. */
|
|
80
|
+
readonly EditBox: "editBox";
|
|
81
|
+
/** A dialog frame. Dialog sheets only. {@link IFormControl} only. */
|
|
82
|
+
readonly Dialog: "dialog";
|
|
83
|
+
/** A kind this version does not know. {@link IFormControl} only. */
|
|
84
|
+
readonly Unknown: "formControl";
|
|
85
|
+
};
|
|
86
|
+
type Type = typeof Type[keyof typeof Type];
|
|
87
|
+
/**
|
|
88
|
+
* What every kind saves. Each facet and each kind adds its own fields.
|
|
89
|
+
*/
|
|
90
|
+
interface JSON {
|
|
91
|
+
/**
|
|
92
|
+
* The id of the shape that draws this control.
|
|
93
|
+
*
|
|
94
|
+
* @see {@link IFormControl.getShapeId}
|
|
95
|
+
*/
|
|
96
|
+
shapeId?: number;
|
|
97
|
+
/**
|
|
98
|
+
* The name of the macro the control runs when used.
|
|
99
|
+
*/
|
|
100
|
+
macro?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The control's placement properties as the file spelled them, less the ones modeled and the
|
|
103
|
+
* anchor, which is the movable's own.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Whether it prints, whether it is locked, how it sizes with its cell. Carried so a file keeps
|
|
107
|
+
* what it said until each has a model.
|
|
108
|
+
*/
|
|
109
|
+
props?: Record<string, string>;
|
|
110
|
+
/**
|
|
111
|
+
* The control's own properties as the file spelled them, less the ones modeled.
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* The 3-D look, text locking, the width of a drop-down's arrow. Carried so a file keeps what
|
|
115
|
+
* it said until each has a model.
|
|
116
|
+
*/
|
|
117
|
+
formProps?: Record<string, string>;
|
|
118
|
+
/**
|
|
119
|
+
* Anything a producer wrote inside the placement properties besides the anchor, as markup.
|
|
120
|
+
* Empty for every file seen so far.
|
|
121
|
+
*/
|
|
122
|
+
xml?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Extensions a producer wrote on the control's own properties, as markup.
|
|
125
|
+
*/
|
|
126
|
+
extLst?: string;
|
|
127
|
+
}
|
|
128
|
+
interface Events extends IModel.Events {
|
|
129
|
+
}
|
|
130
|
+
interface IListeners extends IListener.Callbacks<IFormControl, IFormControl.Events> {
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A control that shows text: a button's label, the text beside a check box, a group box's title.
|
|
135
|
+
*/
|
|
136
|
+
export interface ICaptioned {
|
|
137
|
+
/**
|
|
138
|
+
* Returns the text written on the control, or `null` if it has none.
|
|
139
|
+
*/
|
|
140
|
+
getCaption(): string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Sets the text written on the control.
|
|
143
|
+
*
|
|
144
|
+
* @param caption The text, or `null` for none.
|
|
145
|
+
*/
|
|
146
|
+
setCaption(caption: string | null, options?: ITransaction.OperationOptions): this;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the font the caption is drawn in, or `null` when the control has not said.
|
|
149
|
+
*/
|
|
150
|
+
getFont(): ICaptioned.Font | null;
|
|
151
|
+
}
|
|
152
|
+
export declare namespace ICaptioned {
|
|
153
|
+
/**
|
|
154
|
+
* The font a caption is drawn in. Every field is optional; one the control has not said is the
|
|
155
|
+
* host's default.
|
|
156
|
+
*/
|
|
157
|
+
interface Font {
|
|
158
|
+
/** The family name. */
|
|
159
|
+
name?: string;
|
|
160
|
+
/** The size in points. */
|
|
161
|
+
size?: number;
|
|
162
|
+
/** @defaultValue false */
|
|
163
|
+
bold?: boolean;
|
|
164
|
+
/** @defaultValue false */
|
|
165
|
+
italic?: boolean;
|
|
166
|
+
/** A hex color (`#RRGGBB`). */
|
|
167
|
+
color?: string;
|
|
168
|
+
}
|
|
169
|
+
interface JSON {
|
|
170
|
+
/** The text written on the control. */
|
|
171
|
+
caption?: string;
|
|
172
|
+
/** The font the caption is drawn in. */
|
|
173
|
+
font?: Font;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A control whose state a cell mirrors: the control writes to the cell when used, and reads it
|
|
178
|
+
* back when the cell changes.
|
|
179
|
+
*/
|
|
180
|
+
export interface ILinked {
|
|
181
|
+
/**
|
|
182
|
+
* Returns the address of the cell the control writes its state to, or `null` if it has none.
|
|
183
|
+
*
|
|
184
|
+
* @remarks
|
|
185
|
+
* As the file spelled it, which may name a sheet (`Sheet1!$A$1`).
|
|
186
|
+
*/
|
|
187
|
+
getLinkedCell(): string | null;
|
|
188
|
+
/**
|
|
189
|
+
* Sets the cell the control writes its state to.
|
|
190
|
+
*
|
|
191
|
+
* @param address The address, or `null` for none.
|
|
192
|
+
*/
|
|
193
|
+
setLinkedCell(address: string | null, options?: ITransaction.OperationOptions): this;
|
|
194
|
+
}
|
|
195
|
+
export declare namespace ILinked {
|
|
196
|
+
interface JSON {
|
|
197
|
+
/** The address of the cell the control writes its state to. */
|
|
198
|
+
linkedCell?: string;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* A button: runs its macro when clicked. Content type `'button'`.
|
|
203
|
+
*/
|
|
204
|
+
export interface IButton extends IFormControl, ICaptioned {
|
|
205
|
+
}
|
|
206
|
+
export declare namespace IButton {
|
|
207
|
+
interface JSON extends IFormControl.JSON, ICaptioned.JSON {
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* A check box: on, off or mixed. Content type `'checkBox'`.
|
|
212
|
+
*/
|
|
213
|
+
export interface ICheckBox extends IFormControl, ICaptioned, ILinked {
|
|
214
|
+
/**
|
|
215
|
+
* Returns `true` if the box is checked.
|
|
216
|
+
*/
|
|
217
|
+
isChecked(): boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Sets whether the box is checked. Clears {@link isMixed}.
|
|
220
|
+
*/
|
|
221
|
+
setChecked(checked: boolean, options?: ITransaction.OperationOptions): this;
|
|
222
|
+
/**
|
|
223
|
+
* Returns `true` if the box shows the mixed (neither) state.
|
|
224
|
+
*/
|
|
225
|
+
isMixed(): boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Sets whether the box shows the mixed state.
|
|
228
|
+
*/
|
|
229
|
+
setMixed(mixed: boolean, options?: ITransaction.OperationOptions): this;
|
|
230
|
+
}
|
|
231
|
+
export declare namespace ICheckBox {
|
|
232
|
+
interface JSON extends IFormControl.JSON, ICaptioned.JSON, ILinked.JSON {
|
|
233
|
+
/**
|
|
234
|
+
* `true` if the box is checked.
|
|
235
|
+
* @defaultValue false
|
|
236
|
+
*/
|
|
237
|
+
checked?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* `true` if the box shows the mixed state. Wins over `checked`.
|
|
240
|
+
* @defaultValue false
|
|
241
|
+
*/
|
|
242
|
+
mixed?: boolean;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* An option button: one of a group, of which one is chosen. Content type `'optionButton'`.
|
|
247
|
+
*/
|
|
248
|
+
export interface IOptionButton extends IFormControl, ICaptioned, ILinked {
|
|
249
|
+
/**
|
|
250
|
+
* Returns `true` if this is the chosen button of its group.
|
|
251
|
+
*/
|
|
252
|
+
isChecked(): boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Sets whether this is the chosen button of its group.
|
|
255
|
+
*/
|
|
256
|
+
setChecked(checked: boolean, options?: ITransaction.OperationOptions): this;
|
|
257
|
+
}
|
|
258
|
+
export declare namespace IOptionButton {
|
|
259
|
+
interface JSON extends IFormControl.JSON, ICaptioned.JSON, ILinked.JSON {
|
|
260
|
+
/**
|
|
261
|
+
* `true` if this is the chosen button of its group.
|
|
262
|
+
* @defaultValue false
|
|
263
|
+
*/
|
|
264
|
+
checked?: boolean;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* A group box: a frame around other controls. Content type `'groupBox'`.
|
|
269
|
+
*/
|
|
270
|
+
export interface IGroupBox extends IFormControl, ICaptioned {
|
|
271
|
+
}
|
|
272
|
+
export declare namespace IGroupBox {
|
|
273
|
+
interface JSON extends IFormControl.JSON, ICaptioned.JSON {
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* A label: text, nothing more. Content type `'label'`.
|
|
278
|
+
*/
|
|
279
|
+
export interface ILabel extends IFormControl, ICaptioned {
|
|
280
|
+
}
|
|
281
|
+
export declare namespace ILabel {
|
|
282
|
+
interface JSON extends IFormControl.JSON, ICaptioned.JSON {
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* What a scroll bar and a spinner share: a number between two bounds.
|
|
287
|
+
*/
|
|
288
|
+
export interface IRangedControl extends IFormControl, ILinked {
|
|
289
|
+
/** Returns the current value, or `null` if the control has not said. */
|
|
290
|
+
getValue(): number | null;
|
|
291
|
+
/** Sets the current value. */
|
|
292
|
+
setValue(value: number | null, options?: ITransaction.OperationOptions): this;
|
|
293
|
+
/** Returns the smallest value, or `null` if the control has not said. */
|
|
294
|
+
getMin(): number | null;
|
|
295
|
+
/** Sets the smallest value. */
|
|
296
|
+
setMin(min: number | null, options?: ITransaction.OperationOptions): this;
|
|
297
|
+
/** Returns the largest value, or `null` if the control has not said. */
|
|
298
|
+
getMax(): number | null;
|
|
299
|
+
/** Sets the largest value. */
|
|
300
|
+
setMax(max: number | null, options?: ITransaction.OperationOptions): this;
|
|
301
|
+
/** Returns how far one arrow click moves the value, or `null` if the control has not said. */
|
|
302
|
+
getIncrement(): number | null;
|
|
303
|
+
/** Sets how far one arrow click moves the value. */
|
|
304
|
+
setIncrement(increment: number | null, options?: ITransaction.OperationOptions): this;
|
|
305
|
+
}
|
|
306
|
+
export declare namespace IRangedControl {
|
|
307
|
+
interface JSON extends IFormControl.JSON, ILinked.JSON {
|
|
308
|
+
/** The current value. */
|
|
309
|
+
value?: number;
|
|
310
|
+
/** The smallest value. */
|
|
311
|
+
min?: number;
|
|
312
|
+
/** The largest value. */
|
|
313
|
+
max?: number;
|
|
314
|
+
/** How far one arrow click moves the value. */
|
|
315
|
+
increment?: number;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* A scroll bar: a thumb in a trough. Content type `'scrollBar'`.
|
|
320
|
+
*/
|
|
321
|
+
export interface IScrollBar extends IRangedControl {
|
|
322
|
+
/** Returns how far a click in the trough moves the value, or `null` if the control has not said. */
|
|
323
|
+
getPageIncrement(): number | null;
|
|
324
|
+
/** Sets how far a click in the trough moves the value. */
|
|
325
|
+
setPageIncrement(increment: number | null, options?: ITransaction.OperationOptions): this;
|
|
326
|
+
/** Returns `true` if the bar lies on its side. */
|
|
327
|
+
isHorizontal(): boolean;
|
|
328
|
+
}
|
|
329
|
+
export declare namespace IScrollBar {
|
|
330
|
+
interface JSON extends IRangedControl.JSON {
|
|
331
|
+
/** How far a click in the trough moves the value. */
|
|
332
|
+
pageIncrement?: number;
|
|
333
|
+
/**
|
|
334
|
+
* `true` if the bar lies on its side.
|
|
335
|
+
* @defaultValue false
|
|
336
|
+
*/
|
|
337
|
+
horizontal?: boolean;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* A spinner: two arrows. Content type `'spinner'`.
|
|
342
|
+
*/
|
|
343
|
+
export interface ISpinner extends IRangedControl {
|
|
344
|
+
}
|
|
345
|
+
export declare namespace ISpinner {
|
|
346
|
+
interface JSON extends IRangedControl.JSON {
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* What a list box and a drop-down share: items, one of which may be chosen.
|
|
351
|
+
*/
|
|
352
|
+
export interface IListControl extends IFormControl, ILinked {
|
|
353
|
+
/**
|
|
354
|
+
* Returns the items.
|
|
355
|
+
*
|
|
356
|
+
* @remarks
|
|
357
|
+
* Empty when the items come from {@link getListFillRange} rather than being held by the control.
|
|
358
|
+
*/
|
|
359
|
+
getItems(): readonly string[];
|
|
360
|
+
/** Sets the items. */
|
|
361
|
+
setItems(items: readonly string[], options?: ITransaction.OperationOptions): this;
|
|
362
|
+
/** Returns the address of the range the items come from, or `null` if the control holds them. */
|
|
363
|
+
getListFillRange(): string | null;
|
|
364
|
+
/** Sets the range the items come from. */
|
|
365
|
+
setListFillRange(address: string | null, options?: ITransaction.OperationOptions): this;
|
|
366
|
+
/** Returns the index of the chosen item, or `null` if none is. */
|
|
367
|
+
getSelectedIndex(): number | null;
|
|
368
|
+
/** Sets the chosen item. */
|
|
369
|
+
setSelectedIndex(index: number | null, options?: ITransaction.OperationOptions): this;
|
|
370
|
+
}
|
|
371
|
+
export declare namespace IListControl {
|
|
372
|
+
interface JSON extends IFormControl.JSON, ILinked.JSON {
|
|
373
|
+
/** The items held by the control itself. */
|
|
374
|
+
items?: string[];
|
|
375
|
+
/** The address of the range the items come from. */
|
|
376
|
+
listFillRange?: string;
|
|
377
|
+
/** The index of the chosen item. Absent when none is. */
|
|
378
|
+
selectedIndex?: number;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* A list box. Content type `'listBox'`.
|
|
383
|
+
*/
|
|
384
|
+
export interface IListBox extends IListControl {
|
|
385
|
+
}
|
|
386
|
+
export declare namespace IListBox {
|
|
387
|
+
interface JSON extends IListControl.JSON {
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* A drop-down. Content type `'dropDown'`.
|
|
392
|
+
*/
|
|
393
|
+
export interface IDropDown extends IListControl {
|
|
394
|
+
/**
|
|
395
|
+
* Returns how the drop-down behaves: a list to pick from, a list that can also be typed into, or
|
|
396
|
+
* a plain list box. `null` if the control has not said.
|
|
397
|
+
*/
|
|
398
|
+
getDropStyle(): IDropDown.DropStyle | null;
|
|
399
|
+
/**
|
|
400
|
+
* Returns how many items the drop-down shows at once, or `null` if the control has not said.
|
|
401
|
+
*/
|
|
402
|
+
getDropLines(): number | null;
|
|
403
|
+
}
|
|
404
|
+
export declare namespace IDropDown {
|
|
405
|
+
/**
|
|
406
|
+
* How a drop-down behaves.
|
|
407
|
+
*/
|
|
408
|
+
const DropStyle: {
|
|
409
|
+
/** A list to pick from. */
|
|
410
|
+
readonly Combo: "combo";
|
|
411
|
+
/** A list that can also be typed into. */
|
|
412
|
+
readonly ComboEdit: "comboEdit";
|
|
413
|
+
/** A list box that does not drop. */
|
|
414
|
+
readonly Simple: "simple";
|
|
415
|
+
};
|
|
416
|
+
type DropStyle = typeof DropStyle[keyof typeof DropStyle];
|
|
417
|
+
interface JSON extends IListControl.JSON {
|
|
418
|
+
/** How the drop-down behaves. */
|
|
419
|
+
dropStyle?: DropStyle;
|
|
420
|
+
/** How many items the drop-down shows at once. */
|
|
421
|
+
dropLines?: number;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
//# sourceMappingURL=IFormControl.d.ts.map
|