UNPKG

@italia-tools/faker

Version:

Italian-specific fake data generator based on Faker.js

50 lines (49 loc) 1.85 kB
import type { Faker } from "@faker-js/faker"; import type { BirthPlace, Province } from "../types/types"; import type { ItalianCity } from "../types/city"; import { Observable } from 'rxjs'; import type { Country } from "../types/country"; export declare class PlacesModule { private readonly faker; private dataSubject; private countrySubject; constructor(faker: Faker); private loadCityData; private loadCountryData; randomCity$(): Observable<ItalianCity>; randomCities$(count: number): Observable<ItalianCity[]>; province$(): Observable<Province>; city$(options?: { region?: string; province?: string; belfioreCode?: string; cityName?: string; }): Observable<ItalianCity | null>; allCities$(): Observable<ItalianCity[]>; mostPopulatedCities$(x: number): Observable<ItalianCity[]>; getBirthPlace$(): Observable<BirthPlace>; region$(): Observable<string>; preloadData$(): Observable<void>; randomCountry$(): Observable<Country>; getCountryByName$(name: string): Observable<Country | null>; getAllCountries$(): Observable<Country[]>; randomCity(): Promise<ItalianCity>; randomCities(count: number): Promise<ItalianCity[]>; province(): Promise<Province>; city(options?: { region?: string; province?: string; belfioreCode?: string; cityName?: string; }): Promise<ItalianCity | null>; allCities(): Promise<ItalianCity[]>; mostPopulatedCities(x: number): Promise<ItalianCity[]>; getBirthPlace(): Promise<BirthPlace>; region(): Promise<string>; preloadData(): Promise<void>; randomCountry(): Promise<Country>; getCountryByName(name: string): Promise<Country | null>; getAllCountries(): Promise<Country[]>; clearCache(): void; private selectItalianCity; }