alepha 0.11.6 → 0.11.9

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/command.d.ts CHANGED
@@ -201,8 +201,8 @@ declare class CliProvider {
201
201
  protected readonly runner: Runner;
202
202
  protected readonly asker: Asker;
203
203
  protected readonly options: Readonly<{
204
- name?: string | undefined;
205
204
  description?: string | undefined;
205
+ name?: string | undefined;
206
206
  argv?: string[] | undefined;
207
207
  }>;
208
208
  protected get name(): string;
package/core.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
2
  import { Validator } from "typebox/compile";
3
- import * as TypeBoxValue from "typebox/value";
4
3
  import * as TypeBox from "typebox";
5
- import { Static as Static$1, StaticDecode, StaticDecode as Static, StaticDecode as StaticDecode$1, StaticEncode, StaticEncode as StaticEncode$1, TAny, TAny as TAny$1, TArray, TArray as TArray$1, TArrayOptions, TBigInt, TBoolean, TBoolean as TBoolean$1, TInteger, TInteger as TInteger$1, TKeysToIndexer, TKeysToIndexer as TKeysToIndexer$1, TNull, TNull as TNull$1, TNumber, TNumber as TNumber$1, TNumberOptions, TNumberOptions as TNumberOptions$1, TObject, TObject as TObject$1, TObjectOptions, TObjectOptions as TObjectOptions$1, TOmit, TOptional, TOptionalAdd, TOptionalAdd as TOptionalAdd$1, TPick, TPick as TPick$1, TProperties, TProperties as TProperties$1, TRecord, TRecord as TRecord$1, TSchema, TSchema as TSchema$1, TSchemaOptions, TString, TString as TString$1, TStringOptions, TStringOptions as TStringOptions$1, TTuple, TUnion, TUnion as TUnion$1, TUnsafe, TUnsafe as TUnsafe$1, TVoid } from "typebox";
4
+ import { Static as Static$1, StaticDecode, StaticDecode as Static, StaticEncode, StaticEncode as StaticEncode$1, TAny, TAny as TAny$1, TArray, TArray as TArray$1, TArrayOptions, TBigInt, TBoolean, TBoolean as TBoolean$1, TInteger, TInteger as TInteger$1, TInterface, TKeysToIndexer, TKeysToIndexer as TKeysToIndexer$1, TNull, TNull as TNull$1, TNumber, TNumber as TNumber$1, TNumberOptions, TNumberOptions as TNumberOptions$1, TObject, TObject as TObject$1, TObjectOptions, TObjectOptions as TObjectOptions$1, TOmit, TOptional, TOptionalAdd, TOptionalAdd as TOptionalAdd$1, TPartial, TPick, TPick as TPick$1, TProperties, TProperties as TProperties$1, TRecord, TRecord as TRecord$1, TSchema, TSchema as TSchema$1, TSchemaOptions, TString, TString as TString$1, TStringOptions, TStringOptions as TStringOptions$1, TTuple, TUnion, TUnion as TUnion$1, TUnsafe, TUnsafe as TUnsafe$1, TVoid } from "typebox";
6
5
  import TypeBoxFormat from "typebox/format";
6
+ import * as TypeBoxValue from "typebox/value";
7
7
  import { TLocalizedValidationError } from "typebox/error";
8
8
  import { Readable } from "node:stream";
9
9
  import { ReadableStream as ReadableStream$1 } from "node:stream/web";
@@ -382,8 +382,11 @@ type TStream = TUnsafe$1<StreamLike>;
382
382
  declare const isUUID: typeof TypeBoxFormat.IsUuid;
383
383
  declare const isEmail: typeof TypeBoxFormat.IsEmail;
384
384
  declare const isURL: typeof TypeBoxFormat.IsUrl;
385
+ declare const isDateTime: typeof TypeBoxFormat.IsDateTime;
386
+ declare const isDate: typeof TypeBoxFormat.IsDate;
387
+ declare const isTime: typeof TypeBoxFormat.IsTime;
388
+ declare const isDuration: typeof TypeBoxFormat.IsDuration;
385
389
  declare class TypeGuard {
386
- isFile: (value: TSchema$1) => value is TFile;
387
390
  isBigInt: (value: TSchema$1) => value is TString$1;
388
391
  isUUID: (value: TSchema$1) => value is TString$1;
389
392
  isObject: typeof TypeBox.IsObject;
@@ -403,6 +406,11 @@ declare class TypeGuard {
403
406
  isVoid: typeof TypeBox.IsVoid;
404
407
  isLiteral: typeof TypeBox.IsLiteral;
405
408
  isSchema: typeof TypeBox.IsSchema;
409
+ isFile: (value: TSchema$1) => value is TFile;
410
+ isDateTime: (schema: unknown) => boolean;
411
+ isDate: (schema: unknown) => boolean;
412
+ isTime: (schema: unknown) => boolean;
413
+ isDuration: (schema: unknown) => boolean;
406
414
  }
407
415
  declare module "typebox" {
408
416
  interface TString {
@@ -467,14 +475,11 @@ declare class TypeProvider {
467
475
  void: typeof TypeBox.Void;
468
476
  undefined: typeof TypeBox.Undefined;
469
477
  record: typeof TypeBox.Record;
470
- partial: typeof TypeBox.Partial;
471
478
  union: typeof TypeBox.Union;
472
479
  tuple: typeof TypeBox.Tuple;
473
- interface: typeof TypeBox.Interface;
474
480
  null: typeof TypeBox.Null;
475
481
  const: typeof TypeBox.Literal;
476
- codec: typeof TypeBox.Codec;
477
- literal: typeof TypeBox.Literal;
482
+ options: typeof TypeBox.Options;
478
483
  /**
479
484
  * Type guards to check the type of schema.
480
485
  * This is not a runtime type check, but a compile-time type guard.
@@ -487,8 +492,11 @@ declare class TypeProvider {
487
492
  * ```
488
493
  */
489
494
  readonly schema: TypeGuard;
495
+ extend<T extends TSchema$1[], U$1 extends TProperties$1>(schema: [...T], properties: U$1, options?: TSchemaOptions): TInterface<T, U$1>;
496
+ extend<T extends TObject$1, U$1 extends TProperties$1>(schema: T, properties: U$1, options?: TSchemaOptions): TInterface<[T], U$1>;
490
497
  pick<T extends TObject$1, Indexer extends PropertyKey[]>(schema: T, keys: [...Indexer], options?: TObjectOptions$1): TPick$1<T, TKeysToIndexer$1<Indexer>>;
491
498
  omit<T extends TObject$1, Indexer extends PropertyKey[]>(schema: T, keys: [...Indexer], options?: TObjectOptions$1): TOmit<T, TKeysToIndexer$1<Indexer>>;
499
+ partial<T extends TSchema$1>(schema: T, options?: TSchemaOptions): TPartial<T>;
492
500
  /**
493
501
  * Create a schema for an object.
494
502
  * By default, additional properties are not allowed.
@@ -575,18 +583,18 @@ declare class TypeProvider {
575
583
  */
576
584
  enum<T extends string[]>(values: [...T], options?: TStringOptions$1): TUnsafe$1<T[number]>;
577
585
  /**
578
- * Create a schema for a bigint.
579
- * This is NOT a BigInt object, but a string that represents a bigint.
586
+ * Create a schema for a bigint represented as a string.
587
+ * This is a string that validates bigint format (e.g. "123456789").
580
588
  */
581
- bigint(options?: TStringOptions$1): TypeBox.TCodec<TString$1, bigint>;
589
+ bigint(options?: TStringOptions$1): TString$1;
582
590
  /**
583
- * Create a schema for a url.
591
+ * Create a schema for a URL represented as a string.
584
592
  */
585
- url(options?: TStringOptions$1): TypeBox.TCodec<TString$1, URL>;
593
+ url(options?: TStringOptions$1): TString$1;
586
594
  /**
587
- * Create a schema for binary data represented as a string.
595
+ * Create a schema for binary data represented as a base64 string.
588
596
  */
589
- binary(options: TStringOptions$1): TypeBox.TCodec<TString$1, Uint8Array<ArrayBuffer>>;
597
+ binary(options: TStringOptions$1): TString$1;
590
598
  /**
591
599
  * Create a schema for uuid.
592
600
  */
@@ -635,6 +643,10 @@ declare class TypeProvider {
635
643
  label: TString$1;
636
644
  description: TypeBox.TOptional<TString$1>;
637
645
  }>;
646
+ datetime: (options?: TStringOptions$1) => TString$1;
647
+ date: (options?: TStringOptions$1) => TString$1;
648
+ time: (options?: TStringOptions$1) => TString$1;
649
+ duration: (options?: TStringOptions$1) => TString$1;
638
650
  }
639
651
  type TextLength = "short" | "regular" | "long" | "rich";
640
652
  interface TTextOptions extends TStringOptions$1 {
@@ -662,61 +674,56 @@ declare const t: TypeProvider;
662
674
  //#endregion
663
675
  //#region src/providers/SchemaCodec.d.ts
664
676
  declare abstract class SchemaCodec {
665
- protected cache: Map<TSchema$1, Validator>;
666
- protected guard: TypeGuard;
667
677
  /**
668
678
  * Encode the value to a string format.
669
679
  */
670
- abstract encodeToString(schema: TSchema$1, value: any): string;
680
+ abstract encodeToString<T extends TSchema>(schema: T, value: Static<T>): string;
671
681
  /**
672
682
  * Encode the value to a binary format.
673
683
  */
674
- abstract encodeToBinary(schema: TSchema$1, value: any): Uint8Array;
684
+ abstract encodeToBinary<T extends TSchema>(schema: T, value: Static<T>): Uint8Array;
675
685
  /**
676
- * Transform a specific type for this codec.
677
- * Return undefined to use the default schema, or return a new schema to replace it.
678
- *
679
- * Override this method to customize how specific types are handled in this codec.
680
- * For example, a ProtobufCodec might keep BigInt as-is instead of converting to string.
686
+ * Decode string, binary, or other formats to the schema type.
681
687
  */
682
- protected abstract transformType(schema: TSchema$1): TSchema$1 | false | void;
683
- encode<T extends TSchema$1>(schema: T, value: any): StaticEncode$1<T>;
684
- decode<T extends TSchema$1>(schema: T, value: any): StaticDecode$1<T>;
685
- protected validator<T extends TSchema$1>(schema: T): Validator<{}, T>;
686
- /**
687
- * Transform the schema for this codec.
688
- * Override this method to provide custom schema transformations.
689
- * This method should recursively transform all nested schemas.
690
- */
691
- protected transformSchema<T extends TSchema$1>(schema: T): TSchema$1;
688
+ abstract decode<T>(schema: TSchema, value: unknown): T;
689
+ }
690
+ //#endregion
691
+ //#region src/providers/JsonSchemaCodec.d.ts
692
+ declare class JsonSchemaCodec extends SchemaCodec {
693
+ protected readonly json: Json;
694
+ protected readonly encoder: TextEncoder;
695
+ protected readonly decoder: TextDecoder;
696
+ encodeToString<T extends TSchema$1>(schema: T, value: Static<T>): string;
697
+ encodeToBinary<T extends TSchema$1>(schema: T, value: Static<T>): Uint8Array;
698
+ decode<T>(schema: TSchema$1, value: unknown): T;
699
+ }
700
+ //#endregion
701
+ //#region src/providers/SchemaValidator.d.ts
702
+ declare class SchemaValidator {
703
+ protected cache: Map<TSchema$1, Validator<TypeBox.TProperties, TSchema$1>>;
692
704
  /**
693
- * Preprocess the value based on the schema before encoding.
705
+ * Validate the value against the provided schema.
694
706
  *
695
- * - Remove `undefined` values from objects. { a: 1, b: undefined } => { a: 1 }
707
+ * Validation create a new value by applying some preprocessing. (e.g., trimming text)
696
708
  */
697
- beforeEncode: (schema: any, value: any) => any;
709
+ validate<T extends TSchema$1>(schema: T, value: unknown, options?: ValidateOptions): Static<T>;
710
+ protected getValidator<T extends TSchema$1>(schema: T): Validator<{}, T>;
698
711
  /**
699
712
  * Preprocess the value based on the schema before validation.
700
713
  *
701
714
  * - If the value is `null` and the schema does not allow `null`, it converts it to `undefined`.
702
715
  * - If the value is a string and the schema has a `~options.trim` flag, it trims whitespace from the string.
703
716
  */
704
- beforeDecode: (schema: any, value: any) => any;
717
+ beforeParse(schema: any, value: any, options: ValidateOptions): any;
705
718
  /**
706
- * Used by `preprocess` to determine if a schema allows null values.
719
+ * Used by `beforeParse` to determine if a schema allows null values.
707
720
  */
708
721
  protected isSchemaNullable: (schema: any) => boolean;
709
722
  }
710
- //#endregion
711
- //#region src/providers/JsonSchemaCodec.d.ts
712
- declare class JsonSchemaCodec extends SchemaCodec {
713
- protected readonly json: Json;
714
- protected readonly encoder: TextEncoder;
715
- protected readonly decoder: TextDecoder;
716
- protected transformType(schema: TSchema$1): TSchema$1 | false | void;
717
- encodeToString(schema: TSchema$1, value: any): string;
718
- encodeToBinary(schema: TSchema$1, value: any): Uint8Array;
719
- decode<T extends TSchema$1>(schema: T, value: any): StaticDecode$1<T>;
723
+ interface ValidateOptions {
724
+ trim?: boolean;
725
+ nullToUndefined?: boolean;
726
+ deleteUndefined?: boolean;
720
727
  }
721
728
  //#endregion
722
729
  //#region src/providers/CodecManager.d.ts
@@ -724,24 +731,35 @@ type Encoding = "object" | "string" | "binary";
724
731
  interface EncodeOptions<T extends Encoding = Encoding> {
725
732
  /**
726
733
  * The output encoding format:
727
- * - 'object': Returns native types (objects, BigInt, Date, etc.)
728
734
  * - 'string': Returns JSON string
729
735
  * - 'binary': Returns Uint8Array (for protobuf, msgpack, etc.)
736
+ *
737
+ * @default "string"
730
738
  */
731
739
  as?: T;
732
740
  /**
733
741
  * The encoder to use (e.g., 'json', 'protobuf', 'msgpack')
734
- * Defaults to 'json'
742
+ *
743
+ * @default "json"
735
744
  */
736
745
  encoder?: string;
746
+ /**
747
+ * Validation options to apply before encoding.
748
+ */
749
+ validation?: ValidateOptions | false;
737
750
  }
738
751
  type EncodeResult<T extends TSchema$1, E extends Encoding> = E extends "string" ? string : E extends "binary" ? Uint8Array : StaticEncode$1<T>;
739
752
  interface DecodeOptions {
740
753
  /**
741
754
  * The encoder to use (e.g., 'json', 'protobuf', 'msgpack')
742
- * Defaults to 'json'
755
+ *
756
+ * @default "json"
743
757
  */
744
758
  encoder?: string;
759
+ /**
760
+ * Validation options to apply before encoding.
761
+ */
762
+ validation?: ValidateOptions | false;
745
763
  }
746
764
  /**
747
765
  * CodecManager manages multiple codec formats and provides a unified interface
@@ -750,33 +768,38 @@ interface DecodeOptions {
750
768
  declare class CodecManager {
751
769
  protected readonly codecs: Map<string, SchemaCodec>;
752
770
  protected readonly jsonCodec: JsonSchemaCodec;
771
+ protected readonly schemaValidator: SchemaValidator;
753
772
  default: string;
754
773
  constructor();
755
774
  /**
756
775
  * Register a new codec format.
776
+ *
757
777
  * @param name - The name of the codec (e.g., 'json', 'protobuf')
758
778
  * @param codec - The codec implementation
759
779
  */
760
780
  register(name: string, codec: SchemaCodec): void;
761
781
  /**
762
782
  * Get a specific codec by name.
783
+ *
763
784
  * @param name - The name of the codec
764
785
  * @returns The codec instance
765
786
  * @throws {AlephaError} If the codec is not found
766
787
  */
767
- get(name: string): SchemaCodec;
788
+ getCodec(name: string): SchemaCodec;
768
789
  /**
769
790
  * Encode data using the specified codec and output format.
770
791
  */
771
- encode<T extends TSchema$1, E extends Encoding = "object">(schema: T, value: any, options?: EncodeOptions<E>): EncodeResult<T, E>;
792
+ encode<T extends TSchema$1, E extends Encoding = "object">(schema: T, value: unknown, options?: EncodeOptions<E>): EncodeResult<T, E>;
772
793
  /**
773
794
  * Decode data using the specified codec.
774
795
  */
775
- decode<T extends TSchema$1>(schema: T, value: any, options?: DecodeOptions): StaticDecode$1<T>;
796
+ decode<T extends TSchema$1>(schema: T, data: any, options?: DecodeOptions): Static<T>;
776
797
  /**
777
- * Validate decoded data.
798
+ * Validate decoded data against the schema.
799
+ *
800
+ * This is automatically called before encoding or after decoding.
778
801
  */
779
- validate<T extends TSchema$1>(schema: T, value: any, options?: DecodeOptions): StaticDecode$1<T>;
802
+ validate<T extends TSchema$1>(schema: T, value: unknown, options?: ValidateOptions): Static<T>;
780
803
  }
781
804
  //#endregion
782
805
  //#region src/providers/EventManager.d.ts
@@ -852,23 +875,27 @@ declare class EventManager {
852
875
  * If you need to store complex data, consider using identifiers or references instead.
853
876
  */
854
877
  declare const $atom: {
855
- <T extends TObject, N extends string>(options: AtomOptions<T, N>): Atom<T, N>;
878
+ <T extends TObject<TProperties$2> | TArray$1, N extends string>(options: AtomOptions<T, N>): Atom<T, N>;
856
879
  [KIND]: string;
857
880
  };
858
- type AtomOptions<T extends TObject, N extends string> = {
881
+ type AtomOptions<T extends TAtomObject, N extends string> = {
859
882
  name: N;
860
883
  schema: T;
861
- } & (T extends TOptionalAdd$1<T> ? {
884
+ description?: string;
885
+ } & (T extends TOptionalAdd<T> ? {
862
886
  default?: Static<T>;
863
887
  } : {
864
888
  default: Static<T>;
865
889
  });
866
- declare class Atom<T extends TObject = TObject, N extends string = string> {
890
+ declare class Atom<T extends TAtomObject = TObject, N extends string = string> {
867
891
  readonly options: AtomOptions<T, N>;
868
892
  get schema(): T;
869
893
  get key(): N;
870
894
  constructor(options: AtomOptions<T, N>);
871
895
  }
896
+ type TProperties$2 = any;
897
+ type TAtomObject = TObject<any> | TArray$1;
898
+ type AtomStatic<T extends TAtomObject> = T extends TOptionalAdd<T> ? Static<T> | undefined : Static<T>;
872
899
  //#endregion
873
900
  //#region src/providers/StateManager.d.ts
874
901
  interface AtomWithValue {
@@ -887,12 +914,12 @@ declare class StateManager<State$1 extends object = State> {
887
914
  /**
888
915
  * Get a value from the state with proper typing
889
916
  */
890
- get<T extends TObject$1>(target: Atom<T>): Static<T>;
917
+ get<T extends TAtomObject>(target: Atom<T>): Static<T>;
891
918
  get<Key extends keyof State$1>(target: Key): State$1[Key] | undefined;
892
919
  /**
893
920
  * Set a value in the state
894
921
  */
895
- set<T extends TObject$1>(target: Atom<T>, value: Static<T>): this;
922
+ set<T extends TAtomObject>(target: Atom<T>, value: AtomStatic<T>): this;
896
923
  set<Key extends keyof State$1>(target: Key, value: State$1[Key] | undefined): this;
897
924
  /**
898
925
  * Mutate a value in the state.
@@ -1873,5 +1900,5 @@ type PageQuery = Static<typeof pageQuerySchema>;
1873
1900
  */
1874
1901
  declare const run: (entry: Alepha | Service | Array<Service>, opts?: RunOptions) => Alepha;
1875
1902
  //#endregion
1876
- export { $atom, $context, $env, $hook, $inject, $module, $use, AbstractClass, Alepha, AlephaError, AlsProvider, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, Atom, AtomOptions, AtomWithValue, CircularDependencyError, CodecManager, ContainerLockedError, ContextDescriptor, DecodeOptions, Descriptor, DescriptorArgs, DescriptorConfig, DescriptorFactory, DescriptorFactoryLike, EncodeOptions, EncodeResult, Encoding, Env, FileLike, Hook, HookDescriptor, HookOptions, Hooks, InjectDescriptor, InjectOptions, InstantiableClass, JsonSchemaCodec, KIND, LogLevel, LoggerInterface, MaybePromise, Module, ModuleDescriptorOptions, OPTIONS, Page, PageMetadata, PageQuery, PageRequest, RunFunction, SchemaCodec, Service, ServiceEntry, ServiceSubstitution, SortDirection, SortField, State, StateManager, type Static, type StaticDecode, type StaticEncode, StreamLike, type TAny, type TArray, type TBigInt, type TBoolean, TFile, type TInteger, type TKeysToIndexer, type TNull, type TNumber, type TNumberOptions, type TObject, type TObjectOptions, type TOptional, type TOptionalAdd, TPage, type TPick, type TProperties, type TRecord, type TSchema, TStream, type TString, type TStringOptions, TTextOptions, type TTuple, type TUnion, type TUnsafe, type TVoid, TextLength, TooLateSubstitutionError, TypeBox, TypeBoxError, TypeBoxErrorParams, TypeBoxFormat, TypeBoxValue, TypeGuard, TypeProvider, WithModule, boot, createDescriptor, createPagination, isClass, isEmail, isFileLike, isTypeFile, isURL, isUUID, pageMetadataSchema, pageQuerySchema, pageSchema, run, t };
1903
+ export { $atom, $context, $env, $hook, $inject, $module, $use, AbstractClass, Alepha, AlephaError, AlsProvider, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, Atom, AtomOptions, AtomStatic, AtomWithValue, CircularDependencyError, CodecManager, ContainerLockedError, ContextDescriptor, DecodeOptions, Descriptor, DescriptorArgs, DescriptorConfig, DescriptorFactory, DescriptorFactoryLike, EncodeOptions, EncodeResult, Encoding, Env, FileLike, Hook, HookDescriptor, HookOptions, Hooks, InjectDescriptor, InjectOptions, InstantiableClass, JsonSchemaCodec, KIND, LogLevel, LoggerInterface, MaybePromise, Module, ModuleDescriptorOptions, OPTIONS, Page, PageMetadata, PageQuery, PageRequest, RunFunction, SchemaCodec, Service, ServiceEntry, ServiceSubstitution, SortDirection, SortField, State, StateManager, type Static, type StaticDecode, type StaticEncode, StreamLike, type TAny, type TArray, TAtomObject, type TBigInt, type TBoolean, TFile, type TInteger, type TKeysToIndexer, type TNull, type TNumber, type TNumberOptions, type TObject, type TObjectOptions, type TOptional, type TOptionalAdd, TPage, type TPick, type TProperties, type TRecord, type TSchema, TStream, type TString, type TStringOptions, TTextOptions, type TTuple, type TUnion, type TUnsafe, type TVoid, TextLength, TooLateSubstitutionError, TypeBox, TypeBoxError, TypeBoxErrorParams, TypeBoxFormat, TypeBoxValue, TypeGuard, TypeProvider, WithModule, boot, createDescriptor, createPagination, isClass, isDate, isDateTime, isDuration, isEmail, isFileLike, isTime, isTypeFile, isURL, isUUID, pageMetadataSchema, pageQuerySchema, pageSchema, run, t };
1877
1904
  //# sourceMappingURL=index.d.ts.map
package/datetime.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _alepha_core1 from "alepha";
2
- import { Alepha, Descriptor, KIND, TStringOptions } from "alepha";
2
+ import { Alepha, Descriptor, KIND } from "alepha";
3
3
  import "dayjs/plugin/relativeTime.js";
4
4
  import dayjsDuration from "dayjs/plugin/duration.js";
5
5
  import "dayjs/plugin/utc.js";
@@ -8,24 +8,13 @@ import "dayjs/plugin/localizedFormat.js";
8
8
  import "dayjs/locale/ar.js";
9
9
  import "dayjs/locale/fr.js";
10
10
  import DayjsApi, { Dayjs, ManipulateType, PluginFunc } from "dayjs";
11
- import * as typebox0 from "typebox";
12
- import * as dayjs_plugin_duration0 from "dayjs/plugin/duration";
13
11
 
14
- //#region src/providers/DateTimeTypeProvider.d.ts
15
- declare const datetime: (options?: TStringOptions) => typebox0.TCodec<typebox0.TString, DayjsApi.Dayjs>;
16
- declare const date: (options?: TStringOptions) => typebox0.TCodec<typebox0.TString, DayjsApi.Dayjs>;
17
- declare const time: (options?: TStringOptions) => typebox0.TCodec<typebox0.TString, DayjsApi.Dayjs>;
18
- declare const duration: (options?: TStringOptions) => typebox0.TCodec<typebox0.TString, dayjs_plugin_duration0.Duration>;
19
- declare const isDateTimeSchema: (schema: unknown) => schema is ReturnType<typeof datetime>;
20
- declare const isDateSchema: (schema: unknown) => schema is ReturnType<typeof date>;
21
- declare const isTimeSchema: (schema: unknown) => schema is ReturnType<typeof time>;
22
- declare const isDurationSchema: (schema: unknown) => schema is ReturnType<typeof duration>;
23
- //#endregion
24
12
  //#region src/providers/DateTimeProvider.d.ts
25
13
  type DateTime = DayjsApi.Dayjs;
26
14
  type Duration = dayjsDuration.Duration;
27
15
  type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
28
16
  declare const dayjs: typeof DayjsApi;
17
+ declare const isDateTime: (value: unknown) => value is DateTime;
29
18
  declare class DateTimeProvider {
30
19
  static PLUGINS: Array<PluginFunc<any>>;
31
20
  protected alepha: Alepha;
@@ -149,21 +138,7 @@ declare class IntervalDescriptor extends Descriptor<IntervalDescriptorOptions> {
149
138
  }
150
139
  //#endregion
151
140
  //#region src/index.d.ts
152
- declare module "alepha" {
153
- interface TypeProvider {
154
- datetime: typeof datetime;
155
- date: typeof date;
156
- time: typeof time;
157
- duration: typeof duration;
158
- }
159
- interface TypeGuard {
160
- isDateTime: typeof isDateTimeSchema;
161
- isDate: typeof isDateSchema;
162
- isTime: typeof isTimeSchema;
163
- isDuration: typeof isDurationSchema;
164
- }
165
- }
166
141
  declare const AlephaDateTime: _alepha_core1.Service<_alepha_core1.Module>;
167
142
  //#endregion
168
- export { $interval, AlephaDateTime, DateTime, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout, date, datetime, dayjs, duration, isDateSchema, isDateTimeSchema, isDurationSchema, isTimeSchema, time };
143
+ export { $interval, AlephaDateTime, DateTime, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout, dayjs, isDateTime };
169
144
  //# sourceMappingURL=index.d.ts.map