@luminix/core 0.0.1-beta.11 → 0.0.1-beta.13

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.
@@ -47,9 +47,9 @@ export declare class Collection<T> implements CollectionInterface<T> {
47
47
  filter(callback?: CollectionIteratorCallback<T, boolean>): CollectionInterface<T>;
48
48
  first(callback?: CollectionIteratorCallback<T, boolean>): T | null;
49
49
  firstOrFail(callback?: CollectionIteratorCallback<T, boolean>): T;
50
- firstWhere(key: keyof T): T | null;
51
- firstWhere(key: keyof T, value: T): T | null;
52
- firstWhere(key: keyof T, operator: Operator, value: T): T | null;
50
+ firstWhere<K extends keyof T>(key: K): T | null;
51
+ firstWhere<K extends keyof T>(key: K, value: T[K]): T | null;
52
+ firstWhere<K extends keyof T>(key: K, operator: Operator, value: T[K]): T | null;
53
53
  flatMap<R>(callback: CollectionIteratorCallback<T, R | R[]>): CollectionInterface<R>;
54
54
  forget(key: number): this;
55
55
  forPage(page: number, perPage: number): CollectionInterface<T>;
@@ -548,9 +548,9 @@ export type Collection<T = unknown> = EventSource<CollectionEvents<T>> & {
548
548
  * ```
549
549
  *
550
550
  */
551
- firstWhere(key: keyof T): T | null;
552
- firstWhere(key: keyof T, value: T): T | null;
553
- firstWhere(key: keyof T, operator: Operator, value: T): T | null;
551
+ firstWhere<K extends keyof T>(key: K): T | null;
552
+ firstWhere<K extends keyof T>(key: K, value: T[K]): T | null;
553
+ firstWhere<K extends keyof T>(key: K, operator: Operator, value: T[K]): T | null;
554
554
  /**
555
555
  *
556
556
  * Calls a defined callback function on each element of the collection. Then,
@@ -116,22 +116,23 @@ export interface ModelTableColumnDefinition {
116
116
  label: string;
117
117
  sortable?: boolean;
118
118
  }
119
+ export type ModelAttribute = {
120
+ appended: true | null;
121
+ cast: string | null;
122
+ default: string | null;
123
+ fillable: boolean;
124
+ hidden: boolean;
125
+ increments: boolean;
126
+ name: string;
127
+ nullable: boolean;
128
+ phpType: string | null;
129
+ primary: boolean;
130
+ type: string | null;
131
+ unique: boolean;
132
+ virtual: boolean;
133
+ };
119
134
  export interface ModelSchemaAttributes {
120
- attributes: {
121
- appended: true | null;
122
- cast: string | null;
123
- default: string | null;
124
- fillable: boolean;
125
- hidden: boolean;
126
- increments: boolean;
127
- name: string;
128
- nullable: boolean;
129
- phpType: string | null;
130
- primary: boolean;
131
- type: string | null;
132
- unique: boolean;
133
- virtual: boolean;
134
- }[];
135
+ attributes: ModelAttribute[];
135
136
  displayName: {
136
137
  singular: string;
137
138
  plural: string;
@@ -142,6 +143,7 @@ export interface ModelSchemaAttributes {
142
143
  primaryKey: string;
143
144
  timestamps: boolean;
144
145
  labeledBy: string;
146
+ softDeletes: boolean;
145
147
  [key: string]: any;
146
148
  }
147
149
  export interface RelationMetaData {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/core",
3
- "version": "0.0.1-beta.11",
3
+ "version": "0.0.1-beta.13",
4
4
  "description": "> Projeto em desenvolvimento",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/index.d.ts",