@ramathibodi/nuxt-commons 0.1.22 → 0.1.23

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 (37) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.d.ts +1 -1
  3. package/dist/module.json +5 -1
  4. package/dist/runtime/components/ExportCSV.vue +22 -13
  5. package/dist/runtime/components/ImportCSV.vue +24 -14
  6. package/dist/runtime/components/document/TemplateBuilder.vue +1 -1
  7. package/dist/runtime/components/form/Table.vue +3 -20
  8. package/dist/runtime/composables/alert.d.ts +1 -1
  9. package/dist/runtime/composables/{alert.mjs → alert.js} +1 -2
  10. package/dist/runtime/composables/api.d.ts +4 -4
  11. package/dist/runtime/composables/api.js +52 -0
  12. package/dist/runtime/composables/document/{template.mjs → template.js} +8 -16
  13. package/dist/runtime/composables/graphql.d.ts +6 -5
  14. package/dist/runtime/composables/{graphql.mjs → graphql.js} +31 -40
  15. package/dist/runtime/composables/graphqlModel.d.ts +17 -17
  16. package/dist/runtime/composables/{graphqlModel.mjs → graphqlModel.js} +18 -33
  17. package/dist/runtime/composables/graphqlModelItem.d.ts +13 -13
  18. package/dist/runtime/composables/{graphqlModelItem.mjs → graphqlModelItem.js} +6 -9
  19. package/dist/runtime/composables/graphqlModelOperation.d.ts +7 -7
  20. package/dist/runtime/composables/{graphqlModelOperation.mjs → graphqlModelOperation.js} +6 -12
  21. package/dist/runtime/composables/graphqlOperation.d.ts +2 -2
  22. package/dist/runtime/composables/{graphqlOperation.mjs → graphqlOperation.js} +15 -28
  23. package/dist/runtime/composables/menu.d.ts +1 -1
  24. package/dist/runtime/composables/{menu.mjs → menu.js} +2 -4
  25. package/dist/runtime/composables/utils/fuzzy.d.ts +1 -1
  26. package/dist/runtime/composables/utils/validation.d.ts +32 -0
  27. package/dist/runtime/plugins/permission.d.ts +1 -1
  28. package/dist/runtime/plugins/{permission.mjs → permission.js} +2 -4
  29. package/dist/runtime/utils/datetime.d.ts +214 -16
  30. package/dist/runtime/utils/{datetime.mjs → datetime.js} +22 -44
  31. package/dist/runtime/utils/{object.mjs → object.js} +1 -2
  32. package/dist/types.d.mts +1 -16
  33. package/dist/types.d.ts +1 -16
  34. package/package.json +34 -34
  35. package/dist/runtime/composables/api.mjs +0 -64
  36. /package/dist/runtime/composables/utils/{fuzzy.mjs → fuzzy.js} +0 -0
  37. /package/dist/runtime/composables/utils/{validation.mjs → validation.js} +0 -0
@@ -1,20 +1,20 @@
1
- import type { FormDialogCallback } from '../types/formDialog';
2
- import { type GraphqlModelConfigProps } from './graphqlModelOperation';
1
+ import type { FormDialogCallback } from '../types/formDialog.js';
2
+ import { type GraphqlModelConfigProps } from './graphqlModelOperation.js';
3
3
  export type GraphqlModelItemProps = Omit<GraphqlModelConfigProps, 'operationSearch' | 'operationReadPageable'>;
4
4
  export declare function useGraphqlModelItem<T extends GraphqlModelItemProps>(props: T): {
5
- modelBy: import("vue").Ref<object | undefined>;
6
- item: import("vue").Ref<Record<string, any> | undefined>;
7
- operationCreate: import("vue").ComputedRef<any>;
8
- operationUpdate: import("vue").ComputedRef<any>;
9
- operationDelete: import("vue").ComputedRef<any>;
10
- operationRead: import("vue").ComputedRef<any>;
11
- fields: import("vue").ComputedRef<any[]>;
5
+ modelBy: import("vue").Ref<object | undefined, object | undefined>;
6
+ item: import("vue").Ref<Record<string, any> | undefined, Record<string, any> | undefined>;
7
+ operationCreate: import("vue").ComputedRef<import("../../../playground/composables/graphqlObject").graphqlOperationObject<any, any>>;
8
+ operationUpdate: import("vue").ComputedRef<import("../../../playground/composables/graphqlObject").graphqlOperationObject<any, any>>;
9
+ operationDelete: import("vue").ComputedRef<import("../../../playground/composables/graphqlObject").graphqlOperationObject<any, any>>;
10
+ operationRead: import("vue").ComputedRef<import("../../../playground/composables/graphqlObject").graphqlOperationObject<any, any>>;
11
+ fields: import("vue").ComputedRef<(string | object)[]>;
12
12
  canCreate: import("vue").ComputedRef<boolean>;
13
13
  canUpdate: import("vue").ComputedRef<boolean>;
14
14
  canDelete: import("vue").ComputedRef<boolean>;
15
- createItem: (createItem: Record<string, any>, callback?: FormDialogCallback) => any;
16
- updateItem: (updateItem: Record<string, any>, callback?: FormDialogCallback) => any;
17
- deleteItem: (item: Record<string, any>, callback?: FormDialogCallback) => any;
15
+ createItem: (createItem: Record<string, any>, callback?: FormDialogCallback) => Promise<void>;
16
+ updateItem: (updateItem: Record<string, any>, callback?: FormDialogCallback) => Promise<void>;
17
+ deleteItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<any>;
18
18
  reload: () => void;
19
- isLoading: import("vue").Ref<boolean>;
19
+ isLoading: import("vue").Ref<boolean, boolean>;
20
20
  };
@@ -1,7 +1,7 @@
1
1
  import { computed, ref, watch } from "vue";
2
- import { useAlert } from "./alert.mjs";
3
- import { buildRequiredInputFields } from "./graphqlOperation.mjs";
4
- import { useGraphqlModelOperation } from "./graphqlModelOperation.mjs";
2
+ import { useAlert } from "./alert.js";
3
+ import { buildRequiredInputFields } from "./graphqlOperation.js";
4
+ import { useGraphqlModelOperation } from "./graphqlModelOperation.js";
5
5
  export function useGraphqlModelItem(props) {
6
6
  const alert = useAlert();
7
7
  const modelBy = ref();
@@ -34,8 +34,7 @@ export function useGraphqlModelItem(props) {
34
34
  reload();
35
35
  }).finally(() => {
36
36
  isLoading.value = false;
37
- if (callback)
38
- callback.done();
37
+ if (callback) callback.done();
39
38
  });
40
39
  }
41
40
  function updateItem(updateItem2, callback) {
@@ -47,8 +46,7 @@ export function useGraphqlModelItem(props) {
47
46
  reload();
48
47
  }).finally(() => {
49
48
  isLoading.value = false;
50
- if (callback)
51
- callback.done();
49
+ if (callback) callback.done();
52
50
  });
53
51
  }
54
52
  function deleteItem(item2, callback) {
@@ -58,8 +56,7 @@ export function useGraphqlModelItem(props) {
58
56
  }).finally(() => {
59
57
  isLoading.value = false;
60
58
  reload();
61
- if (callback)
62
- callback.done();
59
+ if (callback) callback.done();
63
60
  });
64
61
  }
65
62
  function reload() {
@@ -1,4 +1,4 @@
1
- import type { graphqlOperationObject } from '../types/graphqlOperation';
1
+ import type { graphqlOperationObject } from '../types/graphqlOperation.js';
2
2
  export interface GraphqlModelConfigProps {
3
3
  modelName: string;
4
4
  modelKey?: string;
@@ -12,10 +12,10 @@ export interface GraphqlModelConfigProps {
12
12
  fields?: Array<string | object>;
13
13
  }
14
14
  export declare function useGraphqlModelOperation<T extends GraphqlModelConfigProps>(props: T): {
15
- operationCreate: import("vue").ComputedRef<any>;
16
- operationUpdate: import("vue").ComputedRef<any>;
17
- operationDelete: import("vue").ComputedRef<any>;
18
- operationRead: import("vue").ComputedRef<any>;
19
- operationReadPageable: import("vue").ComputedRef<any>;
20
- operationSearch: import("vue").ComputedRef<any>;
15
+ operationCreate: import("vue").ComputedRef<import("#imports").graphqlOperationObject<any, any>>;
16
+ operationUpdate: import("vue").ComputedRef<import("#imports").graphqlOperationObject<any, any>>;
17
+ operationDelete: import("vue").ComputedRef<import("#imports").graphqlOperationObject<any, any>>;
18
+ operationRead: import("vue").ComputedRef<import("#imports").graphqlOperationObject<any, any>>;
19
+ operationReadPageable: import("vue").ComputedRef<import("#imports").graphqlOperationObject<any, any>>;
20
+ operationSearch: import("vue").ComputedRef<import("#imports").graphqlOperationObject<any, any>>;
21
21
  };
@@ -13,8 +13,7 @@ export function useGraphqlModelOperation(props) {
13
13
  const operationCreate = computed(() => {
14
14
  if (props.operationCreate) {
15
15
  if (typeof props.operationCreate === "string") {
16
- if (graphqlOperation[props.operationCreate])
17
- return graphqlOperation[props.operationCreate];
16
+ if (graphqlOperation[props.operationCreate]) return graphqlOperation[props.operationCreate];
18
17
  } else {
19
18
  return props.operationCreate;
20
19
  }
@@ -24,8 +23,7 @@ export function useGraphqlModelOperation(props) {
24
23
  const operationUpdate = computed(() => {
25
24
  if (props.operationUpdate) {
26
25
  if (typeof props.operationUpdate === "string") {
27
- if (graphqlOperation[props.operationUpdate])
28
- return graphqlOperation[props.operationUpdate];
26
+ if (graphqlOperation[props.operationUpdate]) return graphqlOperation[props.operationUpdate];
29
27
  } else {
30
28
  return props.operationUpdate;
31
29
  }
@@ -35,8 +33,7 @@ export function useGraphqlModelOperation(props) {
35
33
  const operationDelete = computed(() => {
36
34
  if (props.operationDelete) {
37
35
  if (typeof props.operationDelete === "string") {
38
- if (graphqlOperation[props.operationDelete])
39
- return graphqlOperation[props.operationDelete];
36
+ if (graphqlOperation[props.operationDelete]) return graphqlOperation[props.operationDelete];
40
37
  } else {
41
38
  return props.operationDelete;
42
39
  }
@@ -46,8 +43,7 @@ export function useGraphqlModelOperation(props) {
46
43
  const operationRead = computed(() => {
47
44
  if (props.operationRead) {
48
45
  if (typeof props.operationRead === "string") {
49
- if (graphqlOperation[props.operationRead])
50
- return graphqlOperation[props.operationRead];
46
+ if (graphqlOperation[props.operationRead]) return graphqlOperation[props.operationRead];
51
47
  } else {
52
48
  return props.operationRead;
53
49
  }
@@ -57,8 +53,7 @@ export function useGraphqlModelOperation(props) {
57
53
  const operationReadPageable = computed(() => {
58
54
  if (props.operationReadPageable) {
59
55
  if (typeof props.operationReadPageable === "string") {
60
- if (graphqlOperation[props.operationReadPageable])
61
- return graphqlOperation[props.operationReadPageable];
56
+ if (graphqlOperation[props.operationReadPageable]) return graphqlOperation[props.operationReadPageable];
62
57
  } else {
63
58
  return props.operationReadPageable;
64
59
  }
@@ -68,8 +63,7 @@ export function useGraphqlModelOperation(props) {
68
63
  const operationSearch = computed(() => {
69
64
  if (props.operationSearch) {
70
65
  if (typeof props.operationSearch === "string") {
71
- if (graphqlOperation[props.operationSearch])
72
- return graphqlOperation[props.operationSearch];
66
+ if (graphqlOperation[props.operationSearch]) return graphqlOperation[props.operationSearch];
73
67
  } else {
74
68
  return props.operationSearch;
75
69
  }
@@ -1,5 +1,5 @@
1
- import { type ClassConstructor } from '../utils/object';
2
- import type { graphqlTypeObject, graphqlVariable } from '../types/graphqlOperation';
1
+ import { type ClassConstructor } from '../utils/object.js';
2
+ import type { graphqlTypeObject, graphqlVariable } from '../types/graphqlOperation.js';
3
3
  export declare function buildFields(operationFields: graphqlTypeObject, fields?: Array<string | Object> | ClassConstructor<any>, depth?: number): Array<string | Object>;
4
4
  export declare function buildVariables(outputVariables?: graphqlVariable[], inputVariables?: {
5
5
  [p: string]: any;
@@ -1,26 +1,19 @@
1
- import { classAttributes, isClassConstructor } from "../utils/object.mjs";
2
- import { useGraphQl } from "./graphql.mjs";
1
+ import { classAttributes, isClassConstructor } from "../utils/object.js";
2
+ import { useGraphQl } from "./graphql.js";
3
3
  import { graphqlInputType, graphqlOperation, graphqlType, scalarType } from "#imports";
4
4
  export function buildFields(operationFields, fields, depth = 0) {
5
- if (!operationFields)
6
- return [];
7
- if (isClassConstructor(fields))
8
- fields = classAttributes(fields);
9
- if (!fields || fields.length == 0)
10
- fields = [...operationFields.fields];
5
+ if (!operationFields) return [];
6
+ if (isClassConstructor(fields)) fields = classAttributes(fields);
7
+ if (!fields || fields.length == 0) fields = [...operationFields.fields];
11
8
  if (fields.includes("*")) {
12
9
  operationFields.fields.forEach((field) => {
13
- if (!fields.includes(field))
14
- fields.push(field);
10
+ if (!fields.includes(field)) fields.push(field);
15
11
  });
16
12
  fields.splice(fields.indexOf("*"), 1);
17
13
  }
18
- if (depth > 0)
19
- operationFields.relations.forEach((relation) => fields.push(relation.name));
20
- if (!fields.includes("timestampField") && operationFields.relations.find((relation) => relation.name == "timestampField"))
21
- fields.push("timestampField");
22
- if (!fields.includes("userstampField") && operationFields.relations.find((relation) => relation.name == "userstampField"))
23
- fields.push("userstampField");
14
+ if (depth > 0) operationFields.relations.forEach((relation) => fields.push(relation.name));
15
+ if (!fields.includes("timestampField") && operationFields.relations.find((relation) => relation.name == "timestampField")) fields.push("timestampField");
16
+ if (!fields.includes("userstampField") && operationFields.relations.find((relation) => relation.name == "userstampField")) fields.push("userstampField");
24
17
  return fields.map((field) => {
25
18
  if (typeof field == "string" && !operationFields?.fields?.includes(field)) {
26
19
  const relationField = operationFields?.relations?.find((relation) => relation.name == field);
@@ -42,8 +35,7 @@ export function buildFields(operationFields, fields, depth = 0) {
42
35
  }).filter((field) => !!field);
43
36
  }
44
37
  export function buildVariables(outputVariables, inputVariables, reject, isRoot = true) {
45
- if (!outputVariables)
46
- return void 0;
38
+ if (!outputVariables) return void 0;
47
39
  if (inputVariables) {
48
40
  outputVariables.map((variable) => {
49
41
  if (variable.type && !scalarType.includes(variable.type)) {
@@ -77,8 +69,7 @@ export function buildVariables(outputVariables, inputVariables, reject, isRoot =
77
69
  });
78
70
  const usedVariables = outputVariables.map((variable) => variable.name);
79
71
  const droppedVariable = Object.keys(inputVariables || {}).filter((key) => !usedVariables.includes(key));
80
- if (droppedVariable.length > 0)
81
- console.debug("There is data not appeared in schema and dropped before operation.", droppedVariable);
72
+ if (droppedVariable.length > 0) console.debug("There is data not appeared in schema and dropped before operation.", droppedVariable);
82
73
  return outputVariables.reduce((acc, item) => {
83
74
  acc[item.name] = isRoot ? item : item.value;
84
75
  return acc;
@@ -89,8 +80,7 @@ export function buildRequiredInputFields(variables, inputField = "input") {
89
80
  if (inputVariable) {
90
81
  const returnFields = [];
91
82
  graphqlInputType[inputVariable.type]?.variables?.forEach((variable) => {
92
- if (variable.required)
93
- returnFields.push(variable.name);
83
+ if (variable.required) returnFields.push(variable.name);
94
84
  });
95
85
  return returnFields;
96
86
  } else {
@@ -110,12 +100,9 @@ export function useGraphQlOperation(operationType, operation, fields, variables,
110
100
  }
111
101
  if (graphqlOperation[operation]?.fields) {
112
102
  fields = buildFields(graphqlOperation[operation]?.fields, fields, 0);
113
- if (operationType == "Query")
114
- useGraphQl().queryPromise(operation, fields, variables, cache).then((result) => resolve(result)).catch((error) => reject(error));
115
- else if (operationType == "Mutation")
116
- useGraphQl().mutationPromise(operation, fields, variables).then((result) => resolve(result)).catch((error) => reject(error));
117
- else
118
- reject("Invalid Operation Type");
103
+ if (operationType == "Query") useGraphQl().queryPromise(operation, fields, variables, cache).then((result) => resolve(result)).catch((error) => reject(error));
104
+ else if (operationType == "Mutation") useGraphQl().mutationPromise(operation, fields, variables).then((result) => resolve(result)).catch((error) => reject(error));
105
+ else reject("Invalid Operation Type");
119
106
  } else {
120
107
  reject("No schema of return data available");
121
108
  }
@@ -1,6 +1,6 @@
1
1
  import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
2
2
  import { type RouteRecordNormalized, type RouteRecordRaw } from 'vue-router';
3
- import { type MenuItem } from '../types/menu';
3
+ import { type MenuItem } from '../types/menu.js';
4
4
  export interface MenuProvide {
5
5
  menuAll: Ref<MenuItem[]>;
6
6
  menuByRoute: ComputedRef<MenuItem[]>;
@@ -22,8 +22,7 @@ export function routeToMenuItem(route) {
22
22
  const menuItems = new Array();
23
23
  for (const children of route.children) {
24
24
  const childMenuItem = routeToMenuItem(children);
25
- if (childMenuItem)
26
- menuItems.push(childMenuItem);
25
+ if (childMenuItem) menuItems.push(childMenuItem);
27
26
  menuItem.menuItems = menuItems;
28
27
  }
29
28
  }
@@ -38,8 +37,7 @@ export function createMenu() {
38
37
  if (paths.length == 2) {
39
38
  if (route.path != "/login" && route.path != "/") {
40
39
  const menuItem = routeToMenuItem(route);
41
- if (menuItem)
42
- menuAll.value.push(menuItem);
40
+ if (menuItem) menuAll.value.push(menuItem);
43
41
  }
44
42
  }
45
43
  }
@@ -1,2 +1,2 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
- export declare function useFuzzy(searchTerm: MaybeRefOrGetter<string>, items: MaybeRefOrGetter<any[]>, fieldName: MaybeRefOrGetter<string[]>, options?: MaybeRefOrGetter<Record<string, any>>): import("vue").ComputedRef<Fuse.FuseResult<DataItem>[]>;
2
+ export declare function useFuzzy(searchTerm: MaybeRefOrGetter<string>, items: MaybeRefOrGetter<any[]>, fieldName: MaybeRefOrGetter<string[]>, options?: MaybeRefOrGetter<Record<string, any>>): import("vue").ComputedRef<import("fuse.js").FuseResult<any>[]>;
@@ -30,5 +30,37 @@ export declare function useRules(): {
30
30
  email: (customError?: string) => (value: any) => string | true;
31
31
  regex: (regex: RegExp | string, customError?: string) => (value: any) => string | true;
32
32
  idcard: (customError?: string) => (value: any) => string | true;
33
+ }, {
34
+ require: (customError?: string) => (value: any) => string | true;
35
+ requireIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
36
+ requireTrue: (customError?: string) => (value: any) => string | true;
37
+ requireTrueIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
38
+ numeric: (customError?: string) => (value: any) => string | true;
39
+ range: (minValue: number, maxValue: number, customError?: string) => (value: any) => string | true;
40
+ integer: (customError?: string) => (value: any) => string | true;
41
+ unique: (data: Array<any> | object, fieldName: string, customError?: string) => (value: any) => string | true;
42
+ length: (length: number, customError?: string) => (value: any) => string | true;
43
+ lengthGreater: (length: number, customError?: string) => (value: any) => string | true;
44
+ lengthLess: (length: number, customError?: string) => (value: any) => string | true;
45
+ telephone: (customError?: string) => (value: any) => string | true;
46
+ email: (customError?: string) => (value: any) => string | true;
47
+ regex: (regex: RegExp | string, customError?: string) => (value: any) => string | true;
48
+ idcard: (customError?: string) => (value: any) => string | true;
49
+ } | {
50
+ require: (customError?: string) => (value: any) => string | true;
51
+ requireIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
52
+ requireTrue: (customError?: string) => (value: any) => string | true;
53
+ requireTrueIf: (conditionIf: boolean, customError?: string) => (value: any) => string | true;
54
+ numeric: (customError?: string) => (value: any) => string | true;
55
+ range: (minValue: number, maxValue: number, customError?: string) => (value: any) => string | true;
56
+ integer: (customError?: string) => (value: any) => string | true;
57
+ unique: (data: Array<any> | object, fieldName: string, customError?: string) => (value: any) => string | true;
58
+ length: (length: number, customError?: string) => (value: any) => string | true;
59
+ lengthGreater: (length: number, customError?: string) => (value: any) => string | true;
60
+ lengthLess: (length: number, customError?: string) => (value: any) => string | true;
61
+ telephone: (customError?: string) => (value: any) => string | true;
62
+ email: (customError?: string) => (value: any) => string | true;
63
+ regex: (regex: RegExp | string, customError?: string) => (value: any) => string | true;
64
+ idcard: (customError?: string) => (value: any) => string | true;
33
65
  }>;
34
66
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
2
  export default _default;
@@ -2,8 +2,7 @@ import { defineNuxtPlugin } from "nuxt/app";
2
2
  import { useAuthentication } from "#imports";
3
3
  export default defineNuxtPlugin(async (nuxtApp) => {
4
4
  function permission(permissionId) {
5
- if (!permissionId || useAuthentication()?.hasPermission(permissionId) === void 0)
6
- return true;
5
+ if (!permissionId || useAuthentication()?.hasPermission(permissionId) === void 0) return true;
7
6
  return useAuthentication()?.hasPermission(permissionId);
8
7
  }
9
8
  nuxtApp.vueApp.config.globalProperties.$permission = permission;
@@ -15,8 +14,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
15
14
  um();
16
15
  });
17
16
  }
18
- if (el.parentElement)
19
- el.parentElement.removeChild(el);
17
+ if (el.parentElement) el.parentElement.removeChild(el);
20
18
  }
21
19
  }
22
20
  });
@@ -4,22 +4,220 @@ export type dateFormat = 'tinyDate' | 'monthShortDate' | 'shortDate' | 'longDate
4
4
  export type dateTimeFormat = 'tinyDateTime' | 'shortDateTime' | 'longDateTime';
5
5
  export declare const Datetime: () => {
6
6
  luxonDateTime: DateTime<false>;
7
- fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
8
- fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
9
- fromISO: (dateTime: string, locale?: supportedLocale) => any;
10
- fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
11
- setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
12
- toFormat: (format: string, locale?: supportedLocale) => any;
13
- toISO: () => any;
14
- toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => any;
15
- toTinyDate: (locale?: supportedLocale) => any;
16
- toMonthShortDate: (locale?: supportedLocale) => any;
17
- toShortDate: (locale?: supportedLocale) => any;
18
- toLongDate: (locale?: supportedLocale) => any;
19
- toTinyDateTime: (locale?: supportedLocale) => any;
20
- toShortDateTime: (locale?: supportedLocale) => any;
21
- toLongDateTime: (locale?: supportedLocale) => any;
22
- now: () => any;
7
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => {
8
+ luxonDateTime: DateTime<false>;
9
+ fromString: any;
10
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
11
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
12
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
13
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
14
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
15
+ toISO: () => null;
16
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
17
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
18
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
19
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
20
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
21
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
22
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
23
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
24
+ now: () => any;
25
+ };
26
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => {
27
+ luxonDateTime: DateTime<false>;
28
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
29
+ fromStringTime: any;
30
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
31
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
32
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
33
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
34
+ toISO: () => null;
35
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
36
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
37
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
38
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
39
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
40
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
41
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
42
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
43
+ now: () => any;
44
+ };
45
+ fromISO: (dateTime: string, locale?: supportedLocale) => {
46
+ luxonDateTime: DateTime<false>;
47
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
48
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
49
+ fromISO: any;
50
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
51
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
52
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
53
+ toISO: () => null;
54
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
55
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
56
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
57
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
58
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
59
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
60
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
61
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
62
+ now: () => any;
63
+ };
64
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => {
65
+ luxonDateTime: DateTime<false>;
66
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
67
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
68
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
69
+ fromObject: any;
70
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
71
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
72
+ toISO: () => null;
73
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
74
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
75
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
76
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
77
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
78
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
79
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
80
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
81
+ now: () => any;
82
+ };
83
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => {
84
+ luxonDateTime: DateTime<false>;
85
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
86
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
87
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
88
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
89
+ setDateTime: any;
90
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
91
+ toISO: () => null;
92
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
93
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
94
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
95
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
96
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
97
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
98
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
99
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
100
+ now: () => any;
101
+ };
102
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
103
+ toISO: () => null;
104
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
105
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
106
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
107
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
108
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
109
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
110
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
111
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
112
+ now: () => {
113
+ luxonDateTime: DateTime<false>;
114
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => {
115
+ luxonDateTime: DateTime<false>;
116
+ fromString: any;
117
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
118
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
119
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
120
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
121
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
122
+ toISO: () => null;
123
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
124
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
125
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
126
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
127
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
128
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
129
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
130
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
131
+ now: () => any;
132
+ };
133
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => {
134
+ luxonDateTime: DateTime<false>;
135
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
136
+ fromStringTime: any;
137
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
138
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
139
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
140
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
141
+ toISO: () => null;
142
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
143
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
144
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
145
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
146
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
147
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
148
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
149
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
150
+ now: () => any;
151
+ };
152
+ fromISO: (dateTime: string, locale?: supportedLocale) => {
153
+ luxonDateTime: DateTime<false>;
154
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
155
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
156
+ fromISO: any;
157
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
158
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
159
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
160
+ toISO: () => null;
161
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
162
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
163
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
164
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
165
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
166
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
167
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
168
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
169
+ now: () => any;
170
+ };
171
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => {
172
+ luxonDateTime: DateTime<false>;
173
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
174
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
175
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
176
+ fromObject: any;
177
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => any;
178
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
179
+ toISO: () => null;
180
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
181
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
182
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
183
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
184
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
185
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
186
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
187
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
188
+ now: () => any;
189
+ };
190
+ setDateTime: (inputDate: DateTime, locale?: supportedLocale) => {
191
+ luxonDateTime: DateTime<false>;
192
+ fromString: (dateTime: string | null, formatDate?: string, locale?: supportedLocale) => any;
193
+ fromStringTime: (time: string | null, formatTime?: string, locale?: supportedLocale) => any;
194
+ fromISO: (dateTime: string, locale?: supportedLocale) => any;
195
+ fromObject: (dateTime: DateObjectUnits, locale?: supportedLocale) => any;
196
+ setDateTime: any;
197
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
198
+ toISO: () => null;
199
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
200
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
201
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
202
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
203
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
204
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
205
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
206
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
207
+ now: () => any;
208
+ };
209
+ toFormat: (format: string, locale?: supportedLocale) => "Invalid DateTime";
210
+ toISO: () => null;
211
+ toLocaleFormat: (locale: supportedLocale, format: DateTimeFormatOptions) => "Invalid DateTime";
212
+ toTinyDate: (locale?: supportedLocale) => "Invalid DateTime";
213
+ toMonthShortDate: (locale?: supportedLocale) => "Invalid DateTime";
214
+ toShortDate: (locale?: supportedLocale) => "Invalid DateTime";
215
+ toLongDate: (locale?: supportedLocale) => "Invalid DateTime";
216
+ toTinyDateTime: (locale?: supportedLocale) => "Invalid DateTime";
217
+ toShortDateTime: (locale?: supportedLocale) => "Invalid DateTime";
218
+ toLongDateTime: (locale?: supportedLocale) => "Invalid DateTime";
219
+ now: any;
220
+ };
23
221
  };
24
222
  export declare function verifyDateFormat(date: string): string | null;
25
223
  export declare function returnVerifyDate(date: string): string | null;