dotvvm-types 4.3.7 → 5.0.0-preview02-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 +238 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotvvm-types",
3
- "version": "4.3.7",
3
+ "version": "5.0.0-preview02-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
@@ -195,6 +195,7 @@ declare module "utils/evaluator" {
195
195
  export function findPathToChildObservable(vm: any, child: any, path: string): string | null;
196
196
  export function getDataSourceItems(viewModel: any): Array<KnockoutObservable<any>>;
197
197
  export function wrapObservable(func: () => any, isArray?: boolean): KnockoutComputed<any>;
198
+ export function proxyObservableArrayMethods(wrapper: KnockoutObservable<any>, getObservableArray: () => any): void;
198
199
  export const unwrapComputedProperty: (obs: any) => any;
199
200
  }
200
201
  declare module "validation/error" {
@@ -234,7 +235,7 @@ declare module "state-manager" {
234
235
  export class StateManager<TViewModel extends {
235
236
  $type?: TypeDefinition;
236
237
  }> implements DotvvmStateContainer<TViewModel> {
237
- stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>;
238
+ stateUpdateEvent?: DotvvmEvent<DeepReadonly<TViewModel>> | undefined;
238
239
  /** The knockout observable containing the root objects, equivalent to `dotvvm.viewModels.root.viewModel` */
239
240
  readonly stateObservable: DeepKnockoutObservable<TViewModel>;
240
241
  private _state;
@@ -244,7 +245,7 @@ declare module "state-manager" {
244
245
  /** Indicates whether there is a pending update of the knockout observables. */
245
246
  get isDirty(): boolean;
246
247
  private _currentFrameNumber;
247
- constructor(initialState: DeepReadonly<TViewModel>, stateUpdateEvent: DotvvmEvent<DeepReadonly<TViewModel>>);
248
+ constructor(initialState: DeepReadonly<TViewModel>, stateUpdateEvent?: DotvvmEvent<DeepReadonly<TViewModel>> | undefined);
248
249
  private dispatchUpdate;
249
250
  /** Performs a synchronous update of knockout observables with the data currently stored in `state`.
250
251
  * Consequently, if ko.options.deferUpdates is false (default), the UI will be updated immediately.
@@ -524,6 +525,34 @@ declare module "binding-handlers/modal-dialog" {
524
525
  };
525
526
  export default _default_12;
526
527
  }
528
+ declare module "binding-handlers/appendable-data-pager" {
529
+ type AppendableDataPagerBinding = {
530
+ autoLoadWhenInViewport: boolean;
531
+ loadNextPage: () => Promise<any>;
532
+ dataSet: any;
533
+ };
534
+ const _default_13: {
535
+ 'dotvvm-appendable-data-pager': {
536
+ init: (element: HTMLInputElement, valueAccessor: () => AppendableDataPagerBinding, allBindings?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => {
537
+ controlsDescendantBindings: boolean;
538
+ };
539
+ };
540
+ };
541
+ export default _default_13;
542
+ }
543
+ declare module "binding-handlers/timer" {
544
+ type TimerProps = {
545
+ interval: number;
546
+ enabled: KnockoutObservable<boolean>;
547
+ command: () => Promise<DotvvmAfterPostBackEventArgs>;
548
+ };
549
+ const _default_14: {
550
+ "dotvvm-timer": {
551
+ init: (element: HTMLElement, valueAccessor: () => TimerProps) => void;
552
+ };
553
+ };
554
+ export default _default_14;
555
+ }
527
556
  declare module "binding-handlers/all-handlers" {
528
557
  type KnockoutHandlerDictionary = {
529
558
  [name: string]: KnockoutBindingHandler;
@@ -762,8 +791,8 @@ declare module "spa/spa" {
762
791
  export function handleSpaNavigationCore(url: string | null, sender?: HTMLElement, handlePageNavigating?: (url: string) => void): Promise<DotvvmNavigationEventArgs>;
763
792
  }
764
793
  declare module "binding-handlers/register" {
765
- const _default_13: () => void;
766
- export default _default_13;
794
+ const _default_15: () => void;
795
+ export default _default_15;
767
796
  }
768
797
  declare module "postback/staticCommand" {
769
798
  export function resolveRelativeValidationPaths(paths: string[] | null | undefined, context: KnockoutBindingContext | undefined): (string | null)[] | undefined;
@@ -839,7 +868,7 @@ declare module "translations/translations" {
839
868
  import * as dictionary from "translations/dictionaryHelper";
840
869
  import * as string from "translations/stringHelper";
841
870
  import * as dateTime from "translations/dateTimeHelper";
842
- const _default_14: Readonly<{
871
+ const _default_16: Readonly<{
843
872
  array: typeof array;
844
873
  dictionary: typeof dictionary;
845
874
  string: typeof string;
@@ -849,7 +878,90 @@ declare module "translations/translations" {
849
878
  toInt(value: any, type: string): number | null;
850
879
  };
851
880
  }>;
852
- export default _default_14;
881
+ export default _default_16;
882
+ }
883
+ declare module "dataset/loader" {
884
+ type GridViewDataSet = {
885
+ PagingOptions: object;
886
+ SortingOptions: object;
887
+ FilteringOptions: object;
888
+ Items: any[];
889
+ IsRefreshRequired?: boolean;
890
+ };
891
+ type GridViewDataSetOptions = {
892
+ PagingOptions: object;
893
+ SortingOptions: object;
894
+ FilteringOptions: object;
895
+ };
896
+ type GridViewDataSetResult = {
897
+ Items: any[];
898
+ PagingOptions: object;
899
+ SortingOptions: object;
900
+ FilteringOptions: object;
901
+ };
902
+ export function getOptions(dataSetObservable: DotvvmObservable<GridViewDataSet>): GridViewDataSetOptions;
903
+ export function loadDataSet(dataSetObservable: DotvvmObservable<GridViewDataSet>, transformOptions: (options: GridViewDataSetOptions) => void, loadData: (options: GridViewDataSetOptions) => Promise<DotvvmAfterPostBackEventArgs>, postProcessor?: (dataSet: DotvvmObservable<GridViewDataSet>, result: GridViewDataSetResult) => void): Promise<void>;
904
+ export const postProcessors: {
905
+ replace(dataSet: DotvvmObservable<GridViewDataSet>, result: GridViewDataSetResult): void;
906
+ append(dataSet: DotvvmObservable<GridViewDataSet>, result: GridViewDataSetResult): void;
907
+ };
908
+ }
909
+ declare module "dataset/translations" {
910
+ import { getOptions } from "dataset/loader";
911
+ type PagingOptions = {
912
+ PageIndex: number;
913
+ PagesCount: number;
914
+ };
915
+ type NextTokenPagingOptions = {
916
+ CurrentToken: string | null;
917
+ NextPageToken: string | null;
918
+ };
919
+ type NextTokenHistoryPagingOptions = {
920
+ PageIndex: number;
921
+ TokenHistory: (string | null)[];
922
+ };
923
+ type SortingOptions = {
924
+ SortExpression: string | null;
925
+ SortDescending: boolean;
926
+ };
927
+ type MultiCriteriaSortingOptions = {
928
+ Criteria: SortCriterion[];
929
+ MaxSortCriteriaCount: number;
930
+ };
931
+ type SortCriterion = {
932
+ SortExpression: string;
933
+ SortDescending: boolean;
934
+ };
935
+ export const translations: {
936
+ getOptions: typeof getOptions;
937
+ PagingOptions: {
938
+ goToFirstPage(options: PagingOptions): void;
939
+ goToLastPage(options: PagingOptions): void;
940
+ goToNextPage(options: PagingOptions): void;
941
+ goToPreviousPage(options: PagingOptions): void;
942
+ goToPage(options: PagingOptions, pageIndex: number): void;
943
+ };
944
+ NextTokenPagingOptions: {
945
+ goToFirstPage(options: NextTokenPagingOptions): void;
946
+ goToNextPage(options: NextTokenPagingOptions): void;
947
+ };
948
+ NextTokenHistoryPagingOptions: {
949
+ goToFirstPage(options: NextTokenHistoryPagingOptions): void;
950
+ goToNextPage(options: NextTokenHistoryPagingOptions): void;
951
+ goToPreviousPage(options: NextTokenHistoryPagingOptions): void;
952
+ goToPage(options: NextTokenHistoryPagingOptions, pageIndex: number): void;
953
+ };
954
+ SortingOptions: {
955
+ setSortExpression(options: SortingOptions, sortExpression: string): void;
956
+ isColumnSortedAscending(options: SortingOptions, sortExpression: string): boolean;
957
+ isColumnSortedDescending(options: SortingOptions, sortExpression: string): boolean;
958
+ };
959
+ MultiCriteriaSortingOptions: {
960
+ setSortExpression(options: MultiCriteriaSortingOptions, sortExpression: string): void;
961
+ isColumnSortedAscending(options: MultiCriteriaSortingOptions, sortExpression: string): boolean;
962
+ isColumnSortedDescending(options: MultiCriteriaSortingOptions, sortExpression: string): boolean;
963
+ };
964
+ };
853
965
  }
854
966
  declare module "dotvvm-root" {
855
967
  import { getCulture } from "dotvvm-base";
@@ -875,6 +987,7 @@ declare module "dotvvm-root" {
875
987
  import { logError, logWarning, logInfo, logInfoVerbose, logPostBackScriptError, setLogger } from "utils/logging";
876
988
  import * as metadataHelper from "metadata/metadataHelper";
877
989
  import { StateManager } from "state-manager";
990
+ import { loadDataSet } from "dataset/loader";
878
991
  function init(culture: string): void;
879
992
  const dotvvmExports: {
880
993
  getCulture: typeof getCulture;
@@ -968,6 +1081,125 @@ declare module "dotvvm-root" {
968
1081
  compressPOST: boolean;
969
1082
  };
970
1083
  translations: any;
1084
+ dataSet: {
1085
+ loadDataSet: typeof loadDataSet;
1086
+ postProcessors: {
1087
+ replace(dataSet: DotvvmObservable<{
1088
+ PagingOptions: object;
1089
+ SortingOptions: object;
1090
+ FilteringOptions: object;
1091
+ Items: any[];
1092
+ IsRefreshRequired?: boolean | undefined;
1093
+ }>, result: {
1094
+ Items: any[];
1095
+ PagingOptions: object;
1096
+ SortingOptions: object;
1097
+ FilteringOptions: object;
1098
+ }): void;
1099
+ append(dataSet: DotvvmObservable<{
1100
+ PagingOptions: object;
1101
+ SortingOptions: object;
1102
+ FilteringOptions: object;
1103
+ Items: any[];
1104
+ IsRefreshRequired?: boolean | undefined;
1105
+ }>, result: {
1106
+ Items: any[];
1107
+ PagingOptions: object;
1108
+ SortingOptions: object;
1109
+ FilteringOptions: object;
1110
+ }): void;
1111
+ };
1112
+ translations: {
1113
+ getOptions: typeof import("dataset/loader").getOptions;
1114
+ PagingOptions: {
1115
+ goToFirstPage(options: {
1116
+ PageIndex: number;
1117
+ PagesCount: number;
1118
+ }): void;
1119
+ goToLastPage(options: {
1120
+ PageIndex: number;
1121
+ PagesCount: number;
1122
+ }): void;
1123
+ goToNextPage(options: {
1124
+ PageIndex: number;
1125
+ PagesCount: number;
1126
+ }): void;
1127
+ goToPreviousPage(options: {
1128
+ PageIndex: number;
1129
+ PagesCount: number;
1130
+ }): void;
1131
+ goToPage(options: {
1132
+ PageIndex: number;
1133
+ PagesCount: number;
1134
+ }, pageIndex: number): void;
1135
+ };
1136
+ NextTokenPagingOptions: {
1137
+ goToFirstPage(options: {
1138
+ CurrentToken: string | null;
1139
+ NextPageToken: string | null;
1140
+ }): void;
1141
+ goToNextPage(options: {
1142
+ CurrentToken: string | null;
1143
+ NextPageToken: string | null;
1144
+ }): void;
1145
+ };
1146
+ NextTokenHistoryPagingOptions: {
1147
+ goToFirstPage(options: {
1148
+ PageIndex: number;
1149
+ TokenHistory: (string | null)[];
1150
+ }): void;
1151
+ goToNextPage(options: {
1152
+ PageIndex: number;
1153
+ TokenHistory: (string | null)[];
1154
+ }): void;
1155
+ goToPreviousPage(options: {
1156
+ PageIndex: number;
1157
+ TokenHistory: (string | null)[];
1158
+ }): void;
1159
+ goToPage(options: {
1160
+ PageIndex: number;
1161
+ TokenHistory: (string | null)[];
1162
+ }, pageIndex: number): void;
1163
+ };
1164
+ SortingOptions: {
1165
+ setSortExpression(options: {
1166
+ SortExpression: string | null;
1167
+ SortDescending: boolean;
1168
+ }, sortExpression: string): void;
1169
+ isColumnSortedAscending(options: {
1170
+ SortExpression: string | null;
1171
+ SortDescending: boolean;
1172
+ }, sortExpression: string): boolean;
1173
+ isColumnSortedDescending(options: {
1174
+ SortExpression: string | null;
1175
+ SortDescending: boolean;
1176
+ }, sortExpression: string): boolean;
1177
+ };
1178
+ MultiCriteriaSortingOptions: {
1179
+ setSortExpression(options: {
1180
+ Criteria: {
1181
+ SortExpression: string;
1182
+ SortDescending: boolean;
1183
+ }[];
1184
+ MaxSortCriteriaCount: number;
1185
+ }, sortExpression: string): void;
1186
+ isColumnSortedAscending(options: {
1187
+ Criteria: {
1188
+ SortExpression: string;
1189
+ SortDescending: boolean;
1190
+ }[];
1191
+ MaxSortCriteriaCount: number;
1192
+ }, sortExpression: string): boolean;
1193
+ isColumnSortedDescending(options: {
1194
+ Criteria: {
1195
+ SortExpression: string;
1196
+ SortDescending: boolean;
1197
+ }[];
1198
+ MaxSortCriteriaCount: number;
1199
+ }, sortExpression: string): boolean;
1200
+ };
1201
+ };
1202
+ };
971
1203
  StateManager: typeof StateManager;
972
1204
  DotvvmEvent: typeof events.DotvvmEvent;
973
1205
  };