import { FilterableMixin , LucidFilterContract } from '@ioc:Adonis/Addons/LucidFilter' ; import { QueryScope , QueryScopeCallback } from '@ioc:Adonis/Lucid/Orm' ; export const Filterable = ( superclass ) => { class FilterableModel extends superclass { public static $filter : ( ) => LucidFilterContract ; /**
         * Filter method of filterable model
         */ public static filter ( input , Filter ? ) { const filter = Filter || this . $filter ( ) ; return ( new filter ( this . query ( ) , input ) ) . handle ( ) ; } /**
         * Filtration scope of filterable model
         */ public static filtration = function ( query , input , Filter ? ) { const filter = Filter || ( this . $filter as ( ) => LucidFilterContract ) ( ) ; return ( new filter ( query , input ) ) . handle ( ) ; } as QueryScope < QueryScopeCallback > ; } return FilterableModel ; } ;