Skip to content

Commit

Permalink
Make sure declerations are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-s-ccs committed Nov 17, 2021
1 parent 1f62cec commit 05313bf
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/data/activeDataInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import frameworkConfig from '../frameworkConfig'
import IDMismatchError from '../errors/idMismatchError'
import KeysDoNotMatchError from '../errors/keysDoNotMatchError'
import UnexpectedDataTypeError from '../errors/unexpectedDataTypeError'
import { ActiveDataSchema, ActiveDataScheme } from '../@types/data/activeDataSchema'
import { Condition, ModelData } from '../@types/models/model'
import { ActiveDataSchema, ActiveDataScheme } from '../types/data/activeDataSchema'
import { Condition, ModelData } from '../types/models/model'
import { getRow, getTable } from './dataInterface'
import { Request } from 'express'
import { TableRow, Tables } from '../@types/data/tables'
import { TableRow, Tables } from '../types/data/tables'

const ACTIVE_DATA_SCHEMA_PATH: string = frameworkConfig.activeDataSchemaPath

Expand Down
4 changes: 2 additions & 2 deletions src/data/dataInterface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import RowNotFoundError from '../errors/rowNotFoundError'
import TableNotFoundError from '../errors/tableNotFoundError'
import { getRowOptions, getTableOptions, getTablesFunction } from '../@types/data/dataInterface'
import { TableRow } from '../@types/data/tables'
import { getRowOptions, getTableOptions, getTablesFunction } from '../types/data/dataInterface'
import { TableRow } from '../types/data/tables'

const getTable = (getTables: getTablesFunction, options: getTableOptions): Array<TableRow> => {
let table: Array<TableRow> = getTables(options.req)[options.tableName]
Expand Down
4 changes: 2 additions & 2 deletions src/data/staticDataInterface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import frameworkConfig from '../frameworkConfig'
import { Condition } from '../@types/models/model'
import { Condition } from '../types/models/model'
import { getRow, getTable } from './dataInterface'
import { TableRow, Tables } from '../@types/data/tables'
import { TableRow, Tables } from '../types/data/tables'

const STATIC_DATA_PATH: string = frameworkConfig.staticDataPath

Expand Down
2 changes: 1 addition & 1 deletion src/frameworkConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FrameworkConfig from './@types/frameworkConfig'
import FrameworkConfig from './types/frameworkConfig'

const frameworkConfig: FrameworkConfig = require.main?.require('./frameworkConfig.json') as FrameworkConfig

Expand Down
6 changes: 3 additions & 3 deletions src/models/active/activeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import Model from '../model'
import StaticModel from '../static/staticModel'
import StaticModelValidator from '../../validation/validators/staticModelValidator'
import Validator from '../../validation/validator'
import { ActiveModelInterface, Condition, ModelData, ModelError } from '../../@types/models/model'
import { ActiveModelInterface, Condition, ModelData, ModelError } from '../../types/models/model'
import { getActiveRow, getActiveTable, setActiveRow } from '../../data/activeDataInterface'
import { Request } from 'express'
import { Schema, Scheme } from '../../@types/validation/schema'
import { TableRow } from '../../@types/data/tables'
import { Schema, Scheme } from '../../types/validation/schema'
import { TableRow } from '../../types/data/tables'

abstract class ActiveModel extends Model implements ActiveModelInterface {
abstract tableName: string
Expand Down
2 changes: 1 addition & 1 deletion src/models/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ModelData, ModelInterface } from '../@types/models/model'
import { ModelData, ModelInterface } from '../types/models/model'

abstract class Model implements ModelInterface {
data: ModelData
Expand Down
2 changes: 1 addition & 1 deletion src/models/static/staticModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Model from '../model'
import { Condition, ModelData, StaticModelInterface } from '../../@types/models/model'
import { Condition, ModelData, StaticModelInterface } from '../../types/models/model'
import { getStaticRow, getStaticTable } from '../../data/staticDataInterface'

abstract class StaticModel extends Model implements StaticModelInterface {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/@types/index.ts → src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export { ModelError, ListError, Condition } from './models/model'

// Export validation types
export { Schema } from './validation/schema'
export { ValidatorOptions, StringValidatorOptions, NumberValidatorOptions, ValidatorInterface } from './validation/validator'
export { ValidatorOptions, StringValidatorOptions, NumberValidatorOptions, ValidatorInterface } from './validation/validator'
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/validation/validator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ValidatorInterface } from '../@types/validation/validator'
import { ValidatorOptions } from '../@types/validation/validator'
import { ValidatorInterface } from '../types/validation/validator'
import { ValidatorOptions } from '../types/validation/validator'

abstract class Validator implements ValidatorInterface {
options: ValidatorOptions
Expand Down
2 changes: 1 addition & 1 deletion src/validation/validators/customValidator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ActiveModel from '../../models/active/activeModel'
import Validator from '../validator'
import { CustomValidatorInterface } from '../../@types/validation/validator'
import { CustomValidatorInterface } from '../../types/validation/validator'

abstract class CustomValidator extends Validator implements CustomValidatorInterface {
model: ActiveModel
Expand Down
2 changes: 1 addition & 1 deletion src/validation/validators/inputValidator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Validator from '../validator'
import { InputValidatorInterface } from '../../@types/validation/validator'
import { InputValidatorInterface } from '../../types/validation/validator'

abstract class InputValidator extends Validator implements InputValidatorInterface {
input: any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InputValidator from '../inputValidator'
import { InclusionValidatorOptions } from '../../../@types/validation/validator'
import { InclusionValidatorOptions } from '../../../types/validation/validator'

class InclusionValidator extends InputValidator {
options: InclusionValidatorOptions = this.options as InclusionValidatorOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InputValidator from '../inputValidator'
import { NumberValidatorOptions } from '../../../@types/validation/validator'
import { NumberValidatorOptions } from '../../../types/validation/validator'

class NumberValidator extends InputValidator {
options: NumberValidatorOptions = this.options as NumberValidatorOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InputValidator from '../inputValidator'
import { StringValidatorOptions } from '../../../@types/validation/validator'
import { StringValidatorOptions } from '../../../types/validation/validator'

class StringValidator extends InputValidator {
options: StringValidatorOptions = this.options as StringValidatorOptions
Expand Down
2 changes: 1 addition & 1 deletion src/validation/validators/staticModelValidator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import StaticModel from '../../models/static/staticModel'
import Validator from '../validator'
import { StaticModelValidatorInterface } from '../../@types/validation/validator'
import { StaticModelValidatorInterface } from '../../types/validation/validator'

class StaticModelValidator extends Validator implements StaticModelValidatorInterface {
model: StaticModel
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */

/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
Expand Down Expand Up @@ -98,5 +98,5 @@
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
"exclude": ["node_modules"]
}

0 comments on commit 05313bf

Please sign in to comment.