@luminix/core 0.0.1-beta.5 → 0.0.1-beta.6

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.
@@ -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(facades: AppFacades, abstract: string): typeof BaseModel;
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;
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/core",
3
- "version": "0.0.1-beta.5",
3
+ "version": "0.0.1-beta.6",
4
4
  "description": "> Projeto em desenvolvimento",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/index.d.ts",