import ApiCall from "./ApiCall"; import StemmingDictionaries from "./StemmingDictionaries"; export interface StemmingDictionaryCreateSchema { root: string; word: string; } export interface StemmingDictionarySchema { id: string; words: StemmingDictionaryCreateSchema[]; } export interface StemmingDictionaryDeleteSchema { id: string; } export default class StemmingDictionary { constructor( private id: string, private apiCall: ApiCall, ) {} async retrieve(): Promise { return this.apiCall.get(this.endpointPath()); } async delete(): Promise { return this.apiCall.delete( this.endpointPath(), ); } private endpointPath(): string { return `${StemmingDictionaries.RESOURCEPATH}/${encodeURIComponent(this.id)}`; } }