UNPKG

faker-api

Version:

A fully customizible rest api faking package that allows you to mock , clone and fake Rest API with fake yet realistic data

108 lines 3.18 kB
/** * Field is the simples type of data of a model, it represent the type of data the model is ecpected to provide * @method generate This is used by a model to get the type of data the field is extected to provide */ declare abstract class Field { /** * This method is incharge of generating the fake value of the field * @returns - The value of the field */ abstract generate(): any; } declare class NameField extends Field { private _type; constructor(_type?: "FirstName" | "LastName" | "FullName"); generate(): string; } declare class EmailField extends Field { domain: string | undefined; constructor(domain?: string); generate(): string; } declare class TextField extends Field { private count; constructor(count?: number); generate(): string; } declare class PhoneNumberField extends Field { format: string | undefined; constructor(format?: string); generate(): string; } declare class AvatarField extends Field { generate(): string; } declare class IDField extends Field { generate(): string; } declare class GenderField extends Field { generate(): string; } declare class SexTypeField extends Field { generate(): "female" | "male"; } declare class UsernameField extends Field { generate(): string; } declare class ImageField extends Field { height: number; width: number; constructor(height?: number, width?: number); generate(): string; } declare class CountryField extends Field { generate(): string; } declare class CountryCodeField extends Field { generate(): string; } declare class StateField extends Field { generate(): string; } declare class LocationField extends Field { generate(): [latitude: string, longitude: string]; } declare class FullAddressField extends Field { generate(): string; } declare class NearByField extends Field { location: [lat: number, lng: number] | undefined; distance: number; constructor(location?: [lat: number, lng: number], distance?: number); generate(): [latitude: string, longitude: string]; } declare const Fields: { NameField: typeof NameField; EmailField: typeof EmailField; PhoneNumberField: typeof PhoneNumberField; TextField: typeof TextField; IDField: typeof IDField; GenderField: typeof GenderField; SexTypeField: typeof SexTypeField; AvatarField: typeof AvatarField; UsernameField: typeof UsernameField; ImageField: typeof ImageField; CountryField: typeof CountryField; CountryCodeField: typeof CountryCodeField; StateField: typeof StateField; LocationField: typeof LocationField; FullAddressField: typeof FullAddressField; NearByField: typeof NearByField; Name: NameField; Email: EmailField; Avatar: AvatarField; Gender: GenderField; UserName: UsernameField; PhoneNumber: PhoneNumberField; Text: TextField; ID: IDField; SexType: SexTypeField; Image: ImageField; Country: CountryField; CountryCode: CountryCodeField; State: StateField; Location: LocationField; Address: FullAddressField; }; export { Fields, Field }; //# sourceMappingURL=fields.d.ts.map