@luminix/core 0.0.1-beta.5 → 0.0.1-beta.7
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/dist/core.js +369 -371
- package/dist/facades/App.d.ts +7 -0
- package/dist/mixins/BaseModel.d.ts +2 -2
- package/dist/types/App.d.ts +7 -0
- package/dist/types/Model.d.ts +16 -0
- package/package.json +1 -1
package/dist/facades/App.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AppFacades, AppFacade, AppEvents } from '../types/App';
|
|
|
2
2
|
import { default as Plugin } from '../contracts/Plugin';
|
|
3
3
|
import { AppConfiguration } from '../types/Config';
|
|
4
4
|
import { Unsubscribe } from 'nanoevents';
|
|
5
|
+
import { Constructor } from '../types/Support';
|
|
5
6
|
|
|
6
7
|
declare class App implements AppFacade {
|
|
7
8
|
private facades;
|
|
@@ -13,6 +14,12 @@ declare class App implements AppFacade {
|
|
|
13
14
|
bind<K extends keyof AppFacades>(key: K, facade: AppFacades[K]): void;
|
|
14
15
|
plugins(): Plugin[];
|
|
15
16
|
boot(configObject?: AppConfiguration): Promise<AppFacades>;
|
|
17
|
+
environment(): string;
|
|
18
|
+
environment(...environments: string[]): boolean;
|
|
19
|
+
getPlugin<T extends Plugin>(abstract: Constructor<T>): T | undefined;
|
|
20
|
+
hasDebugModeEnabled(): boolean;
|
|
21
|
+
isLocal(): boolean;
|
|
22
|
+
isProduction(): boolean;
|
|
16
23
|
on<E extends keyof AppEvents>(_: E, __: AppEvents[E]): Unsubscribe;
|
|
17
24
|
once<E extends keyof AppEvents>(_: E, __: AppEvents[E]): void;
|
|
18
25
|
emit<E extends keyof AppEvents>(_: E, __?: Omit<Parameters<AppEvents[E]>[0], 'source'>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseModel, Model as ModelInterface } from '../types/Model';
|
|
2
|
-
import { AppFacades } from '../types/App';
|
|
2
|
+
import { AppFacade, AppFacades } from '../types/App';
|
|
3
3
|
|
|
4
|
-
export declare function BaseModelFactory(
|
|
4
|
+
export declare function BaseModelFactory(app: AppFacade, abstract: string): typeof BaseModel;
|
|
5
5
|
export declare function ModelFactory(facades: AppFacades, abstract: string, CustomModel: typeof BaseModel): typeof ModelInterface;
|
package/dist/types/App.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { RouteFacade } from './Route';
|
|
|
7
7
|
import { EventSource, Event } from './Event';
|
|
8
8
|
import { ErrorFacade } from './Error';
|
|
9
9
|
import { ReducibleInterface } from './Reducer';
|
|
10
|
+
import { Constructor } from './Support';
|
|
10
11
|
|
|
11
12
|
type Plugin = PluginInterface<AppFacade, AppFacades>;
|
|
12
13
|
export type GlobalModelEvents = {
|
|
@@ -48,6 +49,12 @@ export type AppExternal = {
|
|
|
48
49
|
make<T extends keyof AppFacades>(key: T): AppFacades[T];
|
|
49
50
|
plugins: () => Plugin[];
|
|
50
51
|
on: EventSource<AppEvents>['once'];
|
|
52
|
+
environment(): string;
|
|
53
|
+
environment(...environments: string[]): boolean;
|
|
54
|
+
getPlugin<T extends Plugin>(abstract: Constructor<T>): T | undefined;
|
|
55
|
+
hasDebugModeEnabled(): boolean;
|
|
56
|
+
isLocal(): boolean;
|
|
57
|
+
isProduction(): boolean;
|
|
51
58
|
};
|
|
52
59
|
export type AppFacade = AppExternal & {
|
|
53
60
|
has(key: string): boolean;
|
package/dist/types/Model.d.ts
CHANGED
|
@@ -107,6 +107,21 @@ export interface ModelTableColumnDefinition {
|
|
|
107
107
|
sortable?: boolean;
|
|
108
108
|
}
|
|
109
109
|
export interface ModelSchemaAttributes {
|
|
110
|
+
attributes: {
|
|
111
|
+
appended: true | null;
|
|
112
|
+
cast: string | null;
|
|
113
|
+
default: string | null;
|
|
114
|
+
fillable: boolean;
|
|
115
|
+
hidden: boolean;
|
|
116
|
+
increments: boolean;
|
|
117
|
+
name: string;
|
|
118
|
+
nullable: boolean;
|
|
119
|
+
phpType: string | null;
|
|
120
|
+
primary: boolean;
|
|
121
|
+
type: string;
|
|
122
|
+
unique: boolean;
|
|
123
|
+
virtual: boolean;
|
|
124
|
+
}[];
|
|
110
125
|
displayName: {
|
|
111
126
|
singular: string;
|
|
112
127
|
plural: string;
|
|
@@ -117,6 +132,7 @@ export interface ModelSchemaAttributes {
|
|
|
117
132
|
primaryKey: string;
|
|
118
133
|
timestamps: boolean;
|
|
119
134
|
labeledBy: string;
|
|
135
|
+
[key: string]: any;
|
|
120
136
|
}
|
|
121
137
|
export interface RelationMetaData {
|
|
122
138
|
model: string;
|