Skip to content

Instantly share code, notes, and snippets.

@SippieCup
Created July 13, 2020 23:58
Show Gist options
  • Save SippieCup/2d5946482646fc3b2e958ae51336d5b7 to your computer and use it in GitHub Desktop.
Save SippieCup/2d5946482646fc3b2e958ae51336d5b7 to your computer and use it in GitHub Desktop.
BaseModel for Sequelize
import { Model } from 'sequelize';
export class BaseModel extends Model {
/**
* import the $clearQueue() method from Sequelize Mock
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
public static $clearQueue() {
throw new Error('Method not implemented.');
}
/**
* import the $queueResult() method from Sequelize Mock
*
* @param result - the value for Sequelize Mock to queue
* @param options - the queueResult.options object from Sequelize Mock
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
public static $queueResult(result: any, options?: object) {
throw new Error('Method not implemented.');
}
/**
* import the $queueFailure() method from Sequelize Mock
*
* @param result - the error, or error message to be converted to BaseError, by Sequelize Mock
* @param options - the queueFailure.options object from Sequelize Mock
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
public static $queueFailure(result: any, options?: object) {
throw new Error('Method not implemented.');
}
/**
* import the $useHandler function from Sequelize Mock
*
* @param result - the handler function to be added to the queryInterface
* @param options - the useHandler.options object from Sequelize Mock
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
public static $useHandler(result: any, options?: object) {
throw new Error('Method not implemented.');
}
/**
* import the $queryInterface function from Sequelize Mock
*
* @param result - input for the $queryInterface call
* @param options - the $queryInterface.options object
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
public static $queryInterface(result: any, options?: object) {
throw new Error('Method not implemented.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment