UNPKG

@wursha/ngx-hadeethenc-api

Version:
67 lines (66 loc) 2.98 kB
import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { categoriesResponse, hadeethsListResponse, hadeethsOneResponse, languageResponse } from './ngx-hadeethenc-api.model'; import * as i0 from "@angular/core"; /** * an Angular api client for hadeethenc.com */ export declare class NgxHadeethencApiService { private http; private baseUrl; constructor(http: HttpClient); /** * List all available languages for HadeethEnc.com * @returns json object containing all available languages with their iso codes and native names. */ getLanguages(): Observable<languageResponse[]>; /** * List all categories by language code. * @param language language iso code * @returns array of json objects each object represents a category. */ getCategoriesList(language: string): Observable<categoriesResponse[]>; /** * List root categories by language code. * @param language language iso code * @returns root categories (main categories) in specific language, it accepts language iso code and returns json array of objects each object represents a root category. */ getCategoriesRoots(language: string): Observable<categoriesResponse[]>; /** * List Hadeeths by category id and language iso code. * @param p language iso code, category id, page number (optional, defaults to 1) ,Hadeeths per page(optional, defaults to 20) * @returns json object containing "data" object which contains array of json objects each object represents a Hadeeth basic information (id, title, translations iso codes), the second object is "meta" containing meta data required for pagination. */ getHadeethsList(p: { /** * language iso code */ language: string; categoryId: string; /** * page number, optional, defaults to 1 */ page?: string; /** * Hadeeths per page, optional, defaults to 20 */ perPage?: string; }): Observable<hadeethsListResponse>; /** * Get single Hadeeth details by Hadeeth id and language iso code. * @param p language iso code, hadeeth id * @returns The response differs when the language is "Arabic" or not, if it's Arabic then it returns all Hadeeth data (id, title, Hadeeth text (matn), explanation, hints (fawaed), word meaning and references), if non Arabic it returns translated parts (id, title, Hadeeth text (matn), explanation and hints (if translated), it doesnt return reference nor word meaning as they are not translated. */ getHadeethsOne(p: { /** * language iso code */ language: string; /** * hadeeth id */ id: string; }): Observable<hadeethsOneResponse>; static ɵfac: i0.ɵɵFactoryDeclaration<NgxHadeethencApiService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NgxHadeethencApiService>; }