mythix 3.0.0 → 4.0.2

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.
Files changed (128) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +27 -30
  3. package/{src → lib}/application.d.ts +25 -39
  4. package/{src/application.js → lib/application.mjs} +110 -135
  5. package/lib/cli/cli-utils.d.ts +21 -0
  6. package/lib/cli/cli-utils.mjs +319 -0
  7. package/lib/cli/command-base.d.ts +33 -0
  8. package/lib/cli/command-base.mjs +118 -0
  9. package/lib/cli/command-executor.mjs +14 -0
  10. package/lib/cli/commands/deploy-command.mjs +1010 -0
  11. package/lib/cli/commands/generators/generate-command.mjs +117 -0
  12. package/lib/cli/commands/generators/index.mjs +2 -0
  13. package/{src/cli/generators/migration-generator.js → lib/cli/commands/generators/migration-generator.mjs} +11 -13
  14. package/lib/cli/commands/index.mjs +22 -0
  15. package/lib/cli/commands/migrate-command.mjs +184 -0
  16. package/lib/cli/commands/routes-command.mjs +40 -0
  17. package/lib/cli/commands/serve-command.mjs +63 -0
  18. package/lib/cli/commands/shell-command.mjs +95 -0
  19. package/lib/cli/index.mjs +3 -0
  20. package/{src → lib}/controllers/controller-base.d.ts +1 -1
  21. package/{src/controllers/controller-base.js → lib/controllers/controller-base.mjs} +3 -9
  22. package/{src → lib}/controllers/controller-module.d.ts +3 -3
  23. package/lib/controllers/controller-module.mjs +70 -0
  24. package/lib/controllers/generate-client-api-interface-spec.mjs +44 -0
  25. package/{src → lib}/controllers/generate-client-api-interface.d.ts +1 -0
  26. package/{src/controllers/generate-client-api-interface.js → lib/controllers/generate-client-api-interface.mjs} +39 -16
  27. package/{src → lib}/controllers/index.d.ts +2 -3
  28. package/lib/controllers/index.mjs +4 -0
  29. package/lib/controllers/routes/index.mjs +4 -0
  30. package/{src/controllers/routes/route-capture.js → lib/controllers/routes/route-capture.mjs} +2 -8
  31. package/{src/controllers/routes/route-endpoint.js → lib/controllers/routes/route-endpoint.mjs} +8 -8
  32. package/{src/controllers/routes/route-scope-base.js → lib/controllers/routes/route-scope-base.mjs} +19 -15
  33. package/{src/controllers/routes/route-scope.js → lib/controllers/routes/route-scope.mjs} +10 -12
  34. package/{src/http-server/http-errors.js → lib/http/http-errors.mjs} +9 -20
  35. package/{src/utils/http-interface.js → lib/http/http-interface.mjs} +6 -14
  36. package/{src/http-server → lib/http}/http-server-module.d.ts +2 -2
  37. package/{src/http-server/http-server-module.js → lib/http/http-server-module.mjs} +7 -11
  38. package/{src/http-server/http-server.js → lib/http/http-server.mjs} +17 -21
  39. package/lib/http/index.d.ts +4 -0
  40. package/lib/http/index.mjs +5 -0
  41. package/lib/index.d.ts +30 -0
  42. package/lib/index.mjs +31 -0
  43. package/lib/logger-spec.mjs +121 -0
  44. package/{src → lib}/logger.d.ts +1 -3
  45. package/{src/logger.js → lib/logger.mjs} +10 -24
  46. package/lib/models/index.d.ts +2 -0
  47. package/lib/models/index.mjs +2 -0
  48. package/{src/models/migration-model.js → lib/models/migration-model.mjs} +3 -11
  49. package/lib/models/model.d.ts +10 -0
  50. package/lib/models/model.mjs +28 -0
  51. package/{src → lib}/modules/database-module.d.ts +2 -2
  52. package/{src/modules/database-module.js → lib/modules/database-module.mjs} +19 -14
  53. package/lib/modules/index.d.ts +2 -0
  54. package/lib/modules/index.mjs +2 -0
  55. package/{src/modules/base-module.d.ts → lib/modules/module-base.d.ts} +3 -10
  56. package/{src/modules/base-module.js → lib/modules/module-base.mjs} +16 -6
  57. package/lib/tasks/index.d.ts +2 -0
  58. package/lib/tasks/index.mjs +2 -0
  59. package/{src → lib}/tasks/task-base.d.ts +4 -14
  60. package/lib/tasks/task-base.mjs +73 -0
  61. package/{src → lib}/tasks/task-module.d.ts +3 -3
  62. package/{src/tasks/task-module.js → lib/tasks/task-module.mjs} +43 -98
  63. package/{src/utils/config-utils.js → lib/utils/config-utils.mjs} +2 -10
  64. package/lib/utils/crypto-utils-spec.mjs +24 -0
  65. package/{src/utils/crypto-utils.js → lib/utils/crypto-utils.mjs} +16 -38
  66. package/lib/utils/file-utils-spec.mjs +10 -0
  67. package/{src/utils/file-utils.js → lib/utils/file-utils.mjs} +4 -11
  68. package/{src/utils/http-utils.js → lib/utils/http-utils.mjs} +3 -10
  69. package/{src → lib}/utils/index.d.ts +1 -1
  70. package/lib/utils/index.mjs +6 -0
  71. package/lib/utils/mime-utils-spec.mjs +171 -0
  72. package/{src/utils/mime-utils.js → lib/utils/mime-utils.mjs} +5 -14
  73. package/{src/utils/test-utils.js → lib/utils/test-utils.mjs} +14 -42
  74. package/package.json +5 -5
  75. package/src/cli/cli-utils.d.ts +0 -80
  76. package/src/cli/cli-utils.js +0 -547
  77. package/src/cli/command-executor.js +0 -31
  78. package/src/cli/deploy-command.js +0 -1010
  79. package/src/cli/generators/generate-command.js +0 -149
  80. package/src/cli/index.js +0 -5
  81. package/src/cli/migrate-command.js +0 -181
  82. package/src/cli/routes-command.js +0 -40
  83. package/src/cli/serve-command.js +0 -63
  84. package/src/cli/shell-command.js +0 -96
  85. package/src/controllers/controller-module.js +0 -126
  86. package/src/controllers/controller-utils.d.ts +0 -19
  87. package/src/controllers/controller-utils.js +0 -24
  88. package/src/controllers/index.js +0 -19
  89. package/src/controllers/routes/index.js +0 -31
  90. package/src/http-server/index.d.ts +0 -3
  91. package/src/http-server/index.js +0 -16
  92. package/src/index.d.ts +0 -49
  93. package/src/index.js +0 -47
  94. package/src/models/index.d.ts +0 -4
  95. package/src/models/index.js +0 -17
  96. package/src/models/model-module.d.ts +0 -9
  97. package/src/models/model-module.js +0 -130
  98. package/src/models/model-utils.d.ts +0 -20
  99. package/src/models/model-utils.js +0 -46
  100. package/src/models/model.d.ts +0 -20
  101. package/src/models/model.js +0 -65
  102. package/src/modules/file-watcher-module.d.ts +0 -13
  103. package/src/modules/file-watcher-module.js +0 -220
  104. package/src/modules/index.d.ts +0 -3
  105. package/src/modules/index.js +0 -11
  106. package/src/tasks/index.d.ts +0 -3
  107. package/src/tasks/index.js +0 -11
  108. package/src/tasks/task-base.js +0 -117
  109. package/src/tasks/task-utils.d.ts +0 -46
  110. package/src/tasks/task-utils.js +0 -130
  111. package/src/utils/index.js +0 -25
  112. /package/{src → lib}/cli/index.d.ts +0 -0
  113. /package/{src → lib}/controllers/routes/index.d.ts +0 -0
  114. /package/{src → lib}/controllers/routes/route-capture.d.ts +0 -0
  115. /package/{src → lib}/controllers/routes/route-endpoint.d.ts +0 -0
  116. /package/{src → lib}/controllers/routes/route-scope-base.d.ts +0 -0
  117. /package/{src → lib}/controllers/routes/route-scope.d.ts +0 -0
  118. /package/{src/http-server → lib/http}/http-errors.d.ts +0 -0
  119. /package/{src/utils → lib/http}/http-interface.d.ts +0 -0
  120. /package/{src/http-server → lib/http}/http-server.d.ts +0 -0
  121. /package/{src → lib}/interfaces/common.ts +0 -0
  122. /package/{src → lib}/models/migration-model.d.ts +0 -0
  123. /package/{src → lib}/utils/config-utils.d.ts +0 -0
  124. /package/{src → lib}/utils/crypto-utils.d.ts +0 -0
  125. /package/{src → lib}/utils/file-utils.d.ts +0 -0
  126. /package/{src → lib}/utils/http-utils.d.ts +0 -0
  127. /package/{src → lib}/utils/mime-utils.d.ts +0 -0
  128. /package/{src → lib}/utils/test-utils.d.ts +0 -0
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- const { ControllerBase } = require('./controller-base');
4
-
5
- function defineController(controllerName, definer, _parent) {
6
- let parentKlass = _parent || ControllerBase;
7
-
8
- return function({ application, server }) {
9
- const Klass = definer({
10
- Parent: parentKlass,
11
- application,
12
- server,
13
- controllerName,
14
- });
15
-
16
- Klass.getControllerName = () => controllerName;
17
-
18
- return { [controllerName]: Klass };
19
- };
20
- }
21
-
22
- module.exports = {
23
- defineController,
24
- };
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const { ControllerBase } = require('./controller-base');
4
- const { ControllerModule } = require('./controller-module');
5
- const { generateClientAPIInterface } = require('./generate-client-api-interface');
6
-
7
- const {
8
- defineController,
9
- } = require('./controller-utils');
10
-
11
- const Routes = require('./routes');
12
-
13
- module.exports = {
14
- ControllerBase,
15
- ControllerModule,
16
- Routes,
17
- defineController,
18
- generateClientAPIInterface,
19
- };
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- const {
4
- RouteScopeBase,
5
- } = require('./route-scope-base');
6
-
7
- const {
8
- RouteScope,
9
- } = require('./route-scope');
10
-
11
- const {
12
- RouteCapture,
13
- } = require('./route-capture');
14
-
15
- const {
16
- RouteEndpoint,
17
- } = require('./route-endpoint');
18
-
19
- module.exports = {
20
- // Route scope base
21
- RouteScopeBase,
22
-
23
- // Route scope
24
- RouteScope,
25
-
26
- // Route capture
27
- RouteCapture,
28
-
29
- // Route endpoint
30
- RouteEndpoint,
31
- };
@@ -1,3 +0,0 @@
1
- export * from './http-server';
2
- export * as HTTPErrors from './http-errors';
3
- export { statusCodeToMessage } from '../utils/http-utils';
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- const {
4
- statusCodeToMessage,
5
- } = require('../utils/http-utils');
6
-
7
- const { HTTPServer } = require('./http-server');
8
- const HTTPErrors = require('./http-errors');
9
- const { HTTPServerModule } = require('./http-server-module');
10
-
11
- module.exports = {
12
- HTTPErrors,
13
- HTTPServer,
14
- HTTPServerModule,
15
- statusCodeToMessage,
16
- };
package/src/index.d.ts DELETED
@@ -1,49 +0,0 @@
1
- // Application
2
- export * from './interfaces/common';
3
- export * from './application';
4
- export * from './logger';
5
-
6
- // CLI Utils
7
- export * as CLI from './cli';
8
- export { defineCommand } from './cli';
9
-
10
- // Utils
11
- export * as Utils from './utils';
12
- export {
13
- HTTPUtils,
14
- CryptoUtils,
15
- TestUtils,
16
- MimeUtils,
17
- } from './utils';
18
-
19
- // Models
20
- export * as Models from './models';
21
- export * from './models';
22
-
23
- // Controllers
24
- export * as Controllers from './controllers';
25
- export * from './controllers';
26
-
27
- // HTTPServer
28
- export * as HTTP from './http-server';
29
- export * from './http-server';
30
-
31
- // Tasks
32
- export * as Tasks from './tasks';
33
- export * from './tasks';
34
-
35
- import * as _Modules from './modules';
36
- import * as _ModelModule from './models/model-module';
37
- import * as _ControllerModule from './controllers/controller-module';
38
- import * as _HTTPServerModule from './http-server/http-server-module';
39
- import * as _TaskModule from './tasks/task-module';
40
-
41
- export declare namespace Modules {
42
- export import ModelModule = _ModelModule.ModelModule;
43
- export import ControllerModule = _ControllerModule.ControllerModule;
44
- export import BaseModule = _Modules.BaseModule;
45
- export import DatabaseModule = _Modules.DatabaseModule;
46
- export import FileWatcherModule = _Modules.FileWatcherModule;
47
- export import HTTPServerModule = _HTTPServerModule.HTTPServerModule;
48
- export import TaskModule = _TaskModule.TaskModule;
49
- }
package/src/index.js DELETED
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- const { Application } = require('./application');
4
- const { Logger } = require('./logger');
5
- const ModelScope = require('./models');
6
- const HTTPServerScope = require('./http-server');
7
- const ControllerScope = require('./controllers');
8
- const CLIUtilsScope = require('./cli');
9
- const TasksScope = require('./tasks');
10
- const Utils = require('./utils');
11
- const Modules = require('./modules');
12
-
13
- module.exports = {
14
- defineCommand: CLIUtilsScope.defineCommand,
15
- defineController: ControllerScope.defineController,
16
- defineModel: ModelScope.defineModel,
17
- registerModel: ModelScope.registerModel,
18
- defineTask: TasksScope.defineTask,
19
-
20
- CLI: CLIUtilsScope,
21
- ControllerBase: ControllerScope.ControllerBase,
22
- Controllers: ControllerScope,
23
- CryptoUtils: Utils.CryptoUtils,
24
- HTTP: HTTPServerScope,
25
- HTTPErrors: HTTPServerScope.HTTPErrors,
26
- HTTPServer: HTTPServerScope.HTTPServer,
27
- HTTPUtils: Utils.HTTPUtils,
28
- TaskBase: TasksScope.TaskBase,
29
- Tasks: TasksScope,
30
- TestUtils: Utils.TestUtils,
31
- MimeUtils: Utils.MimeUtils,
32
- Model: ModelScope.Model,
33
- Modules: {
34
- BaseModule: Modules.BaseModule,
35
- DatabaseModule: Modules.DatabaseModule,
36
- FileWatcherModule: Modules.FileWatcherModule,
37
- HTTPServerModule: HTTPServerScope.HTTPServerModule,
38
- ModelModule: ModelScope.ModelModule,
39
- TaskModule: TasksScope.TaskModule,
40
- ControllerModule: ControllerScope.ControllerModule,
41
- },
42
-
43
- Application,
44
- Logger,
45
- Models: ModelScope,
46
- Utils,
47
- };
@@ -1,4 +0,0 @@
1
- export * from './model';
2
- export * as ModelUtils from './model-utils';
3
- export { defineModel, registerModel } from './model-utils';
4
- export * from './migration-model';
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- const { Model } = require('./model');
4
- const { ModelModule } = require('./model-module');
5
- const { MigrationModel } = require('./migration-model');
6
- const {
7
- defineModel,
8
- registerModel,
9
- } = require('./model-utils');
10
-
11
- module.exports = {
12
- defineModel,
13
- registerModel,
14
- Model,
15
- ModelModule,
16
- MigrationModel,
17
- };
@@ -1,9 +0,0 @@
1
- import { ModelClass, Models } from 'mythix-orm';
2
- import { BaseModule } from '../modules/base-module';
3
-
4
- export declare class ModelModule extends BaseModule {
5
- getModelFilePaths(modelsPath: string): Array<string>;
6
- loadModels(modelsPath: string): Models;
7
- getModel(modelName?: string): ModelClass | undefined;
8
- getModels(): Models;
9
- }
@@ -1,130 +0,0 @@
1
- 'use strict';
2
-
3
- /* global __dirname */
4
-
5
- const Path = require('path');
6
- const { BaseModule } = require('../modules/base-module');
7
- const {
8
- fileNameWithoutExtension,
9
- walkDir,
10
- } = require('../utils');
11
-
12
- class ModelModule extends BaseModule {
13
- static fileWatcherQueueName = 'models';
14
-
15
- static getModuleName() {
16
- return 'ModelModule';
17
- }
18
-
19
- static shouldUse(application, options) {
20
- if (options.database === false)
21
- return false;
22
-
23
- return true;
24
- }
25
-
26
- constructor(application) {
27
- super(application);
28
-
29
- // Inject methods into the application
30
- Object.defineProperties(application, {
31
- 'getModel': {
32
- writable: true,
33
- enumerable: false,
34
- configurable: true,
35
- value: this.getModel.bind(this),
36
- },
37
- 'getModels': {
38
- writable: true,
39
- enumerable: false,
40
- configurable: true,
41
- value: this.getModels.bind(this),
42
- },
43
- });
44
- }
45
-
46
- fileWatcherGetMonitorPaths(options) {
47
- return [ options.modelsPath ];
48
- }
49
-
50
- async fileWatcherHandler(options) {
51
- await this.loadModels(options.modelsPath);
52
- }
53
-
54
- getModelFilePaths(modelsPath) {
55
- let modelFiles = walkDir(modelsPath, {
56
- filter: (fullFileName, fileName, stats) => {
57
- if (fileName.match(/^_/))
58
- return false;
59
-
60
- if (stats.isFile() && !fileNameWithoutExtension(fileName).match(/-model$/))
61
- return false;
62
-
63
- return true;
64
- },
65
- });
66
-
67
- let application = this.getApplication();
68
- let options = application.getOptions();
69
-
70
- if (options.noInternalMigrationTable !== true)
71
- modelFiles.push(Path.resolve(__dirname, 'migration-model.js'));
72
-
73
- return modelFiles;
74
- }
75
-
76
- loadModels(modelsPath) {
77
- let application = this.getApplication();
78
- let connection = (typeof application.getConnection === 'function') ? application.getConnection() : null;
79
- let dbConfig = (typeof application.getDBConfig === 'function') ? application.getDBConfig() : null;
80
- let modelFiles = this.getModelFilePaths(modelsPath);
81
- let models = {};
82
- let args = { application, connection, dbConfig };
83
-
84
- for (let i = 0, il = modelFiles.length; i < il; i++) {
85
- let modelFile = modelFiles[i];
86
-
87
- try {
88
- let modelGenerator = require(modelFile);
89
- if (modelGenerator.__esModule)
90
- modelGenerator = modelGenerator['default'];
91
-
92
- Object.assign(models, modelGenerator(args));
93
- } catch (error) {
94
- this.getLogger().error(`Error while loading model ${modelFile}: `, error);
95
- throw error;
96
- }
97
- }
98
-
99
- models = connection.registerModels(models, { forceConnectionBinding: true });
100
-
101
- return models;
102
- }
103
-
104
- getModel(modelName) {
105
- let application = this.getApplication();
106
- let connection = (typeof application.getConnection === 'function') ? application.getConnection() : null;
107
- if (!connection)
108
- return;
109
-
110
- return connection.getModel(modelName);
111
- }
112
-
113
- getModels() {
114
- let application = this.getApplication();
115
- let connection = (typeof application.getConnection === 'function') ? application.getConnection() : null;
116
- if (!connection)
117
- return {};
118
-
119
- return connection.getModels();
120
- }
121
-
122
- async start(options) {
123
- await this.loadModels(options.modelsPath);
124
- }
125
-
126
- async stop() {
127
- }
128
- }
129
-
130
- module.exports = { ModelModule };
@@ -1,20 +0,0 @@
1
- import { ConnectionBase, Types } from 'mythix-orm';
2
- import { Application } from '../application';
3
-
4
- export declare interface DefineModelContext<T> {
5
- Parent: T;
6
- Types: typeof Types;
7
- connection: ConnectionBase;
8
- modelName: string;
9
- application: Application;
10
- }
11
-
12
- export declare function registerModel<T>(
13
- Model: T,
14
- ): (context: { application: Application, connection: ConnectionBase }) => T;
15
-
16
- export declare function defineModel<T>(
17
- modelName: string,
18
- definer: (context: DefineModelContext<T>) => T,
19
- parent?: T,
20
- ): (context: { application: Application, connection: ConnectionBase }) => T;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- const { Types } = require('mythix-orm');
4
- const { Model: ModelBase } = require('./model');
5
-
6
- function _setupModel(modelName, _Model, { application }) {
7
- let Model = _Model;
8
- let tableName = Model.getTableName();
9
- let tablePrefix = application.getDBTablePrefix();
10
-
11
- if (tablePrefix)
12
- tableName = `${tablePrefix}${tableName}`.replace(/_+/g, '_');
13
-
14
- Model.getTableName = () => tableName;
15
- Model.getModelName = () => modelName;
16
- Model.getApplication = () => application;
17
-
18
- return { [modelName]: Model };
19
- }
20
-
21
- function registerModel(Model) {
22
- return function({ application, connection }) {
23
- return _setupModel(Model.getModelName(), Model, { application, connection });
24
- };
25
- }
26
-
27
- function defineModel(modelName, definer, _parent) {
28
- return function({ application, connection }) {
29
- let definerArgs = {
30
- Parent: (_parent) ? _parent : ModelBase,
31
- Types,
32
- connection,
33
- modelName,
34
- application,
35
- };
36
-
37
- let Model = definer(definerArgs);
38
-
39
- if (typeof Model.onModelClassCreate === 'function')
40
- Model = Model.onModelClassCreate(Model, definerArgs);
41
-
42
- return _setupModel(modelName, Model, { application, connection });
43
- };
44
- }
45
-
46
- module.exports = { defineModel, registerModel };
@@ -1,20 +0,0 @@
1
- import { Application } from '../application';
2
- import { Logger } from '../logger';
3
- import { ConnectionBase, Model as _Model, ModelClass } from 'mythix-orm';
4
- import { DefineModelContext } from './model-utils';
5
-
6
- export declare class Model extends _Model {
7
- declare public static getTableName: () => string;
8
- declare public static getModelName: () => string;
9
- declare public static getApplication: () => Application;
10
- declare public static getLogger: () => Logger;
11
- declare public static _getConnection: (connection?: ConnectionBase) => ConnectionBase;
12
- declare public static onModelClassFinalized?: (Model: ModelClass, definerArgs: DefineModelContext<Model>) => ModelClass;
13
-
14
- public getApplication(): Application;
15
- public getLogger(): Logger;
16
- public getConnection(connection?: ConnectionBase): ConnectionBase;
17
-
18
- // Deprecated
19
- public getDBConnection(connection?: ConnectionBase): ConnectionBase;
20
- }
@@ -1,65 +0,0 @@
1
- 'use strict';
2
-
3
- const { Model: _Model } = require('mythix-orm');
4
-
5
- class Model extends _Model {
6
- static getModel(modelName) {
7
- if (modelName) {
8
- let connection = this.getConnection();
9
- return connection.getModel(modelName);
10
- }
11
-
12
- return this;
13
- }
14
-
15
- static getModels() {
16
- let connection = this.getConnection();
17
- return connection.getModels();
18
- }
19
-
20
- getModel(modelName) {
21
- return this.constructor.getModel(modelName);
22
- }
23
-
24
- getModels() {
25
- return this.constructor.getModels();
26
- }
27
-
28
- getApplication() {
29
- return this.constructor.getApplication();
30
- }
31
-
32
- getLogger() {
33
- let application = this.getApplication();
34
- return application.getLogger();
35
- }
36
-
37
- getConnection(connection) {
38
- if (connection)
39
- return connection;
40
-
41
- let application = this.getApplication();
42
- if (!application)
43
- return null;
44
-
45
- if (typeof application.getConnection === 'function')
46
- return application.getConnection();
47
-
48
- return null;
49
- }
50
-
51
- // Deprecated
52
- getDBConnection(connection) {
53
- return this.getConnection(connection);
54
- }
55
-
56
- static _getConnection(_connection) {
57
- let connection = super._getConnection(_connection);
58
- if (connection)
59
- return connection;
60
-
61
- return this.getApplication().getConnection();
62
- }
63
- }
64
-
65
- module.exports = { Model };
@@ -1,13 +0,0 @@
1
- import { GenericObject } from '../interfaces/common';
2
- import { BaseModule } from './base-module';
3
-
4
- export declare class FileWatcherModule extends BaseModule {
5
- public getMonitoredPaths(options?: GenericObject): Array<string>;
6
- public isWatchedFile(monitoredPaths: Array<string>, filePath: string): boolean;
7
- public getFileScope(options: GenericObject, filePath: string): string;
8
- public autoReload(enable?: boolean, shuttingDown?: boolean): Promise<void>;
9
- public watchedFilesChanged(files: GenericObject): Promise<void>;
10
-
11
- declare public fileWatcher: any;
12
- declare public watchedPathsCache: Array<string>;
13
- }