baseProcessor.ts 748 B

1234567891011121314151617181920212223242526272829303132
  1. import { Context } from '@nuxt/types/app'
  2. import { AnyJson, DataProviderArgs } from '~/types/interfaces'
  3. class BaseProcessor {
  4. protected arguments!: DataProviderArgs;
  5. protected ctx!: Context;
  6. constructor (ctx: Context, args: DataProviderArgs) {
  7. this.arguments = args
  8. this.ctx = ctx
  9. }
  10. /**
  11. * Is the given argument a supported model
  12. * @param _args
  13. */
  14. public static support (_args: DataProviderArgs): boolean {
  15. throw new Error('Not implemented')
  16. }
  17. /**
  18. * Process and return the given data to the Provider
  19. *
  20. * @param _data
  21. */
  22. // eslint-disable-next-line require-await
  23. public async process (_data: AnyJson): Promise<any> {
  24. throw new Error('Not implemented')
  25. }
  26. }
  27. export default BaseProcessor