dotvvm-types 4.1.0-preview11-final → 4.1.0-preview13-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.
- package/package.json +1 -1
- package/types/index.d.ts +40 -10
package/package.json
CHANGED
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
|
|
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,21 +674,21 @@ 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 "
|
|
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 "
|
|
671
|
-
import { orderBy, orderByDesc } from "
|
|
672
|
-
export { add, addOrUpdate, addRange, clear, distinct, firstOrDefault, insert, insertRange, lastOrDefault, max, min, orderBy, orderByDesc, removeAll, removeAt, removeFirst, removeLast, removeRange, reverse, setItem };
|
|
683
|
+
declare module "translations/arrayHelper" {
|
|
684
|
+
import { orderBy, orderByDesc } from "translations/sortingHelper";
|
|
685
|
+
export { add, addOrUpdate, addRange, clear, distinct, contains, 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;
|
|
675
688
|
function addRange<T>(observable: any, elements: T[]): void;
|
|
676
689
|
function clear(observable: any): void;
|
|
677
690
|
function distinct<T>(array: T[]): T[];
|
|
691
|
+
function contains<T>(array: T[], value: T): boolean;
|
|
678
692
|
function firstOrDefault<T>(array: T[], predicate: (s: T) => boolean): T | null;
|
|
679
693
|
function insert<T>(observable: any, index: number, element: T): void;
|
|
680
694
|
function insertRange<T>(observable: any, index: number, elements: T[]): void;
|
|
@@ -689,7 +703,7 @@ declare module "collections/arrayHelper" {
|
|
|
689
703
|
function reverse<T>(observable: any): void;
|
|
690
704
|
function setItem<T>(observable: any, index: number, value: T): void;
|
|
691
705
|
}
|
|
692
|
-
declare module "
|
|
706
|
+
declare module "translations/dictionaryHelper" {
|
|
693
707
|
type Dictionary<Key, Value> = {
|
|
694
708
|
Key: Key;
|
|
695
709
|
Value: Value;
|
|
@@ -700,7 +714,7 @@ declare module "collections/dictionaryHelper" {
|
|
|
700
714
|
export function remove<Key, Value>(observable: any, identifier: Key): boolean;
|
|
701
715
|
export function setItem<Key, Value>(observable: any, identifier: Key, value: Value): void;
|
|
702
716
|
}
|
|
703
|
-
declare module "
|
|
717
|
+
declare module "translations/stringHelper" {
|
|
704
718
|
export function contains(haystack: string, needle: string, options: string): boolean;
|
|
705
719
|
export function endsWith(haystack: string, needle: string, options: string): boolean;
|
|
706
720
|
export function startsWith(haystack: string, needle: string, options: string): boolean;
|
|
@@ -712,9 +726,26 @@ declare module "utils/stringHelper" {
|
|
|
712
726
|
export function trimStart(text: string, char: string): string;
|
|
713
727
|
export function trimEnd(text: string, char: string): string;
|
|
714
728
|
}
|
|
715
|
-
declare module "
|
|
729
|
+
declare module "translations/dateTimeHelper" {
|
|
716
730
|
export function toBrowserLocalTime(value: KnockoutObservable<string | null>): KnockoutComputed<string | null>;
|
|
717
731
|
}
|
|
732
|
+
declare module "translations/translations" {
|
|
733
|
+
import * as array from "translations/arrayHelper";
|
|
734
|
+
import * as dictionary from "translations/dictionaryHelper";
|
|
735
|
+
import * as string from "translations/stringHelper";
|
|
736
|
+
import * as dateTime from "translations/dateTimeHelper";
|
|
737
|
+
const _default_13: Readonly<{
|
|
738
|
+
array: typeof array;
|
|
739
|
+
dictionary: typeof dictionary;
|
|
740
|
+
string: typeof string;
|
|
741
|
+
dateTime: typeof dateTime;
|
|
742
|
+
enums: {
|
|
743
|
+
fromInt(value: any, type: string): any;
|
|
744
|
+
toInt(value: any, type: string): number | null;
|
|
745
|
+
};
|
|
746
|
+
}>;
|
|
747
|
+
export default _default_13;
|
|
748
|
+
}
|
|
718
749
|
declare module "dotvvm-root" {
|
|
719
750
|
import { getCulture } from "dotvvm-base";
|
|
720
751
|
import * as events from "events";
|
|
@@ -803,7 +834,6 @@ declare module "dotvvm-root" {
|
|
|
803
834
|
getTypeId: typeof metadataHelper.getTypeId;
|
|
804
835
|
getTypeMetadata: typeof metadataHelper.getTypeMetadata;
|
|
805
836
|
getEnumMetadata: typeof metadataHelper.getEnumMetadata;
|
|
806
|
-
getEnumValue: typeof metadataHelper.getEnumValue;
|
|
807
837
|
};
|
|
808
838
|
viewModules: {
|
|
809
839
|
registerOne: typeof viewModuleManager.registerViewModule;
|