diff options
| author | ST-DDT <[email protected]> | 2022-02-01 17:31:52 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-01 17:31:52 +0100 |
| commit | 5e6754da61b63019fd063fad26adbeeabd8b789b (patch) | |
| tree | 954f7730feba92d951f66862d9165b99645f8981 /src/definitions/commerce.ts | |
| parent | 18b4349af05ca671f1fc4cff0c04d359e914f001 (diff) | |
| download | faker-5e6754da61b63019fd063fad26adbeeabd8b789b.tar.xz faker-5e6754da61b63019fd063fad26adbeeabd8b789b.zip | |
feat(types): provide strong typing for locales (#363)
Diffstat (limited to 'src/definitions/commerce.ts')
| -rw-r--r-- | src/definitions/commerce.ts | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/definitions/commerce.ts b/src/definitions/commerce.ts new file mode 100644 index 00000000..dbe22f69 --- /dev/null +++ b/src/definitions/commerce.ts @@ -0,0 +1,51 @@ +import { allOf } from './utils'; + +/** + * The possible definitions related to commerce. + */ +export interface CommerceDefinitions { + /** + * Human readable color names + */ + color: string[]; + /** + * Department names inside a shop. + */ + department: string[]; + /** + * Product name generation definitions. + */ + product_name: CommerceProductNameDefinitions; + /** + * Descriptions for products. + */ + product_description: string[]; +} + +/** + * The possible definitions related to product name generation. + */ +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). + */ + product: string[]; +} + +/** + * Internal: A list of all keys for the CommerceDefinitions. + */ +export const COMMERCE = allOf<keyof CommerceDefinitions>()( + 'color', + 'department', + 'product_name', + 'product_description' +); |
