dotvvm-types 4.3.6 → 5.0.0-preview01-final

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +224 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotvvm-types",
3
- "version": "4.3.6",
3
+ "version": "5.0.0-preview01-final",
4
4
  "description": "MVVM framework for ASP.NET",
5
5
  "types": "./types/index.d.ts",
6
6
  "repository": {
package/types/index.d.ts CHANGED
@@ -234,7 +234,7 @@ declare module "state-manager" {
234
234
  export class StateManager<TViewModel extends {
235
235
  $type?: TypeDefinition;
236
236
  }> implements DotvvmStateContainer<TViewModel> {
237
- stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>;
237
+ stateUpdateEvent?: DotvvmEvent<DeepReadonly<TViewModel>> | undefined;
238
238
  /** The knockout observable containing the root objects, equivalent to `dotvvm.viewModels.root.viewModel` */
239
239
  readonly stateObservable: DeepKnockoutObservable<TViewModel>;
240
240
  private _state;
@@ -244,7 +244,7 @@ declare module "state-manager" {
244
244
  /** Indicates whether there is a pending update of the knockout observables. */
245
245
  get isDirty(): boolean;
246
246
  private _currentFrameNumber;
247
- constructor(initialState: DeepReadonly<TViewModel>, stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>);
247
+ constructor(initialState: DeepReadonly<TViewModel>, stateUpdateEvent?: DotvvmEvent<DeepReadonly<TViewModel>> | undefined);
248
248
  private dispatchUpdate;
249
249
  /** Performs a synchronous update of knockout observables with the data currently stored in `state`.
250
250
  * Consequently, if ko.options.deferUpdates is false (default), the UI will be updated immediately.
@@ -524,6 +524,21 @@ declare module "binding-handlers/modal-dialog" {
524
524
  };
525
525
  export default _default_12;
526
526
  }
527
+ declare module "binding-handlers/appendable-data-pager" {
528
+ type AppendableDataPagerBinding = {
529
+ autoLoadWhenInViewport: boolean;
530
+ loadNextPage: () => Promise<any>;
531
+ dataSet: any;
532
+ };
533
+ const _default_13: {
534
+ 'dotvvm-appendable-data-pager': {
535
+ init: (element: HTMLInputElement, valueAccessor: () => AppendableDataPagerBinding, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
536
+ controlsDescendantBindings: boolean;
537
+ };
538
+ };
539
+ };
540
+ export default _default_13;
541
+ }
527
542
  declare module "binding-handlers/all-handlers" {
528
543
  type KnockoutHandlerDictionary = {
529
544
  [name: string]: KnockoutBindingHandler;
@@ -762,8 +777,8 @@ declare module "spa/spa" {
762
777
  export function handleSpaNavigationCore(url: string | null, sender?: HTMLElement, handlePageNavigating?: (url: string) => void): Promise<DotvvmNavigationEventArgs>;
763
778
  }
764
779
  declare module "binding-handlers/register" {
765
- const _default_13: () => void;
766
- export default _default_13;
780
+ const _default_14: () => void;
781
+ export default _default_14;
767
782
  }
768
783
  declare module "postback/staticCommand" {
769
784
  export function resolveRelativeValidationPaths(paths: string[] | null | undefined, context: KnockoutBindingContext | undefined): (string | null)[] | undefined;
@@ -839,7 +854,7 @@ declare module "translations/translations" {
839
854
  import * as dictionary from "translations/dictionaryHelper";
840
855
  import * as string from "translations/stringHelper";
841
856
  import * as dateTime from "translations/dateTimeHelper";
842
- const _default_14: Readonly<{
857
+ const _default_15: Readonly<{
843
858
  array: typeof array;
844
859
  dictionary: typeof dictionary;
845
860
  string: typeof string;
@@ -849,7 +864,90 @@ declare module "translations/translations" {
849
864
  toInt(value: any, type: string): number | null;
850
865
  };
851
866
  }>;
852
- export default _default_14;
867
+ export default _default_15;
868
+ }
869
+ declare module "dataset/loader" {
870
+ type GridViewDataSet = {
871
+ PagingOptions: object;
872
+ SortingOptions: object;
873
+ FilteringOptions: object;
874
+ Items: any[];
875
+ IsRefreshRequired?: boolean;
876
+ };
877
+ type GridViewDataSetOptions = {
878
+ PagingOptions: object;
879
+ SortingOptions: object;
880
+ FilteringOptions: object;
881
+ };
882
+ type GridViewDataSetResult = {
883
+ Items: any[];
884
+ PagingOptions: object;
885
+ SortingOptions: object;
886
+ FilteringOptions: object;
887
+ };
888
+ export function getOptions(dataSetObservable: DotvvmObservable<GridViewDataSet>): GridViewDataSetOptions;
889
+ export function loadDataSet(dataSetObservable: DotvvmObservable<GridViewDataSet>, transformOptions: (options: GridViewDataSetOptions) => void, loadData: (options: GridViewDataSetOptions) => Promise<DotvvmAfterPostBackEventArgs>, postProcessor?: (dataSet: DotvvmObservable<GridViewDataSet>, result: GridViewDataSetResult) => void): Promise<void>;
890
+ export const postProcessors: {
891
+ replace(dataSet: DotvvmObservable<GridViewDataSet>, result: GridViewDataSetResult): void;
892
+ append(dataSet: DotvvmObservable<GridViewDataSet>, result: GridViewDataSetResult): void;
893
+ };
894
+ }
895
+ declare module "dataset/translations" {
896
+ import { getOptions } from "dataset/loader";
897
+ type PagingOptions = {
898
+ PageIndex: number;
899
+ PagesCount: number;
900
+ };
901
+ type NextTokenPagingOptions = {
902
+ CurrentToken: string | null;
903
+ NextPageToken: string | null;
904
+ };
905
+ type NextTokenHistoryPagingOptions = {
906
+ PageIndex: number;
907
+ TokenHistory: (string | null)[];
908
+ };
909
+ type SortingOptions = {
910
+ SortExpression: string | null;
911
+ SortDescending: boolean;
912
+ };
913
+ type MultiCriteriaSortingOptions = {
914
+ Criteria: SortCriterion[];
915
+ MaxSortCriteriaCount: number;
916
+ };
917
+ type SortCriterion = {
918
+ SortExpression: string;
919
+ SortDescending: boolean;
920
+ };
921
+ export const translations: {
922
+ getOptions: typeof getOptions;
923
+ PagingOptions: {
924
+ goToFirstPage(options: PagingOptions): void;
925
+ goToLastPage(options: PagingOptions): void;
926
+ goToNextPage(options: PagingOptions): void;
927
+ goToPreviousPage(options: PagingOptions): void;
928
+ goToPage(options: PagingOptions, pageIndex: number): void;
929
+ };
930
+ NextTokenPagingOptions: {
931
+ goToFirstPage(options: NextTokenPagingOptions): void;
932
+ goToNextPage(options: NextTokenPagingOptions): void;
933
+ };
934
+ NextTokenHistoryPagingOptions: {
935
+ goToFirstPage(options: NextTokenHistoryPagingOptions): void;
936
+ goToNextPage(options: NextTokenHistoryPagingOptions): void;
937
+ goToPreviousPage(options: NextTokenHistoryPagingOptions): void;
938
+ goToPage(options: NextTokenHistoryPagingOptions, pageIndex: number): void;
939
+ };
940
+ SortingOptions: {
941
+ setSortExpression(options: SortingOptions, sortExpression: string): void;
942
+ isColumnSortedAscending(options: SortingOptions, sortExpression: string): boolean;
943
+ isColumnSortedDescending(options: SortingOptions, sortExpression: string): boolean;
944
+ };
945
+ MultiCriteriaSortingOptions: {
946
+ setSortExpression(options: MultiCriteriaSortingOptions, sortExpression: string): void;
947
+ isColumnSortedAscending(options: MultiCriteriaSortingOptions, sortExpression: string): boolean;
948
+ isColumnSortedDescending(options: MultiCriteriaSortingOptions, sortExpression: string): boolean;
949
+ };
950
+ };
853
951
  }
854
952
  declare module "dotvvm-root" {
855
953
  import { getCulture } from "dotvvm-base";
@@ -875,6 +973,7 @@ declare module "dotvvm-root" {
875
973
  import { logError, logWarning, logInfo, logInfoVerbose, logPostBackScriptError, setLogger } from "utils/logging";
876
974
  import * as metadataHelper from "metadata/metadataHelper";
877
975
  import { StateManager } from "state-manager";
976
+ import { loadDataSet } from "dataset/loader";
878
977
  function init(culture: string): void;
879
978
  const dotvvmExports: {
880
979
  getCulture: typeof getCulture;
@@ -968,6 +1067,125 @@ declare module "dotvvm-root" {
968
1067
  compressPOST: boolean;
969
1068
  };
970
1069
  translations: any;
1070
+ dataSet: {
1071
+ loadDataSet: typeof loadDataSet;
1072
+ postProcessors: {
1073
+ replace(dataSet: DotvvmObservable<{
1074
+ PagingOptions: object;
1075
+ SortingOptions: object;
1076
+ FilteringOptions: object;
1077
+ Items: any[];
1078
+ IsRefreshRequired?: boolean | undefined;
1079
+ }>, result: {
1080
+ Items: any[];
1081
+ PagingOptions: object;
1082
+ SortingOptions: object;
1083
+ FilteringOptions: object;
1084
+ }): void;
1085
+ append(dataSet: DotvvmObservable<{
1086
+ PagingOptions: object;
1087
+ SortingOptions: object;
1088
+ FilteringOptions: object;
1089
+ Items: any[];
1090
+ IsRefreshRequired?: boolean | undefined;
1091
+ }>, result: {
1092
+ Items: any[];
1093
+ PagingOptions: object;
1094
+ SortingOptions: object;
1095
+ FilteringOptions: object;
1096
+ }): void;
1097
+ };
1098
+ translations: {
1099
+ getOptions: typeof import("dataset/loader").getOptions;
1100
+ PagingOptions: {
1101
+ goToFirstPage(options: {
1102
+ PageIndex: number;
1103
+ PagesCount: number;
1104
+ }): void;
1105
+ goToLastPage(options: {
1106
+ PageIndex: number;
1107
+ PagesCount: number;
1108
+ }): void;
1109
+ goToNextPage(options: {
1110
+ PageIndex: number;
1111
+ PagesCount: number;
1112
+ }): void;
1113
+ goToPreviousPage(options: {
1114
+ PageIndex: number;
1115
+ PagesCount: number;
1116
+ }): void;
1117
+ goToPage(options: {
1118
+ PageIndex: number;
1119
+ PagesCount: number;
1120
+ }, pageIndex: number): void;
1121
+ };
1122
+ NextTokenPagingOptions: {
1123
+ goToFirstPage(options: {
1124
+ CurrentToken: string | null;
1125
+ NextPageToken: string | null;
1126
+ }): void;
1127
+ goToNextPage(options: {
1128
+ CurrentToken: string | null;
1129
+ NextPageToken: string | null;
1130
+ }): void;
1131
+ };
1132
+ NextTokenHistoryPagingOptions: {
1133
+ goToFirstPage(options: {
1134
+ PageIndex: number;
1135
+ TokenHistory: (string | null)[];
1136
+ }): void;
1137
+ goToNextPage(options: {
1138
+ PageIndex: number;
1139
+ TokenHistory: (string | null)[];
1140
+ }): void;
1141
+ goToPreviousPage(options: {
1142
+ PageIndex: number;
1143
+ TokenHistory: (string | null)[];
1144
+ }): void;
1145
+ goToPage(options: {
1146
+ PageIndex: number;
1147
+ TokenHistory: (string | null)[];
1148
+ }, pageIndex: number): void;
1149
+ };
1150
+ SortingOptions: {
1151
+ setSortExpression(options: {
1152
+ SortExpression: string | null;
1153
+ SortDescending: boolean;
1154
+ }, sortExpression: string): void;
1155
+ isColumnSortedAscending(options: {
1156
+ SortExpression: string | null;
1157
+ SortDescending: boolean;
1158
+ }, sortExpression: string): boolean;
1159
+ isColumnSortedDescending(options: {
1160
+ SortExpression: string | null;
1161
+ SortDescending: boolean;
1162
+ }, sortExpression: string): boolean;
1163
+ };
1164
+ MultiCriteriaSortingOptions: {
1165
+ setSortExpression(options: {
1166
+ Criteria: {
1167
+ SortExpression: string;
1168
+ SortDescending: boolean;
1169
+ }[];
1170
+ MaxSortCriteriaCount: number;
1171
+ }, sortExpression: string): void;
1172
+ isColumnSortedAscending(options: {
1173
+ Criteria: {
1174
+ SortExpression: string;
1175
+ SortDescending: boolean;
1176
+ }[];
1177
+ MaxSortCriteriaCount: number;
1178
+ }, sortExpression: string): boolean;
1179
+ isColumnSortedDescending(options: {
1180
+ Criteria: {
1181
+ SortExpression: string;
1182
+ SortDescending: boolean;
1183
+ }[];
1184
+ MaxSortCriteriaCount: number;
1185
+ }, sortExpression: string): boolean;
1186
+ };
1187
+ };
1188
+ };
971
1189
  StateManager: typeof StateManager;
972
1190
  DotvvmEvent: typeof events.DotvvmEvent;
973
1191
  };