dotvvm-types 4.1.0-preview14-final → 4.1.0-preview18-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 +34 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotvvm-types",
3
- "version": "4.1.0-preview14-final",
3
+ "version": "4.1.0-preview18-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
@@ -29,15 +29,15 @@ declare module "utils/logging" {
29
29
  export function debugQuoteString(s: string): string;
30
30
  }
31
31
  declare module "serialization/date" {
32
- export function parseDate(value: string | null, convertFromUtc?: boolean): Date | null;
33
- export function parseDateOnly(value: string | null): Date | null;
34
- export function parseTimeOnly(value: string | null): Date | null;
35
- export function parseTimeSpan(value: string | null): number | null;
36
- export function parseDateTimeOffset(value: string | null): Date | null;
32
+ export function parseDate(value: string | null | undefined, convertFromUtc?: boolean): Date | null;
33
+ export function parseDateOnly(value: string | null | undefined): Date | null;
34
+ export function parseTimeOnly(value: string | null | undefined): Date | null;
35
+ export function parseTimeSpan(value: string | null | undefined): number | null;
36
+ export function parseDateTimeOffset(value: string | null | undefined): Date | null;
37
37
  export function serializeDate(date: string | Date | null, convertToUtc?: boolean): string | null;
38
- export function serializeDateOnly(date: Date | null): string | null;
39
- export function serializeTimeOnly(date: Date | null): string | null;
40
- export function serializeTimeSpan(time: string | number | null): string | null;
38
+ export function serializeDateOnly(date: Date): string;
39
+ export function serializeTimeOnly(date: Date): string;
40
+ export function serializeTimeSpan(ticks: number): string;
41
41
  }
42
42
  declare module "utils/dom" {
43
43
  export const getElementByDotvvmId: (id: string) => HTMLElement;
@@ -73,6 +73,7 @@ declare module "metadata/typeMap" {
73
73
  export function getKnownTypes(): string[];
74
74
  export function updateTypeInfo(newTypes: TypeMap | undefined): void;
75
75
  export function replaceTypeInfo(newTypes: TypeMap | undefined): void;
76
+ export function areObjectTypesEqual(currentValue: any, newVal: any): boolean;
76
77
  }
77
78
  declare module "events" {
78
79
  export class DotvvmEvent<T> {
@@ -212,7 +213,11 @@ declare module "state-manager" {
212
213
  patchState(patch: Partial<TViewModel>): DeepReadonly<TViewModel>;
213
214
  update(updater: StateUpdate<TViewModel>): DeepReadonly<TViewModel>;
214
215
  }
215
- export function unmapKnockoutObservables(viewModel: any): any;
216
+ /**
217
+ * Recursively unwraps knockout observables from the object / array hierarchy. When nothing needs to be unwrapped, the original object is returned.
218
+ * @param allowStateUnwrap Allows accessing [currentStateSymbol], which makes it faster, but doesn't register in the knockout dependency tracker
219
+ */
220
+ export function unmapKnockoutObservables(viewModel: any, allowStateUnwrap?: boolean): any;
216
221
  }
217
222
  declare module "serialization/deserialize" {
218
223
  export function deserialize(viewModel: any, target?: any, deserializeAll?: boolean): any;
@@ -221,6 +226,9 @@ declare module "serialization/deserialize" {
221
226
  export function deserializeArray(viewModel: any, target?: any, deserializeAll?: boolean): any;
222
227
  export function deserializeObject(viewModel: any, target: any, deserializeAll: boolean): any;
223
228
  export function extendToObservableArrayIfRequired(observable: any): any;
229
+ /** Clones only updatable properties from the object.
230
+ * Used after postback, to avoid updating properties which were sent to server, but weren't sent back. */
231
+ export function mapUpdatableProperties(viewModel: any, type?: TypeDefinition | undefined): any;
224
232
  }
225
233
  declare module "serialization/serialize" {
226
234
  interface ISerializationOptions {
@@ -419,7 +427,9 @@ declare module "binding-handlers/file-upload" {
419
427
  declare module "binding-handlers/js-component" {
420
428
  const _default_11: {
421
429
  "dotvvm-js-component": {
422
- init(element: HTMLInputElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): void;
430
+ init(element: HTMLInputElement, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor): {
431
+ controlsDescendantBindings: boolean;
432
+ };
423
433
  };
424
434
  };
425
435
  export default _default_11;
@@ -460,7 +470,7 @@ declare module "DotVVM.Globalize" {
460
470
  type GlobalizeFormattable = null | undefined | string | Date | number;
461
471
  export function formatString(format: string | null | undefined, value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, type: string | null): string;
462
472
  export function parseNumber(value: string): number;
463
- export function parseDate(value: string, format: string, previousValue?: Date): Date | null;
473
+ export function parseDate(value: string, format: string, previousValue?: Date | null): Date | null;
464
474
  export const parseDotvvmDate: typeof serializationParseDate;
465
475
  export function bindingDateToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
466
476
  export function bindingDateOnlyToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
@@ -635,6 +645,18 @@ declare module "postback/postback" {
635
645
  export function isPostbackHandler(obj: any): obj is DotvvmPostbackHandler;
636
646
  export function sortHandlers(handlers: DotvvmPostbackHandler[]): DotvvmPostbackHandler[];
637
647
  }
648
+ declare module "api/eventHub" {
649
+ export function notify(id: string): void;
650
+ export function get(id: string): KnockoutObservable<number>;
651
+ }
652
+ declare module "api/api" {
653
+ type ApiComputed<T> = KnockoutComputed<T | null> & {
654
+ refreshValue: () => PromiseLike<any>;
655
+ };
656
+ export function invoke<T>(target: any, methodName: string, argsProvider: () => any[], refreshTriggers: (args: any[]) => Array<KnockoutObservable<any> | string>, notifyTriggers: (args: any[]) => string[], cacheElement: HTMLElement, sharingKeyProvider: (args: any[]) => string[], lifetimeElement: HTMLElement): ApiComputed<T>;
657
+ export function refreshOn<T>(value: ApiComputed<T>, watch: KnockoutObservable<any>): ApiComputed<T>;
658
+ export function clearApiCachedValues(): void;
659
+ }
638
660
  declare module "spa/navigation" {
639
661
  export function navigateCore(url: string, options: PostbackOptions, handlePageNavigating: (url: string) => void): Promise<DotvvmNavigationEventArgs>;
640
662
  }
@@ -660,17 +682,6 @@ declare module "controls/fileUpload" {
660
682
  export function showUploadDialog(sender: HTMLElement): void;
661
683
  export function reportProgress(inputControl: HTMLInputElement, isBusy: boolean, progress: number, result: DotvvmStaticCommandResponse<DotvvmFileUploadData[]> | string): void;
662
684
  }
663
- declare module "api/eventHub" {
664
- export function notify(id: string): void;
665
- export function get(id: string): KnockoutObservable<number>;
666
- }
667
- declare module "api/api" {
668
- type ApiComputed<T> = KnockoutObservable<T | null> & {
669
- refreshValue: () => PromiseLike<any>;
670
- };
671
- export function invoke<T>(target: any, methodName: string, argsProvider: () => any[], refreshTriggers: (args: any[]) => Array<KnockoutObservable<any> | string>, notifyTriggers: (args: any[]) => string[], element: HTMLElement, sharingKeyProvider: (args: any[]) => string[]): ApiComputed<T>;
672
- export function refreshOn<T>(value: ApiComputed<T>, watch: KnockoutObservable<any>): ApiComputed<T>;
673
- }
674
685
  declare module "metadata/metadataHelper" {
675
686
  export function getTypeId(viewModel: object): string | undefined;
676
687
  export function getTypeMetadata(typeId: string): TypeMetadata;
@@ -1094,7 +1105,7 @@ declare type TypeMetadata = ObjectTypeMetadata | EnumTypeMetadata;
1094
1105
  declare type PropertyMetadata = {
1095
1106
  type: TypeDefinition;
1096
1107
  post?: "always" | "pathOnly" | "no";
1097
- update?: "always" | "firstRequest" | "no";
1108
+ update?: "always" | "no";
1098
1109
  validationRules?: PropertyValidationRuleInfo[];
1099
1110
  clientExtenders?: ClientExtenderInfo[];
1100
1111
  };