@h3ravel/arquebus 0.7.1 → 0.7.3

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.
@@ -1,11 +1,7 @@
1
- import "node:module";
2
1
  import { Collection } from "collect.js";
3
2
  import Knex$1, { Knex } from "knex";
4
3
  import * as dayjs0 from "dayjs";
5
- import dayjs from "dayjs";
6
4
 
7
- //#region rolldown:runtime
8
- //#endregion
9
5
  //#region src/browser/collection.d.ts
10
6
  declare class Collection$2<I$1 extends Model$2> extends Collection<I$1> {
11
7
  mapThen(callback: TFunction): Promise<any[]>;
@@ -144,6 +140,7 @@ interface IModel {
144
140
  setAppends(appends: string[]): this;
145
141
  append(key: string | string[]): this;
146
142
  getRelation<T$1 extends Model$1>(relation: string): T$1 | ICollection<T$1> | null | undefined;
143
+ getRelation<T$1 extends Model$1, IsCollection extends boolean = false>(relation: string): IsCollection extends true ? ICollection<T$1> | undefined : T$1 | null | undefined;
147
144
  setRelation<T$1 extends Model$1>(relation: string, value: T$1 | ICollection<T$1> | null): this;
148
145
  unsetRelation(relation: string): this;
149
146
  relationLoaded(relation: string): boolean;
@@ -348,7 +345,7 @@ declare class Builder<M extends Model$1 = Model$1, R$1 = IModel | ICollection<M>
348
345
  withAvg(relation: any, column: string): this;
349
346
  withSum(relation: any, column: string): this;
350
347
  withExists(relation: any): this;
351
- parseWithRelations(relations: TGeneric): never[] | TGeneric;
348
+ parseWithRelations(relations: TGeneric): TGeneric | never[];
352
349
  addNestedWiths(name: string, results: TGeneric): TGeneric;
353
350
  prepareNestedWithRelationships(relations: TGeneric, prefix?: string): TGeneric;
354
351
  combineConstraints(constraints: TFunction[]): (builder: Builder<M>) => Builder<M, IModel | ICollection<M>>;
@@ -691,18 +688,6 @@ declare class CastsAttributes implements ICastsAttributes {
691
688
  static get(_model: Model$1, _key: string, _value: string, _attributes: TGeneric): string | null | undefined;
692
689
  static set(_model: Model$1, _key: string, _value: string, _attributes: TGeneric): string | null | undefined;
693
690
  }
694
- declare namespace has_unique_ids_d_exports {
695
- export { HasUniqueIds as default };
696
- }
697
- declare const HasUniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
698
- new (...args: any[]): {
699
- [x: string]: any;
700
- useUniqueIds: boolean;
701
- uniqueIds(): any[];
702
- getKeyType(): any;
703
- getIncrementing(): any;
704
- };
705
- } & TBase;
706
691
  //#endregion
707
692
  //#region src/arquebus.d.ts
708
693
  declare class arquebus<M extends Model$1 = Model$1> {
@@ -2057,7 +2042,10 @@ declare const BaseModel: (new (...args: any[]) => any) & {
2057
2042
  uniqueIds(): never[];
2058
2043
  setUniqueIds(): void;
2059
2044
  });
2060
- getRelation: <T$1 extends Model$1>(relation: string) => T$1 | ICollection<T$1> | null | undefined;
2045
+ getRelation: {
2046
+ <T$1 extends Model$1>(relation: string): T$1 | ICollection<T$1> | null | undefined;
2047
+ <T$1 extends Model$1, IsCollection extends boolean = false>(relation: string): IsCollection extends true ? ICollection<T$1> | undefined : T$1 | null | undefined;
2048
+ };
2061
2049
  setRelation: <T$1 extends Model$1>(relation: string, value: T$1 | ICollection<T$1> | null) => (new () => IModel) & IModel & {
2062
2050
  [x: string]: any;
2063
2051
  timestamps: boolean;
@@ -4746,74 +4734,6 @@ type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? U e
4746
4734
  type FunctionPropertyNames<T$1> = { [K in keyof T$1]: T$1[K] extends ((...args: any[]) => any) ? K : never }[keyof T$1];
4747
4735
  type RelationNames<T$1> = FunctionPropertyNames<T$1> extends infer R ? R extends `relation${infer P}` ? P extends 'sToData' | 'loaded' ? never : CamelToSnakeCase<P> : never : never;
4748
4736
  type MixinConstructor<T$1 = TGeneric> = new (...args: any[]) => T$1;
4749
- declare namespace has_attributes_d_exports {
4750
- export { HasAttributes as default };
4751
- }
4752
- declare const HasAttributes: <TBase extends MixinConstructor>(Model: TBase) => {
4753
- new (...args: any[]): {
4754
- [x: string]: any;
4755
- attributes: TGeneric;
4756
- original: TGeneric;
4757
- casts: TGeneric<typeof CastsAttributes | "int" | "json" | "string" | "date" | "boolean" | "datetime" | "collection">;
4758
- changes: TGeneric;
4759
- appends: any[];
4760
- setAppends(appends: any[]): /*elided*/any;
4761
- append(...keys: any[]): /*elided*/any;
4762
- normalizeCastClassResponse(key: string, value: string): TGeneric;
4763
- syncOriginal(): /*elided*/any;
4764
- syncChanges(): /*elided*/any;
4765
- syncOriginalAttribute(attribute: string): void;
4766
- syncOriginalAttributes(...attributes: string[]): /*elided*/any;
4767
- isDirty(...attributes: string[]): boolean;
4768
- getDirty(): TGeneric;
4769
- originalIsEquivalent(key: string): boolean;
4770
- setAttributes(attributes: TGeneric): void;
4771
- setRawAttributes(attributes: TGeneric, sync?: boolean): /*elided*/any;
4772
- getAttributes(): {
4773
- [x: string]: any;
4774
- };
4775
- setAttribute(key: string, value: string): /*elided*/any;
4776
- getAttribute(key: string): any;
4777
- castAttribute(key: string, value: string): any;
4778
- attributesToData(): {
4779
- [x: string]: any;
4780
- };
4781
- mutateAttribute(key: string, value: string | null): any;
4782
- mutateAttributeForArray(_key: string, _value: string): void;
4783
- isDateAttribute(key: string): boolean;
4784
- serializeDate(date?: Date | string | null): string | null;
4785
- getDates(): any[];
4786
- getCasts(): TGeneric<"string" | "boolean" | typeof CastsAttributes | "int" | "json" | "date" | "datetime" | "collection">;
4787
- getCastType(key: string): any;
4788
- hasCast(key: string, types?: readonly string[]): boolean;
4789
- withDayjs(date: string): dayjs.Dayjs;
4790
- isCustomCast(cast: any): boolean;
4791
- isCustomDateTimeCast(cast: any): boolean;
4792
- isDecimalCast(cast: any): boolean;
4793
- isDateCastable(key: string): boolean;
4794
- fromDateTime(value: string): string;
4795
- getDateFormat(): any;
4796
- asDecimal(value: string, decimals: number): string;
4797
- asDateTime(value: any): Date | null;
4798
- asDate(value: string): Date;
4799
- };
4800
- castTypeCache: TGeneric;
4801
- } & TBase;
4802
- declare namespace has_global_scopes_d_exports {
4803
- export { HasGlobalScopes as default };
4804
- }
4805
- declare const HasGlobalScopes: <TBase extends MixinConstructor>(Model: TBase) => {
4806
- new (...args: any[]): {
4807
- [x: string]: any;
4808
- getGlobalScopes(): {};
4809
- };
4810
- globalScopes?: TGeneric;
4811
- addGlobalScope(scope: any, implementation?: any | null): Scope<any>;
4812
- hasGlobalScope(scope: any): boolean;
4813
- getGlobalScope(scope: any): unknown;
4814
- getAllGlobalScopes(): TGeneric | undefined;
4815
- setAllGlobalScopes(scopes: TGeneric): void;
4816
- } & TBase;
4817
4737
  //#endregion
4818
4738
  //#region src/hooks.d.ts
4819
4739
  type HookName = 'creating' | 'created' | 'updating' | 'updated' | 'saving' | 'saved' | 'deleting' | 'deleted' | 'restoring' | 'restored' | 'trashed' | 'forceDeleting' | 'forceDeleted';
@@ -4823,29 +4743,123 @@ declare class Hooks {
4823
4743
  add(hook: HookName, callback: HookCallback): void;
4824
4744
  exec(hook: HookName, data: any[]): Promise<boolean>;
4825
4745
  }
4826
- declare namespace has_hooks_d_exports {
4827
- export { HasHooks as default };
4746
+ //#endregion
4747
+ //#region src/relations/has-one.d.ts
4748
+ declare const HasOne_base: (new (...args: any[]) => Relation & typeof Relation & {
4749
+ [x: string]: any;
4750
+ getRelationValue(dictionary: TGeneric, key: string, type: string): any;
4751
+ matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
4752
+ buildDictionary(results: any): any;
4753
+ save(model: Model$1): Promise<false | Model$1>;
4754
+ saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
4755
+ create(attributes?: {}): Promise<any>;
4756
+ createMany(records: any[]): Promise<Collection$1<any>>;
4757
+ setForeignAttributesForCreate(model: Model$1): void;
4758
+ getForeignKeyName(): any;
4759
+ getParentKey(): any;
4760
+ getQualifiedForeignKeyName(): any;
4761
+ getExistenceCompareKey(): any;
4762
+ addConstraints(): void;
4763
+ } & TGeneric<any, string> & {
4764
+ [x: string]: any;
4765
+ _withDefault?: boolean | TFunction | TGeneric;
4766
+ withDefault(callback?: boolean): /*elided*/any;
4767
+ getDefaultFor<P$1>(parent: P$1): any;
4768
+ }) & {
4769
+ prototype: {
4770
+ [x: string]: any;
4771
+ getRelationValue(dictionary: TGeneric, key: string, type: string): any;
4772
+ matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
4773
+ buildDictionary(results: any): any;
4774
+ save(model: Model$1): Promise<false | Model$1>;
4775
+ saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
4776
+ create(attributes?: {}): Promise<any>;
4777
+ createMany(records: any[]): Promise<Collection$1<any>>;
4778
+ setForeignAttributesForCreate(model: Model$1): void;
4779
+ getForeignKeyName(): any;
4780
+ getParentKey(): any;
4781
+ getQualifiedForeignKeyName(): any;
4782
+ getExistenceCompareKey(): any;
4783
+ addConstraints(): void;
4784
+ };
4785
+ } & {
4786
+ prototype: {
4787
+ [x: string]: any;
4788
+ _withDefault?: boolean | TFunction | TGeneric;
4789
+ withDefault(callback?: boolean): /*elided*/any;
4790
+ getDefaultFor<P$1>(parent: P$1): any;
4791
+ };
4792
+ } & {
4793
+ prototype: Relation;
4794
+ constraints: boolean;
4795
+ selfJoinCount: number;
4796
+ extend: typeof Relation.extend;
4797
+ noConstraints: typeof Relation.noConstraints;
4798
+ };
4799
+ declare class HasOne extends HasOne_base {
4800
+ foreignKey?: string | null;
4801
+ localKey?: string | null;
4802
+ constructor(query: Builder, parent: Builder, foreignKey?: string | null, localKey?: string | null);
4803
+ initRelation(models: Model$1[], relation: string): Model$1[];
4804
+ matchOne(models: Model$1[], results: any, relation: string): Model$1[];
4805
+ getForeignKeyName(): string | undefined;
4806
+ getResults(): Promise<any>;
4807
+ match(models: Model$1[], results: any, relation: string): Model$1[];
4808
+ addEagerConstraints(models: Model$1[]): void;
4809
+ newRelatedInstanceFor(parent: Model$1): any;
4828
4810
  }
4829
- declare const HasHooks: <TBase extends MixinConstructor>(Model: TBase) => {
4830
- new (...args: any[]): {
4811
+ //#endregion
4812
+ //#region src/relations/has-many.d.ts
4813
+ declare const HasMany_base: (new (...args: any[]) => Relation & typeof Relation & {
4814
+ [x: string]: any;
4815
+ getRelationValue(dictionary: TGeneric, key: string, type: string): any;
4816
+ matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
4817
+ buildDictionary(results: any): any;
4818
+ save(model: Model$1): Promise<false | Model$1>;
4819
+ saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
4820
+ create(attributes?: {}): Promise<any>;
4821
+ createMany(records: any[]): Promise<Collection$1<any>>;
4822
+ setForeignAttributesForCreate(model: Model$1): void;
4823
+ getForeignKeyName(): any;
4824
+ getParentKey(): any;
4825
+ getQualifiedForeignKeyName(): any;
4826
+ getExistenceCompareKey(): any;
4827
+ addConstraints(): void;
4828
+ } & TGeneric<any, string>) & {
4829
+ prototype: {
4831
4830
  [x: string]: any;
4832
- execHooks(hook: any, options: TGeneric): Promise<any>;
4831
+ getRelationValue(dictionary: TGeneric, key: string, type: string): any;
4832
+ matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
4833
+ buildDictionary(results: any): any;
4834
+ save(model: Model$1): Promise<false | Model$1>;
4835
+ saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
4836
+ create(attributes?: {}): Promise<any>;
4837
+ createMany(records: any[]): Promise<Collection$1<any>>;
4838
+ setForeignAttributesForCreate(model: Model$1): void;
4839
+ getForeignKeyName(): any;
4840
+ getParentKey(): any;
4841
+ getQualifiedForeignKeyName(): any;
4842
+ getExistenceCompareKey(): any;
4843
+ addConstraints(): void;
4833
4844
  };
4834
- hooks: Hooks | null;
4835
- addHook(hook: any, callback: TFunction): void;
4836
- creating(callback: TFunction): void;
4837
- created(callback: TFunction): void;
4838
- updating(callback: TFunction): void;
4839
- updated(callback: TFunction): void;
4840
- saving(callback: TFunction): void;
4841
- saved(callback: TFunction): void;
4842
- deleting(callback: TFunction): void;
4843
- deleted(callback: TFunction): void;
4844
- restoring(callback: TFunction): void;
4845
- restored(callback: TFunction): void;
4846
- trashed(callback: TFunction): void;
4847
- forceDeleted(callback: TFunction): void;
4848
- } & TBase;
4845
+ } & {
4846
+ prototype: Relation;
4847
+ constraints: boolean;
4848
+ selfJoinCount: number;
4849
+ extend: typeof Relation.extend;
4850
+ noConstraints: typeof Relation.noConstraints;
4851
+ };
4852
+ declare class HasMany extends HasMany_base {
4853
+ foreignKey?: string | null;
4854
+ localKey?: string | null;
4855
+ constructor(query: any, parent: any, foreignKey?: string | null, localKey?: string | null);
4856
+ initRelation(models: Model$1[], relation: string): Model$1[];
4857
+ getResults(): Promise<any>;
4858
+ getForeignKeyName(): string | undefined;
4859
+ buildDictionary(results: any): any;
4860
+ match(models: Model$1[], results: any, relation: string): Model$1[];
4861
+ addEagerConstraints(models: Model$1[]): void;
4862
+ }
4849
4863
  //#endregion
4850
4864
  //#region src/relations/belongs-to.d.ts
4851
4865
  declare const BelongsTo_base: (new (...args: any[]) => Relation & typeof Relation & {
@@ -4959,58 +4973,6 @@ declare class BelongsToMany extends BelongsToMany_base {
4959
4973
  getRelationExistenceQueryForSelfJoin(query: any, parentQuery: any, columns?: string[]): any;
4960
4974
  }
4961
4975
  //#endregion
4962
- //#region src/relations/has-many.d.ts
4963
- declare const HasMany_base: (new (...args: any[]) => Relation & typeof Relation & {
4964
- [x: string]: any;
4965
- getRelationValue(dictionary: TGeneric, key: string, type: string): any;
4966
- matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
4967
- buildDictionary(results: any): any;
4968
- save(model: Model$1): Promise<false | Model$1>;
4969
- saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
4970
- create(attributes?: {}): Promise<any>;
4971
- createMany(records: any[]): Promise<Collection$1<any>>;
4972
- setForeignAttributesForCreate(model: Model$1): void;
4973
- getForeignKeyName(): any;
4974
- getParentKey(): any;
4975
- getQualifiedForeignKeyName(): any;
4976
- getExistenceCompareKey(): any;
4977
- addConstraints(): void;
4978
- } & TGeneric<any, string>) & {
4979
- prototype: {
4980
- [x: string]: any;
4981
- getRelationValue(dictionary: TGeneric, key: string, type: string): any;
4982
- matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
4983
- buildDictionary(results: any): any;
4984
- save(model: Model$1): Promise<false | Model$1>;
4985
- saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
4986
- create(attributes?: {}): Promise<any>;
4987
- createMany(records: any[]): Promise<Collection$1<any>>;
4988
- setForeignAttributesForCreate(model: Model$1): void;
4989
- getForeignKeyName(): any;
4990
- getParentKey(): any;
4991
- getQualifiedForeignKeyName(): any;
4992
- getExistenceCompareKey(): any;
4993
- addConstraints(): void;
4994
- };
4995
- } & {
4996
- prototype: Relation;
4997
- constraints: boolean;
4998
- selfJoinCount: number;
4999
- extend: typeof Relation.extend;
5000
- noConstraints: typeof Relation.noConstraints;
5001
- };
5002
- declare class HasMany extends HasMany_base {
5003
- foreignKey?: string | null;
5004
- localKey?: string | null;
5005
- constructor(query: any, parent: any, foreignKey?: string | null, localKey?: string | null);
5006
- initRelation(models: Model$1[], relation: string): Model$1[];
5007
- getResults(): Promise<any>;
5008
- getForeignKeyName(): string | undefined;
5009
- buildDictionary(results: any): any;
5010
- match(models: Model$1[], results: any, relation: string): Model$1[];
5011
- addEagerConstraints(models: Model$1[]): void;
5012
- }
5013
- //#endregion
5014
4976
  //#region src/relations/has-many-through.d.ts
5015
4977
  declare class HasManyThrough extends Relation {
5016
4978
  throughParent: any;
@@ -5057,71 +5019,6 @@ declare class HasManyThrough extends Relation {
5057
5019
  getSecondLocalKeyName(): string | undefined;
5058
5020
  }
5059
5021
  //#endregion
5060
- //#region src/relations/has-one.d.ts
5061
- declare const HasOne_base: (new (...args: any[]) => Relation & typeof Relation & {
5062
- [x: string]: any;
5063
- getRelationValue(dictionary: TGeneric, key: string, type: string): any;
5064
- matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
5065
- buildDictionary(results: any): any;
5066
- save(model: Model$1): Promise<false | Model$1>;
5067
- saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
5068
- create(attributes?: {}): Promise<any>;
5069
- createMany(records: any[]): Promise<Collection$1<any>>;
5070
- setForeignAttributesForCreate(model: Model$1): void;
5071
- getForeignKeyName(): any;
5072
- getParentKey(): any;
5073
- getQualifiedForeignKeyName(): any;
5074
- getExistenceCompareKey(): any;
5075
- addConstraints(): void;
5076
- } & TGeneric<any, string> & {
5077
- [x: string]: any;
5078
- _withDefault?: boolean | TFunction | TGeneric;
5079
- withDefault(callback?: boolean): /*elided*/any;
5080
- getDefaultFor<P$1>(parent: P$1): any;
5081
- }) & {
5082
- prototype: {
5083
- [x: string]: any;
5084
- getRelationValue(dictionary: TGeneric, key: string, type: string): any;
5085
- matchOneOrMany(models: Model$1[], results: any, relation: string, type: string): Model$1[];
5086
- buildDictionary(results: any): any;
5087
- save(model: Model$1): Promise<false | Model$1>;
5088
- saveMany(models: Model$1[]): Promise<(Model$1[] & Collection$1<any>) | Collection$1<Model$1>>;
5089
- create(attributes?: {}): Promise<any>;
5090
- createMany(records: any[]): Promise<Collection$1<any>>;
5091
- setForeignAttributesForCreate(model: Model$1): void;
5092
- getForeignKeyName(): any;
5093
- getParentKey(): any;
5094
- getQualifiedForeignKeyName(): any;
5095
- getExistenceCompareKey(): any;
5096
- addConstraints(): void;
5097
- };
5098
- } & {
5099
- prototype: {
5100
- [x: string]: any;
5101
- _withDefault?: boolean | TFunction | TGeneric;
5102
- withDefault(callback?: boolean): /*elided*/any;
5103
- getDefaultFor<P$1>(parent: P$1): any;
5104
- };
5105
- } & {
5106
- prototype: Relation;
5107
- constraints: boolean;
5108
- selfJoinCount: number;
5109
- extend: typeof Relation.extend;
5110
- noConstraints: typeof Relation.noConstraints;
5111
- };
5112
- declare class HasOne extends HasOne_base {
5113
- foreignKey?: string | null;
5114
- localKey?: string | null;
5115
- constructor(query: Builder, parent: Builder, foreignKey?: string | null, localKey?: string | null);
5116
- initRelation(models: Model$1[], relation: string): Model$1[];
5117
- matchOne(models: Model$1[], results: any, relation: string): Model$1[];
5118
- getForeignKeyName(): string | undefined;
5119
- getResults(): Promise<any>;
5120
- match(models: Model$1[], results: any, relation: string): Model$1[];
5121
- addEagerConstraints(models: Model$1[]): void;
5122
- newRelatedInstanceFor(parent: Model$1): any;
5123
- }
5124
- //#endregion
5125
5022
  //#region src/relations/has-one-through.d.ts
5126
5023
  declare const HasOneThrough_base: (new (...args: any[]) => HasManyThrough & typeof HasManyThrough & {
5127
5024
  [x: string]: any;
@@ -5148,9 +5045,90 @@ declare class HasOneThrough extends HasOneThrough_base {
5148
5045
  match(models: Model$1[], results: any, relation: string): Model$1[];
5149
5046
  newRelatedInstanceFor(_parent: Model$1): any;
5150
5047
  }
5151
- declare namespace has_relations_d_exports {
5152
- export { HasRelations as default };
5153
- }
5048
+ //#endregion
5049
+ //#region src/concerns/index.d.ts
5050
+ declare const HasAttributes: <TBase extends MixinConstructor>(Model: TBase) => {
5051
+ new (...args: any[]): {
5052
+ [x: string]: any;
5053
+ attributes: TGeneric;
5054
+ original: TGeneric;
5055
+ casts: TGeneric<typeof CastsAttributes | "int" | "json" | "string" | "date" | "boolean" | "datetime" | "collection">;
5056
+ changes: TGeneric;
5057
+ appends: any[];
5058
+ setAppends(appends: any[]): /*elided*/any;
5059
+ append(...keys: any[]): /*elided*/any;
5060
+ normalizeCastClassResponse(key: string, value: string): TGeneric;
5061
+ syncOriginal(): /*elided*/any;
5062
+ syncChanges(): /*elided*/any;
5063
+ syncOriginalAttribute(attribute: string): void;
5064
+ syncOriginalAttributes(...attributes: string[]): /*elided*/any;
5065
+ isDirty(...attributes: string[]): boolean;
5066
+ getDirty(): TGeneric;
5067
+ originalIsEquivalent(key: string): boolean;
5068
+ setAttributes(attributes: TGeneric): void;
5069
+ setRawAttributes(attributes: TGeneric, sync?: boolean): /*elided*/any;
5070
+ getAttributes(): {
5071
+ [x: string]: any;
5072
+ };
5073
+ setAttribute(key: string, value: string): /*elided*/any;
5074
+ getAttribute(key: string): any;
5075
+ castAttribute(key: string, value: string): any;
5076
+ attributesToData(): {
5077
+ [x: string]: any;
5078
+ };
5079
+ mutateAttribute(key: string, value: string | null): any;
5080
+ mutateAttributeForArray(_key: string, _value: string): void;
5081
+ isDateAttribute(key: string): boolean;
5082
+ serializeDate(date?: Date | string | null): string | null;
5083
+ getDates(): any[];
5084
+ getCasts(): TGeneric<"string" | "boolean" | typeof CastsAttributes | "int" | "json" | "date" | "datetime" | "collection">;
5085
+ getCastType(key: string): any;
5086
+ hasCast(key: string, types?: readonly string[]): boolean;
5087
+ withDayjs(date: string): dayjs0.Dayjs;
5088
+ isCustomCast(cast: any): boolean;
5089
+ isCustomDateTimeCast(cast: any): boolean;
5090
+ isDecimalCast(cast: any): boolean;
5091
+ isDateCastable(key: string): boolean;
5092
+ fromDateTime(value: string): string;
5093
+ getDateFormat(): any;
5094
+ asDecimal(value: string, decimals: number): string;
5095
+ asDateTime(value: any): Date | null;
5096
+ asDate(value: string): Date;
5097
+ };
5098
+ castTypeCache: TGeneric;
5099
+ } & TBase;
5100
+ declare const HasGlobalScopes: <TBase extends MixinConstructor>(Model: TBase) => {
5101
+ new (...args: any[]): {
5102
+ [x: string]: any;
5103
+ getGlobalScopes(): {};
5104
+ };
5105
+ globalScopes?: TGeneric;
5106
+ addGlobalScope(scope: any, implementation?: any | null): Scope<any>;
5107
+ hasGlobalScope(scope: any): boolean;
5108
+ getGlobalScope(scope: any): unknown;
5109
+ getAllGlobalScopes(): TGeneric | undefined;
5110
+ setAllGlobalScopes(scopes: TGeneric): void;
5111
+ } & TBase;
5112
+ declare const HasHooks: <TBase extends MixinConstructor>(Model: TBase) => {
5113
+ new (...args: any[]): {
5114
+ [x: string]: any;
5115
+ execHooks(hook: any, options: TGeneric): Promise<any>;
5116
+ };
5117
+ hooks: Hooks | null;
5118
+ addHook(hook: any, callback: TFunction): void;
5119
+ creating(callback: TFunction): void;
5120
+ created(callback: TFunction): void;
5121
+ updating(callback: TFunction): void;
5122
+ updated(callback: TFunction): void;
5123
+ saving(callback: TFunction): void;
5124
+ saved(callback: TFunction): void;
5125
+ deleting(callback: TFunction): void;
5126
+ deleted(callback: TFunction): void;
5127
+ restoring(callback: TFunction): void;
5128
+ restored(callback: TFunction): void;
5129
+ trashed(callback: TFunction): void;
5130
+ forceDeleted(callback: TFunction): void;
5131
+ } & TBase;
5154
5132
  declare const HasRelations: <TBase extends MixinConstructor>(Model: TBase) => {
5155
5133
  new (...args: any[]): {
5156
5134
  [x: string]: any;
@@ -5173,9 +5151,6 @@ declare const HasRelations: <TBase extends MixinConstructor>(Model: TBase) => {
5173
5151
  hasManyThrough(related: any, through: any, firstKey?: string, secondKey?: string, localKey?: string, secondLocalKey?: string): HasManyThrough;
5174
5152
  };
5175
5153
  } & TBase;
5176
- declare namespace has_timestamps_d_exports {
5177
- export { HasTimestamps as default };
5178
- }
5179
5154
  declare const HasTimestamps: <TBase extends MixinConstructor>(Model: TBase) => {
5180
5155
  new (...args: any[]): {
5181
5156
  [x: string]: any;
@@ -5194,9 +5169,15 @@ declare const HasTimestamps: <TBase extends MixinConstructor>(Model: TBase) => {
5194
5169
  UPDATED_AT: string;
5195
5170
  DELETED_AT: string;
5196
5171
  } & TBase;
5197
- declare namespace hides_attributes_d_exports {
5198
- export { HidesAttributes as default };
5199
- }
5172
+ declare const HasUniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
5173
+ new (...args: any[]): {
5174
+ [x: string]: any;
5175
+ useUniqueIds: boolean;
5176
+ uniqueIds(): any[];
5177
+ getKeyType(): any;
5178
+ getIncrementing(): any;
5179
+ };
5180
+ } & TBase;
5200
5181
  declare const HidesAttributes: <TBase extends MixinConstructor>(Model: TBase) => {
5201
5182
  new (...args: any[]): {
5202
5183
  [x: string]: any;
@@ -5210,9 +5191,6 @@ declare const HidesAttributes: <TBase extends MixinConstructor>(Model: TBase) =>
5210
5191
  setVisible(visible: any[]): /*elided*/any;
5211
5192
  };
5212
5193
  } & TBase;
5213
- declare namespace unique_ids_d_exports {
5214
- export { UniqueIds as default };
5215
- }
5216
5194
  declare const UniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
5217
5195
  new (...args: any[]): {
5218
5196
  [x: string]: any;
@@ -5223,4 +5201,4 @@ declare const UniqueIds: <TBase extends MixinConstructor>(Model: TBase) => {
5223
5201
  };
5224
5202
  } & TBase;
5225
5203
  //#endregion
5226
- export { has_attributes_d_exports as HasAttributes, has_global_scopes_d_exports as HasGlobalScopes, has_hooks_d_exports as HasHooks, has_relations_d_exports as HasRelations, has_timestamps_d_exports as HasTimestamps, has_unique_ids_d_exports as HasUniqueIds, hides_attributes_d_exports as HidesAttributes, unique_ids_d_exports as UniqueIds };
5204
+ export { HasAttributes, HasGlobalScopes, HasHooks, HasRelations, HasTimestamps, HasUniqueIds, HidesAttributes, UniqueIds };