Skip to content

docs(definitions): minor formatting to definitions' types #1172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions src/definitions/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,61 @@ export type AddressDefinitions = LocaleEntry<{
* Postcodes patterns by state
*/
postcode_by_state: { [state: string]: { min: number; max: number } };

/**
* Postcodes patterns (Fake-Pattern | Fake-Pattern[]).
* Postcodes patterns.
*/
postcode: string | string[];

/**
* The patterns to generate city names.
*/
city: string[];

/**
* The names of actual cities.
*/
city_name: string[];

/**
* Common city prefixes
* Common city prefixes.
*/
city_prefix: string[];

/**
* Common city suffixes
* Common city suffixes.
*/
city_suffix: string[];

/**
* The names of all countries
* The names of all countries.
*/
country: string[];

/**
* The names of this country's states
* The names of this country's states.
*/
state: string[];

/**
* The abbreviated names of this country's states
* The abbreviated names of this country's states.
*/
state_abbr: string[];

/**
* The names of counties inside the country or state
* The names of counties inside the country or state.
*/
county: string[];

/**
* The names of the compass directions.
* First the 4 cardinal directions, then the 4 ordinal directions
* First the 4 cardinal directions, then the 4 ordinal directions.
*/
direction: string[];

/**
* The abbreviated names of the compass directions.
* First the 4 cardinal directions, then the 4 ordinal directions
* First the 4 cardinal directions, then the 4 ordinal directions.
*/
direction_abbr: string[];

Expand All @@ -67,16 +75,19 @@ export type AddressDefinitions = LocaleEntry<{
* The patterns to generate street names.
*/
street: string[];

/**
* The names of actual streets.
*/
street_name: string[];

/**
* Common street prefixes
* Common street prefixes.
*/
street_prefix: string[];

/**
* Common street suffixes
* Common street suffixes.
*/
street_suffix: string[];

Expand All @@ -88,6 +99,7 @@ export type AddressDefinitions = LocaleEntry<{
* The fake pattern to generate only the street address.
*/
normal: string;

/**
* The fake pattern to generate the full street address including the secondary address.
*/
Expand All @@ -103,11 +115,14 @@ export type AddressDefinitions = LocaleEntry<{
* The ISO-3166-1 ALPHA-2 country codes related to this locale.
*/
country_code: string[];

/**
* The ISO-3166-1 ALPHA-3 country codes related to this locale.
*/
country_code_alpha_3: string[];

// A list of timezones names.
/**
* A list of timezones names.
*/
time_zone: string[];
}>;
5 changes: 3 additions & 2 deletions src/definitions/color.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { LocaleEntry } from './definitions';

/**
* The possible definitions related to color.
* The possible definitions related to colors.
*/
export type ColorDefinitions = LocaleEntry<{
/**
* Human readable color names
* Human readable color names.
*/
human: string[];

/**
* Color space names.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/definitions/commerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ export type CommerceDefinitions = LocaleEntry<{
* Department names inside a shop.
*/
department: string[];

/**
* Product name generation definitions.
*/
product_name: CommerceProductNameDefinitions;

/**
* Descriptions for products.
*/
Expand All @@ -26,10 +28,12 @@ export interface CommerceProductNameDefinitions {
* Adjectives describing a product (e.g. tasty).
*/
adjective: string[];

/**
* Materials describing a product (e.g. wood).
*/
material: string[];

/**
* Types of products (e.g. chair).
*/
Expand Down
14 changes: 10 additions & 4 deletions src/definitions/company.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,34 @@ export type CompanyDefinitions = LocaleEntry<{
* Business/products related adjectives.
*/
bs_adjective: string[];

/**
* Business/products related nouns.
*/
bs_noun: string[];

/**
* Business/products related verbs.
*/
bs_verb: string[];

/**
* Catch phrase adjectives.
* Catchphrase adjectives.
*/
adjective: string[];

/**
* Catch phrase adjectives.
* Catchphrase adjectives.
*/
descriptor: string[];

/**
* Catch phrase adjectives.
* Catchphrase adjectives.
*/
noun: string[];

/**
* Company suffixes
* Company suffixes.
*/
suffix: string[];
}>;
11 changes: 7 additions & 4 deletions src/definitions/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ import type { LocaleEntry } from './definitions';
*/
export type DatabaseDefinitions = LocaleEntry<{
/**
* Database Engine
* Database engines.
*/
engine: string[];

/**
* Database Collation
* Database collations.
*/
collation: string[];

/**
* Column names
* Column names.
*/
column: string[];

/**
* Column types
* Column types.
*/
type: string[];
}>;
4 changes: 4 additions & 0 deletions src/definitions/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type DateDefinitions = LocaleEntry<{
* The translations for months (January - December).
*/
month: DateEntryDefinition;

/**
* The translations for weekdays (Sunday - Saturday).
*/
Expand All @@ -22,15 +23,18 @@ export interface DateEntryDefinition {
* The long name of the entry.
*/
wide: string[];

/**
* The short name/abbreviation of the entry.
*/
abbr: string[];

/**
* The wide name of the entry when used in context. If absent wide will be used instead.
* It is used to specify a word in context, which may differ from a stand-alone word.
*/
wide_context?: string[];

/**
* The short name/abbreviation name of the entry when used in context. If absent abbr will be used instead.
* It is used to specify a word in context, which may differ from a stand-alone word.
Expand Down
6 changes: 5 additions & 1 deletion src/definitions/finance.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import type { LocaleEntry } from './definitions';

/**
* The possible definitions related to finances.
* The possible definitions related to finance.
*/
export type FinanceDefinitions = LocaleEntry<{
/**
* The types of accounts/purposes of an account (e.g. `Savings` account).
*/
account_type: string[];

/**
* The pattern by (lowercase) issuer name used to generate credit card codes.
* `L` will be replaced by the check bit.
*
* @see Helpers.replaceCreditCardSymbols()
*/
credit_card: { [issuer: string]: string[] };

/**
* Currencies by their full name and their symbols (e.g. `US Dollar` -> `USD` / `$`).
*/
currency: { [currencyName: string]: FinanceCurrencyEntryDefinitions };

/**
* Types of transactions (e.g. `deposit`).
*/
Expand All @@ -33,6 +36,7 @@ export interface FinanceCurrencyEntryDefinitions {
* The code/short text/abbreviation for the currency (e.g. `USD`).
*/
code: string;

/**
* The symbol for the currency (e.g. `$`).
*/
Expand Down
11 changes: 8 additions & 3 deletions src/definitions/hacker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,31 @@ export type HackerDefinitions = LocaleEntry<{
* Generic computer related abbreviations (e.g. `RAM`, `EXE`).
*/
abbreviation: string[];

/**
* Some computer related adjectives or descriptors (e.g. `digital`, `bluetooth`)
*/
adjective: string[];

/**
* Some computer related verbs for continuous actions (en: `ing` suffix; e.g. `hacking`).
*/
ingverb: string[];

/**
* Some computer related nouns (e.g. `protocol`, `sensor`)
* Some computer related nouns (e.g. `protocol`, `sensor`).
*/
noun: string[];

/**
* Some phrases that will be injected with random hacker words.
* May use any of the HackerDefinition keys wrapped in double braces.
* (e.g. `I'm {{ingverb}} {{adjective}} {{noun}}` )
* May use any of the HackerDefinition keys wrapped in double braces
* (e.g. `I'm {{ingverb}} {{adjective}} {{noun}}`).
*
* @see Helpers.mustache()
*/
phrase: string[];

/**
* Some computer related verbs (e.g. `hack`).
*/
Expand Down
4 changes: 4 additions & 0 deletions src/definitions/internet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ export type InternetDefinitions = LocaleEntry<{
* Common top level and similar domains (e.g `de`, `co.uk`).
*/
domain_suffix: string[];

/**
* Some email domains containing `example` (e.g. `example.com`).
*/
example_email: string[];

/**
* Some free-mail domains used in that country (e.g. `gmail.de`).
*/
free_email: string[];

/**
* List of all fully-qualified emojis.
*/
emoji: Record<EmojiType, string[]>;

/**
* List of some HTTP status codes.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type NameDefinitions = LocaleEntry<{
suffix: string[];

/**
* A list of patterns used to generate names (Fake-Pattern[]).
* A list of patterns used to generate names.
*/
name: string[];

Expand Down
3 changes: 2 additions & 1 deletion src/definitions/science.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export type ScienceDefinitions = LocaleEntry<{
* Some science units.
*/
unit: readonly Unit[];

/**
* Some periodic table element informtion.
* Some periodic table element information.
*/
chemicalElement: readonly ChemicalElement[];
}>;
5 changes: 3 additions & 2 deletions src/definitions/system.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import type { LocaleEntry } from './definitions';

/**
* The possible definitions related to files and the system.
* The possible definitions related to files and operating systems.
*/
export type SystemDefinitions = LocaleEntry<{
/**
* Returns some common file paths.
*/
directoryPaths: string[];

/**
* The mime type definitions with some additional information.
*/
mimeTypes: { [mimeType: string]: SystemMimeTypeEntryDefinitions };
}>;

/**
* The mime type entry details.
* The mime-type entry details.
*/
export interface SystemMimeTypeEntryDefinitions {
source?: string;
Expand Down
Loading