aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorShinigami92 <[email protected]>2022-01-29 18:35:27 +0100
committerShinigami <[email protected]>2022-01-29 18:43:07 +0100
commit4ecdb506f6388dd1b8b83cb4dec42973aae7323e (patch)
tree1fa78cb573dc3d76b52f7d2c64a1a77830e7cf8f /src/index.ts
parent44628ecbbf8967c3a1313c6abfc62ad653cafe29 (diff)
downloadfaker-4ecdb506f6388dd1b8b83cb4dec42973aae7323e.tar.xz
faker-4ecdb506f6388dd1b8b83cb4dec42973aae7323e.zip
chore: add types for definitions
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts
index a42aa798..21365202 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -5,6 +5,7 @@ import { Company } from './company';
import { Database } from './database';
import { Datatype } from './datatype';
import { _Date } from './date';
+import type { Definitions } from './definitions';
import { Fake } from './fake';
import { Finance } from './finance';
import { Git } from './git';
@@ -193,6 +194,8 @@ export interface LocaleDefinition {
export type UsableLocale = LiteralUnion<KnownLocale>;
export type UsedLocales = Partial<Record<UsableLocale, LocaleDefinition>>;
+export type { Definitions };
+
export interface FakerOptions {
locales?: UsedLocales;
locale?: UsableLocale;
@@ -225,9 +228,8 @@ export class Faker {
locale: UsableLocale;
localeFallback: UsableLocale;
- // TODO @Shinigami92 2022-01-11: For now we loose types here
// @ts-expect-error: will be lazy filled by constructor
- readonly definitions: Record<keyof DefinitionTypes, any> = {};
+ readonly definitions: Definitions = {};
private readonly definitionTypes: DefinitionTypes = {
name: [
'first_name',