@progress/kendo-spreadsheet-common 1.1.3-develop.1 → 1.1.3-develop.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-spreadsheet-common",
3
3
  "description": "Kendo UI platform-independent Spreadsheet library",
4
- "version": "1.1.3-develop.1",
4
+ "version": "1.1.3-develop.2",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],
package/src/index.d.ts CHANGED
@@ -745,8 +745,10 @@ export class SpreadsheetWidget {
745
745
  * Clears the Spreadsheet and populates it with data from the specified Excel (.xlsx) file.
746
746
  *
747
747
  * @param blob The file or blob that is usually obtained through a file input.
748
+ *
749
+ * @returns A promise that will be resolved when the file is loaded and the data is populated.
748
750
  */
749
- fromFile(file: File | Blob): void;
751
+ fromFile(file: File | Blob): Promise<void>;
750
752
 
751
753
  /**
752
754
  * Initiates the Excel export. Also fires the excelExport event.
@@ -1014,3 +1016,59 @@ export function defineFunction(name: string, func: Function): {
1014
1016
  * Defines alias of a formula.
1015
1017
  */
1016
1018
  export function defineAlias(alias: string, name: string): void;
1019
+
1020
+ /**
1021
+ * Deferred class similar to jQuery's Deferred.
1022
+ */
1023
+ export class Deferred<T = any, N = any> {
1024
+ /**
1025
+ * Creates a new Deferred object.
1026
+ */
1027
+ constructor();
1028
+
1029
+ /**
1030
+ * Resolves the Deferred object and calls any done callbacks with the given value.
1031
+ * @param value The value to resolve the promise with.
1032
+ * @returns The Deferred object.
1033
+ */
1034
+ resolve(value?: T): this;
1035
+
1036
+ /**
1037
+ * Rejects the Deferred object and calls any fail callbacks with the given reason.
1038
+ * @param reason The reason for rejecting the promise.
1039
+ * @returns The Deferred object.
1040
+ */
1041
+ reject(reason?: any): this;
1042
+
1043
+ /**
1044
+ * Notifies progress callbacks with the given value.
1045
+ * @param value The value to pass to the progress callbacks.
1046
+ */
1047
+ notify(value?: N): void;
1048
+
1049
+ /**
1050
+ * Adds a handler to be called when the Deferred object is notified of progress.
1051
+ * @param callback A function to call when progress is notified.
1052
+ * @returns The Deferred object.
1053
+ */
1054
+ progress(callback: (value?: N) => void): this;
1055
+
1056
+ /**
1057
+ * Attaches callbacks for the resolution, rejection, and progress of the Promise.
1058
+ * @param onFulfilled The callback to execute when the Promise is resolved.
1059
+ * @param onRejected The callback to execute when the Promise is rejected.
1060
+ * @param onProgress The callback to execute when the Promise reports progress.
1061
+ * @returns A Promise for the completion of which ever callback is executed.
1062
+ */
1063
+ then<TResult1 = T, TResult2 = never>(
1064
+ onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
1065
+ onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
1066
+ onProgress?: (value?: N) => void
1067
+ ): Promise<TResult1 | TResult2>;
1068
+
1069
+ /**
1070
+ * Returns the underlying Promise object.
1071
+ * @returns The Promise object.
1072
+ */
1073
+ promise(): Promise<T>;
1074
+ }