dotvvm-types 4.1.0-preview11-final → 4.1.0-preview12-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 +38 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotvvm-types",
3
- "version": "4.1.0-preview11-final",
3
+ "version": "4.1.0-preview12-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,9 +29,13 @@ declare module "utils/logging" {
29
29
  }
30
30
  declare module "serialization/date" {
31
31
  export function parseDate(value: string | null, convertFromUtc?: boolean): Date | null;
32
+ export function parseDateOnly(value: string | null): Date | null;
33
+ export function parseTimeOnly(value: string | null): Date | null;
32
34
  export function parseTimeSpan(value: string | null): number | null;
33
35
  export function parseDateTimeOffset(value: string | null): Date | null;
34
36
  export function serializeDate(date: string | Date | null, convertToUtc?: boolean): string | null;
37
+ export function serializeDateOnly(date: Date | null): string | null;
38
+ export function serializeTimeOnly(date: Date | null): string | null;
35
39
  export function serializeTimeSpan(time: string | number | null): string | null;
36
40
  }
37
41
  declare module "utils/dom" {
@@ -98,6 +102,14 @@ declare module "events" {
98
102
  export const staticCommandMethodFailed: DotvvmEvent<DotvvmStaticCommandMethodFailedEventArgs>;
99
103
  export const newState: DotvvmEvent<RootViewModel>;
100
104
  }
105
+ declare module "utils/isNumber" {
106
+ export function isNumber(value: any): boolean;
107
+ }
108
+ declare module "metadata/enums" {
109
+ export function enumStringToInt(value: number | string, type: EnumTypeMetadata): number | null;
110
+ export function enumIntToString(value: number, type: EnumTypeMetadata): string | null;
111
+ export function tryCoerceEnum(value: any, type: EnumTypeMetadata): CoerceResult;
112
+ }
101
113
  declare module "metadata/primitiveTypes" {
102
114
  type PrimitiveTypes = {
103
115
  [name: string]: {
@@ -445,11 +457,13 @@ declare module "DotVVM.Globalize" {
445
457
  import { parseDate as serializationParseDate } from "serialization/date";
446
458
  export function format(format: string, ...values: any[]): string;
447
459
  type GlobalizeFormattable = null | undefined | string | Date | number;
448
- export function formatString(format: string | null | undefined, value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>): string;
460
+ export function formatString(format: string | null | undefined, value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, type: string | null): string;
449
461
  export function parseNumber(value: string): number;
450
462
  export function parseDate(value: string, format: string, previousValue?: Date): Date | null;
451
463
  export const parseDotvvmDate: typeof serializationParseDate;
452
464
  export function bindingDateToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
465
+ export function bindingDateOnlyToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
466
+ export function bindingTimeOnlyToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
453
467
  export function bindingNumberToString(value: GlobalizeFormattable | KnockoutObservable<GlobalizeFormattable>, format?: string): KnockoutComputed<string>;
454
468
  }
455
469
  declare var compileConstants: {
@@ -660,15 +674,14 @@ declare module "metadata/metadataHelper" {
660
674
  export function getTypeId(viewModel: object): string | undefined;
661
675
  export function getTypeMetadata(typeId: string): TypeMetadata;
662
676
  export function getEnumMetadata(enumMetadataId: string): EnumTypeMetadata;
663
- export function getEnumValue(identifier: string | number, enumMetadataId: string): number | undefined;
664
677
  }
665
- declare module "collections/sortingHelper" {
678
+ declare module "translations/sortingHelper" {
666
679
  type ElementType = string | number | boolean;
667
680
  export const orderBy: <T>(array: T[], selector: (item: T) => ElementType, typeId: string) => T[];
668
681
  export const orderByDesc: <T>(array: T[], selector: (item: T) => ElementType, typeId: string) => T[];
669
682
  }
670
- declare module "collections/arrayHelper" {
671
- import { orderBy, orderByDesc } from "collections/sortingHelper";
683
+ declare module "translations/arrayHelper" {
684
+ import { orderBy, orderByDesc } from "translations/sortingHelper";
672
685
  export { add, addOrUpdate, addRange, clear, distinct, firstOrDefault, insert, insertRange, lastOrDefault, max, min, orderBy, orderByDesc, removeAll, removeAt, removeFirst, removeLast, removeRange, reverse, setItem };
673
686
  function add<T>(observable: any, element: T): void;
674
687
  function addOrUpdate<T>(observable: any, element: T, matcher: (e: T) => boolean, updater: (e: T) => T): void;
@@ -689,7 +702,7 @@ declare module "collections/arrayHelper" {
689
702
  function reverse<T>(observable: any): void;
690
703
  function setItem<T>(observable: any, index: number, value: T): void;
691
704
  }
692
- declare module "collections/dictionaryHelper" {
705
+ declare module "translations/dictionaryHelper" {
693
706
  type Dictionary<Key, Value> = {
694
707
  Key: Key;
695
708
  Value: Value;
@@ -700,7 +713,7 @@ declare module "collections/dictionaryHelper" {
700
713
  export function remove<Key, Value>(observable: any, identifier: Key): boolean;
701
714
  export function setItem<Key, Value>(observable: any, identifier: Key, value: Value): void;
702
715
  }
703
- declare module "utils/stringHelper" {
716
+ declare module "translations/stringHelper" {
704
717
  export function contains(haystack: string, needle: string, options: string): boolean;
705
718
  export function endsWith(haystack: string, needle: string, options: string): boolean;
706
719
  export function startsWith(haystack: string, needle: string, options: string): boolean;
@@ -712,9 +725,26 @@ declare module "utils/stringHelper" {
712
725
  export function trimStart(text: string, char: string): string;
713
726
  export function trimEnd(text: string, char: string): string;
714
727
  }
715
- declare module "utils/dateTimeHelper" {
728
+ declare module "translations/dateTimeHelper" {
716
729
  export function toBrowserLocalTime(value: KnockoutObservable<string | null>): KnockoutComputed<string | null>;
717
730
  }
731
+ declare module "translations/translations" {
732
+ import * as array from "translations/arrayHelper";
733
+ import * as dictionary from "translations/dictionaryHelper";
734
+ import * as string from "translations/stringHelper";
735
+ import * as dateTime from "translations/dateTimeHelper";
736
+ const _default_13: Readonly<{
737
+ array: typeof array;
738
+ dictionary: typeof dictionary;
739
+ string: typeof string;
740
+ dateTime: typeof dateTime;
741
+ enums: {
742
+ fromInt(value: any, type: string): any;
743
+ toInt(value: any, type: string): number | null;
744
+ };
745
+ }>;
746
+ export default _default_13;
747
+ }
718
748
  declare module "dotvvm-root" {
719
749
  import { getCulture } from "dotvvm-base";
720
750
  import * as events from "events";
@@ -803,7 +833,6 @@ declare module "dotvvm-root" {
803
833
  getTypeId: typeof metadataHelper.getTypeId;
804
834
  getTypeMetadata: typeof metadataHelper.getTypeMetadata;
805
835
  getEnumMetadata: typeof metadataHelper.getEnumMetadata;
806
- getEnumValue: typeof metadataHelper.getEnumValue;
807
836
  };
808
837
  viewModules: {
809
838
  registerOne: typeof viewModuleManager.registerViewModule;