Skip to content

Commit

Permalink
refactor: reuse types
Browse files Browse the repository at this point in the history
  • Loading branch information
import-brain committed May 31, 2022
1 parent b3c3f5f commit 575351b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
26 changes: 1 addition & 25 deletions src/definitions/science.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ChemicalElement, Unit } from '../modules/science';
import type { LocaleEntry } from './definitions';

/**
Expand All @@ -13,28 +14,3 @@ export type ScienceDefinitions = LocaleEntry<{
*/
chemicalElement: ChemicalElement[];
}>;

/**
* The possible definitions related to elements.
*/
export interface ChemicalElement {
/**
* The symbol for the element (e.g. `He`).
*/
symbol: string;
/**
* The name for the element (e.g. `Cerium`).
*/
name: string;
}

export interface Unit {
/**
* The long version of the unit (e.g. `meter`).
*/
name: string;
/**
* The short version/abbreviation of the element (e.g. `Pa`).
*/
symbol: string;
}
17 changes: 16 additions & 1 deletion src/modules/science/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import type { Faker } from '../..';

/**
* The possible definitions related to elements.
*/
export interface ChemicalElement {
name: string;
/**
* The symbol for the element (e.g. `He`).
*/
symbol: string;
/**
* The name for the element (e.g. `Cerium`).
*/
name: string;
}

export interface Unit {
/**
* The long version of the unit (e.g. `meter`).
*/
name: string;
/**
* The short version/abbreviation of the element (e.g. `Pa`).
*/
symbol: string;
}

Expand Down

0 comments on commit 575351b

Please sign in to comment.