@i2analyze/notebook-sdk 1.1.0-dev.27 → 1.1.0-dev.28

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @i2analyze/notebook-sdk
2
2
 
3
+ ## 1.1.0-dev.28
4
+
5
+ ### Minor Changes
6
+
7
+ - Add mutation response handler API.
8
+
3
9
  ## 1.1.0-dev.27
4
10
 
5
11
  ### Minor Changes
@@ -76,9 +76,24 @@ export declare namespace app {
76
76
  *
77
77
  * @param mutationHandler - A function that performs one or more tracked mutations and reports on their success as a whole.
78
78
  * @param options - An object that can control the transaction.
79
+ * @returns A promise that is fulfilled if the work completes successfully, or rejected if there is a problem performing it.
79
80
  * @i2since 1.1
80
81
  */
81
82
  runTrackedMutations(mutationHandler: TrackedMutationHandler, options?: ITransactionOptions): void;
83
+ /**
84
+ * Queues a function that performs tracked mutations on the application contents at the next available opportunity.
85
+ *
86
+ * @remarks
87
+ * A mutation is an operation that can read or modify the contents of the application.
88
+ * A successful set of tracked mutations is added as a single entry to the undo stack.
89
+ *
90
+ * @param mutationHandler - A function that performs one or more tracked mutations and reports on their success as a whole.
91
+ * @param responseHandler - A callback that receives the changes produced by the mutation.
92
+ * @param options - An object that can control the transaction.
93
+ * @returns A promise that is fulfilled if the work completes successfully, or rejected if there is a problem performing it.
94
+ * @i2since 1.1
95
+ */
96
+ runTrackedMutations(mutationHandler: TrackedMutationHandler, responseHandler?: MutationResponseHandler, options?: ITransactionOptions): void;
82
97
  /**
83
98
  * Queues a function that performs untracked mutations on the application contents at the next available opportunity.
84
99
  *
@@ -91,6 +106,19 @@ export declare namespace app {
91
106
  * @i2since 1.1
92
107
  */
93
108
  runUntrackedMutations(mutationHandler: UntrackedMutationHandler, options?: ITransactionOptions): void;
109
+ /**
110
+ * Queues a function that performs untracked mutations on the application contents at the next available opportunity.
111
+ *
112
+ * @remarks
113
+ * A mutation is an operation that can read or modify the contents of the application.
114
+ * Untracked mutations are not added to the undo stack, and therefore cannot be undone.
115
+ *
116
+ * @param mutationHandler - A function that performs one or more untracked mutations and reports on their success as a whole.
117
+ * @param responseHandler - A callback that receives the changes produced by the mutation.
118
+ * @param options - An object that can control the transaction.
119
+ * @i2since 1.1
120
+ */
121
+ runUntrackedMutations(mutationHandler: UntrackedMutationHandler, responseHandler?: MutationResponseHandler, options?: ITransactionOptions): void;
94
122
  }
95
123
  /**
96
124
  * A report on the result of one or more mutations.
@@ -219,6 +247,26 @@ export declare namespace app {
219
247
  * @i2since 1.1
220
248
  */
221
249
  export type TrackedMutationHandler = (application: IApplicationContents, mutations: ITrackedMutations, cancelation: ICancelation) => ITrackedMutationInfo | Promise<ITrackedMutationInfo>;
250
+ /**
251
+ * A function that receives the results of a mutation.
252
+ *
253
+ * @param error - The error thrown if a mutation failed or was aborted.
254
+ * @param result - The results of the mutation.
255
+ * @param application - The contents of the application after the mutation was performed.
256
+ * @i2since 1.1
257
+ */
258
+ export type MutationResponseHandler = (error: Error | null, result: IMutationResult, application: IApplicationContents) => void;
259
+ /**
260
+ * A result from a mutation.
261
+ * @i2since 1.1
262
+ */
263
+ export interface IMutationResult {
264
+ /**
265
+ * Gets the changes that were the result of a mutation .
266
+ * @i2since 1.1
267
+ */
268
+ change: chart.IChartChange;
269
+ }
222
270
  /**
223
271
  * A collection of methods and properties for handling the situation when a user cancels an operation.
224
272
  *
@@ -731,7 +779,7 @@ export declare namespace app {
731
779
  * Removes records from the chart.
732
780
  *
733
781
  * @param records - The record or records to be removed.
734
- * @returns Returns true if one or more records existed on the chart and has been removed, or false if none of the records existed.
782
+ * @returns `true` if one or more records were successfully removed from the chart; `false` if none of the records existed.
735
783
  * @i2since 1.1
736
784
  */
737
785
  removeRecords(records: RecordSpecifier | Iterable<RecordSpecifier>): boolean;
@@ -739,12 +787,12 @@ export declare namespace app {
739
787
  * Removes elements from the chart.
740
788
  *
741
789
  * @param elements - The element or elements to be removed.
742
- * @returns Returns true if one or more elements existed on the chart and has been removed, or false if none of the elements existed.
790
+ * @returns `true` if one or more elements were successfully removed from the chart; `false` if none of the elements existed.
743
791
  * @i2since 1.1
744
792
  */
745
793
  removeElements(elements: ElementSpecifier | Iterable<ElementSpecifier>): boolean;
746
794
  /**
747
- * Removes the selected records from the chart.
795
+ * Removes the currently selected records from the chart.
748
796
  * @i2since 1.1
749
797
  */
750
798
  removeSelectedRecords(): void;
@@ -1984,7 +2032,7 @@ export declare namespace commands {
1984
2032
  */
1985
2033
  readonly toggleVisualQuery: CommandId;
1986
2034
  /**
1987
- * Gets the identifier of the system command that toggles the Expand UI.
2035
+ * Gets the identifier of the system command that toggles the Expand-with-conditions UI.
1988
2036
  * @i2since 1.0
1989
2037
  */
1990
2038
  readonly toggleExpand: CommandId;
@@ -2039,7 +2087,7 @@ export declare namespace commands {
2039
2087
  */
2040
2088
  readonly saveChart: CommandId;
2041
2089
  /**
2042
- * Gets the identifier of the system command that expands the current selection.
2090
+ * Gets the identifier of the system command that performs an expand operation on the current selection.
2043
2091
  * @i2since 1.1
2044
2092
  */
2045
2093
  readonly expand: CommandId;
@@ -3369,17 +3417,17 @@ export declare namespace schema {
3369
3417
  */
3370
3418
  readonly maximumSourceIdentifiers: number;
3371
3419
  /**
3372
- * Gets the maximum string length of a source identifier key.
3420
+ * Gets the maximum number of characters for a source identifier key.
3373
3421
  * @i2since 1.1
3374
3422
  */
3375
3423
  readonly maxKeyStringLength: data.ICharLimit;
3376
3424
  /**
3377
- * Gets the maximum string length of a source identifier type.
3425
+ * Gets the maximum number of characters for a source identifier type.
3378
3426
  * @i2since 1.1
3379
3427
  */
3380
3428
  readonly maxTypeStringLength: data.ICharLimit;
3381
3429
  /**
3382
- * Gets a collection of reserved source identifier types.
3430
+ * Gets the source identifier types that are reserved for system use.
3383
3431
  * @i2since 1.1
3384
3432
  */
3385
3433
  readonly reservedTypes: data.IReadOnlyCollection<string>;
@@ -3560,7 +3608,7 @@ export declare namespace schema {
3560
3608
  */
3561
3609
  readonly isOrphaned: boolean;
3562
3610
  /**
3563
- * Indicates whether the item type exists in the Information Store.
3611
+ * Indicates whether the item type is defined in the Information Store schema.
3564
3612
  * @i2since 1.1
3565
3613
  */
3566
3614
  readonly isInfoStore: boolean;
@@ -3586,7 +3634,7 @@ export declare namespace schema {
3586
3634
  */
3587
3635
  export type AnalyzePropertyTypeId = string;
3588
3636
  /**
3589
- * A specifier for a property type.
3637
+ * A common specifier for a property type.
3590
3638
  * @i2since 1.1
3591
3639
  */
3592
3640
  export type PropertyTypeSpecifier = ChartPropertyTypeId | IChartPropertyType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.1.0-dev.27",
3
+ "version": "1.1.0-dev.28",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {