From e1f019e1d3c1f68c2d69c1c4c0e496804673717a Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:30:31 +0200 Subject: [PATCH 01/53] extensive explanations and comments for unit system --- types/abstract/unit.ts | 141 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 138 insertions(+), 3 deletions(-) diff --git a/types/abstract/unit.ts b/types/abstract/unit.ts index b7d32f26..f22bf21f 100644 --- a/types/abstract/unit.ts +++ b/types/abstract/unit.ts @@ -1,130 +1,265 @@ +/** + * @file unit.ts + * @description Defines the scientific unit registry and physical dimensions. + * This file serves as the core module for physical quantities, their base units, + * prefixing rules, and dimensional analysis within the database. + */ + import type { Brand } from 'devtypes/types/util'; import type { MetricSystem, SIDimension } from '../../enum/util'; +/** + * Valid SI prefixes and their corresponding numerical factors. + */ export type SIPrefix = keyof typeof SIPrefix; export const SIPrefix = { - Y: 1e24, Z: 1e21, E: 1e18, P: 1e15, T: 1e12, G: 1e9, M: 1e6, k: 1e3, - h: 1e2, da: 1e1, d: 1e-1, c: 1e-2, m: 1e-3, µ: 1e-6, n: 1e-9, p: 1e-12, - f: 1e-15, a: 1e-18, z: 1e-21, y: 1e-24 + /** Yotta (10^24) */ Y: 1e24, /** Zetta (10^21) */ Z: 1e21, /** Exa (10^18) */ E: 1e18, + /** Peta (10^15) */ P: 1e15, /** Tera (10^12) */ T: 1e12, /** Giga (10^9) */ G: 1e9, + /** Mega (10^6) */ M: 1e6, /** Kilo (10^3) */ k: 1e3, /** Hecto (10^2) */ h: 1e2, + /** Deca (10^1) */ da: 1e1, /** Deci (10^-1) */ d: 1e-1, /** Centi (10^-2) */ c: 1e-2, + /** Milli (10^-3) */ m: 1e-3, /** Micro (10^-6) */ µ: 1e-6, /** Nano (10^-9) */ n: 1e-9, + /** Pico (10^-12) */ p: 1e-12, /** Femto (10^-15)*/ f: 1e-15, /** Atto (10^-18) */ a: 1e-18, + /** Zepto (10^-21)*/ z: 1e-21, /** Yocto (10^-24)*/ y: 1e-24 } as const; +/** + * The main registry of all supported physical quantities and their valid unit symbols. + */ export type ValidUnits = typeof ValidUnits; + +/** + * Union of all supported physical quantity identifiers. + */ export type PhysicalQuantity = keyof typeof ValidUnits; + +/** + * Detailed specification of units for each physical quantity. + */ export const ValidUnits = { + /** Base SI Dimension: Time */ time: { base: [ 's', 'min', 'h', 'd', 'a' ], prefixable: [ 's' ] }, + /** Base SI Dimension: Length */ length: { base: [ 'm', 'in', 'ft', 'yd', 'mi', 'Å', 'Ø' ], prefixable: [ 'm' ] }, + /** Base SI Dimension: Mass */ mass: { base: [ 'g', 't', 'oz', 'lb', 'u', 'Da' ], prefixable: [ 'g' ] }, + /** Base SI Dimension: Electric Current */ electricCurrent: { base: [ 'A' ], prefixable: [ 'A' ] }, + /** Base SI Dimension: Thermodynamic Temperature */ temperature: { base: [ 'K', '°C', '°F' ], prefixable: [] }, + /** Base SI Dimension: Amount of Substance */ amountOfSubstance: { base: [ 'mol' ], prefixable: [ 'mol' ] }, + /** Base SI Dimension: Luminous Intensity */ luminousIntensity: { base: [ 'cd' ], prefixable: [] }, + /** Derived Quantity: Velocity */ velocity: { base: [ 'm/s', 'km/h', 'mph', 'ft/s', 'knot', 'Mach' ], prefixable: [ 'm/s' ] }, + /** Derived Quantity: Acceleration */ acceleration: { base: [ 'm/s[2]', 'g', 'Gal' ], prefixable: [ 'm/s[2]' ] }, + /** Derived Quantity: Force */ force: { base: [ 'N', 'dyn', 'kgf', 'lbf' ], prefixable: [ 'N' ] }, + /** Derived Quantity: Surface Tension */ surfaceTension: { base: [ 'N/m', 'dyn/cm' ], prefixable: [ 'N/m' ] }, + /** Derived Quantity: Pressure */ pressure: { base: [ 'Pa', 'bar', 'atm', 'psi', 'torr', 'mmHg', 'inHg', 'cmH{2}O' ], prefixable: [ 'Pa', 'bar' ] }, + /** Derived Quantity: Energy */ energy: { base: [ 'J', 'eV', 'kcal', 'Wh', 'Btu', 'erg' ], prefixable: [ 'J', 'eV', 'Wh' ] }, + /** Derived Quantity: Power */ power: { base: [ 'W', 'hp', 'erg/s', 'kcal/s' ], prefixable: [ 'W' ] }, + /** Derived Quantity: Density */ density: { base: [ 'kg/m[3]', 'g/cm[3]', 'g/mL', 'lb/ft[3]' ], prefixable: [] }, + /** Derived Quantity: Absorption Coefficient (Optical) */ absorptionCoefficient: { base: [ 'm[-1]', 'L/(mol·cm)' ], prefixable: [ 'm[-1]' ] }, + /** Derived Quantity: Attenuation Coefficient (Signal) */ attenuationCoefficient: { base: [ 'm[-1]', 'dB/cm', 'dB/km' ], prefixable: [ 'm[-1]' ] }, + /** Derived Quantity: Material Compressibility */ compressibility: { base: [ 'Pa[-1]', 'bar[-1]' ], prefixable: [ 'Pa[-1]', 'bar[-1]' ] }, + /** Thermodynamics: Enthalpy (Molar/Mass) */ enthalpy: { base: [ 'J/mol', 'J/g', 'kcal/mol', 'eV', 'Btu/lb' ], prefixable: [ 'eV' ] }, + /** Thermodynamics: Entropy */ entropy: { base: [ 'J/(mol·K)', 'J/(g·K)', 'cal/(mol·K)', 'Btu/(lb·°F)' ], prefixable: [] }, + /** Thermodynamics: Total Heat Capacity */ heatCapacity: { base: [ 'J/(mol·K)', 'J/(g·K)', 'cal/(mol·K)', 'Btu/(lb·°F)' ], prefixable: [] }, + /** Thermodynamics: Specific Heat Capacity */ specificHeatCapacity: { base: [ 'J/(g·K)', 'J/(kg·K)', 'cal/(g·K)', 'Btu/(lb·°F)' ], prefixable: [] }, + /** Thermodynamics: Temperature Coefficient */ tempCoefficient: { base: [ 'K[-1]', 'ppm/K' ], prefixable: [] }, + /** Thermodynamics: Thermal Conductivity */ thermalConductivity: { base: [ 'W/(m·K)', 'W/(cm·K)', 'cal/(s·cm·K)' ], prefixable: [] }, + /** Thermodynamics: Thermal Expansion Coefficient */ thermalExpansion: { base: [ 'K[-1]', 'ppm/K' ], prefixable: [] }, + /** Thermodynamics: Thermal Diffusivity */ thermalDiffusivity: { base: [ 'm[2]/s', 'cm[2]/s' ], prefixable: [] }, + /** Electromagnetism: Electric Charge */ electricCharge: { base: [ 'C', 'e', 'Ah' ], prefixable: [ 'C' ] }, + /** Electromagnetism: Electric Potential / Voltage */ electricPotential: { base: [ 'V' ], prefixable: [ 'V' ] }, + /** Electromagnetism: Electric Resistance */ electricResistance: { base: [ 'Ω' ], prefixable: [ 'Ω' ] }, + /** Electromagnetism: Electric Conductance */ electricConductance: { base: [ 'S' ], prefixable: [ 'S' ] }, + /** Electromagnetism: Electric Conductivity (Specific) */ electricConductivity: { base: [ 'S/m', 'S/cm' ], prefixable: [ 'S/m' ] }, + /** Electromagnetism: Electric Resistivity (Specific) */ electricResistivity: { base: [ 'Ω·m', 'Ω·cm' ], prefixable: [ 'Ω·m' ] }, + /** Electromagnetism: Electric Dipole Moment */ dipoleMoment: { base: [ 'C·m', 'statC·cm', 'abC·cm' ], prefixable: [ 'C·m' ] }, + /** Magnetism: Magnetic Flux */ magneticFlux: { base: [ 'Wb', 'V·s' ], prefixable: [ 'Wb' ] }, + /** Magnetism: Magnetic Flux Density / Induction */ magneticFluxDensity: { base: [ 'T', 'G' ], prefixable: [ 'T', 'G' ] }, + /** Magnetism: Dimensionless or Specific Magnetic Susceptibility */ magneticSusceptibility: { base: [ '*', 'cm[3]/mol', 'm[3]/mol' ], prefixable: [] }, + /** Magnetism: Magnetic Moment */ magneticMoment: { base: [ 'J/T', 'A·m[2]', 'µ{B}', 'µ{N}' ], prefixable: [ 'J/T' ] }, + /** Magnetism: Magnetic Field Strength */ magneticFieldStrength: { base: [ 'A/m', 'Oe' ], prefixable: [ 'A/m' ] }, + /** Magnetism: Magnetic Permeability */ magneticPermeability: { base: [ 'H/m' ], prefixable: [ 'H/m' ] }, + /** Magnetism: Molar Magnetic Susceptibility */ molarMagneticSusceptibility: { base: [ 'cm[3]/mol', 'm[3]/mol' ], prefixable: [] }, + /** Magnetism: Mass (Gram) Magnetic Susceptibility */ massMagneticSusceptibility: { base: [ 'cm[3]/g', 'm[3]/kg' ], prefixable: [] }, + /** Photometry: Luminous Flux */ luminousFlux: { base: [ 'lm' ], prefixable: [] }, + /** Photometry: Illuminance */ illuminance: { base: [ 'lx', 'fc' ], prefixable: [] }, + /** Acoustics: Speed of Sound */ soundSpeed: { base: [ 'm/s', 'km/h', 'ft/s' ], prefixable: [ 'm/s' ] }, + /** Acoustics: Acoustic Impedance */ acousticImpedance: { base: [ 'Pa·s/m', 'kg/(m[2]·s)', 'Rayl' ], prefixable: [] }, + /** Chemistry: Molar Mass */ molarMass: { base: [ 'g/mol' ], prefixable: [ 'g/mol' ] }, + /** Chemistry: Molar Volume */ molarVolume: { base: [ 'L/mol', 'm[3]/mol' ], prefixable: [ 'L/mol', 'm[3]/mol' ] }, + /** Chemistry: Substance Concentration */ concentration: { base: [ 'mol/L', 'mol/m[3]', 'g/L', 'ppm', 'ppb' ], prefixable: [ 'mol/L', 'mol/m[3]', 'g/L' ] }, + /** Chemistry: Molarity (mol/L) */ molarity: { base: [ 'M', 'mol/L' ], prefixable: [ 'mol/L' ] }, + /** Chemistry: Molality (mol/kg) */ molality: { base: [ 'm', 'mol/kg' ], prefixable: [ 'mol/kg' ] }, + /** Chemistry: Dimensionless Mole Fraction */ moleFraction: { base: [ '%', '‰', '*', 'ppm', 'ppb', 'ppt' ], prefixable: [] }, + /** Chemistry: Molar Heat Capacity */ molarHeatCapacity: { base: [ 'J/(mol·K)', 'cal/(mol·K)' ], prefixable: [] }, + /** Fluid Dynamics: Dynamic Viscosity */ dynamicViscosity: { base: [ 'Pa·s', 'cP', 'poise', 'mPa·s' ], prefixable: [] }, + /** Fluid Dynamics: Kinematic Viscosity */ kinematicViscosity: { base: [ 'm[2]/s', 'cSt', 'stoke' ], prefixable: [] }, + /** Nuclear: Radioactive Activity */ activity: { base: [ 'Bq', 'Ci' ], prefixable: [ 'Bq', 'Ci' ] }, + /** Nuclear: Absorbed Radiation Dose */ absorbedDose: { base: [ 'Gy', 'rad' ], prefixable: [ 'Gy' ] }, + /** Magnetic Resonance: Gyromagnetic Ratio */ gyromagneticRatio: { base: [ 'rad/(s·T)' ] , prefixable: [] }, + /** General Physics: Frequency */ frequency: { base: [ 'Hz', 'rpm', 'rps' ], prefixable: [ 'Hz' ] }, + /** General Physics: Angular Measurement */ angle: { base: [ '°', 'rad', 'ʹ', 'ʺ', 'grad', 'turn' ], prefixable: [] }, + /** General Physics: Dimensionless Mass Fraction */ massFraction: { base: [ '%', '‰', '*', 'ppm', 'ppb', 'ppt' ], prefixable: [] }, + /** General Physics: Geometric Area */ area: { base: [ 'm[2]', 'b' ], prefixable: [ 'm[2]' ] }, + /** General Physics: Dimensionless Quantity */ quantity: { base: [ '*', '%', '‰', 'mol' ], prefixable: [] }, + /** Economics: Monetary Currency */ currency: { base: [ 'USD', 'EUR', 'CHF' ], prefixable: [] } } as const; +/** + * Extracts base unit symbols for a specific physical quantity. + * @template Q The physical quantity to extract symbols for. + */ export type BaseUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'base' ][ number ]; + +/** + * Extracts prefixable unit symbols for a specific physical quantity. + * @template Q The physical quantity to extract prefixable symbols for. + */ export type PrefixableUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'prefixable' ][ number ]; +/** + * Generates all possible symbols (including SI prefixes) for a quantity. + * @template Q The physical quantity to generate symbols for. + */ export type PrefixedSymbols< Q extends PhysicalQuantity > = | BaseUnitSymbols< Q > | `${ SIPrefix }${ PrefixableUnitSymbols< Q > }`; +/** + * Representation of the base SI dimensions: + * [ length, mass, time, current, temperature, amount, intensity ]. + */ export type DimensionVector = [ number, number, number, number, number, number, number ]; +/** + * Branded structure for a single scientific unit. + * @template Q The physical quantity this unit belongs to. + * @template U The specific symbol of this unit. + */ export type Unit< Q extends PhysicalQuantity, U extends BaseUnitSymbols< Q > > = Brand< { + /** The full human-readable name of the unit (e.g., "meters per second") */ name?: string; + /** Indicates if this is the fundamental base unit for the system */ isBase?: boolean; + /** Whether this unit can be combined with SI prefixes */ prefixable?: U extends PrefixableUnitSymbols< Q > ? true : false; + /** The metric or imperial system this unit originates from */ system?: MetricSystem; + /** Factors for converting this unit to the system base unit */ conversion?: { + /** The multiplication factor */ factor: number; + /** The additive offset (primarily for temperature scales) */ offset?: number; }; }, U, 'symbol', true >; +/** + * Defines the properties and available units for a physical quantity. + * @template Q The physical quantity being defined. + */ export type Quantity< Q extends PhysicalQuantity > = { + /** The physical dimension of the quantity */ dimension?: { + /** The shorthand symbol for the dimension (e.g., "L" for length) */ symbol: string; + /** The full name of the dimension (e.g., "length") */ name: string; + /** Whether this is a fundamental SI base dimension */ si: Q extends SIDimension ? true : false; + /** The exponents of the base SI dimensions */ vector: DimensionVector; }; + /** The reference unit symbol for this quantity */ baseUnit: BaseUnitSymbols< Q >; + /** A collection of all valid units for this quantity */ units: { [ U in BaseUnitSymbols< Q > ]: Unit< Q, U >; }; }; +/** + * A branded unique identifier for a unit, coupling the quantity with it's specific symbol. + * @template Q The physical quantity of the unit. + */ export type UnitId< Q extends PhysicalQuantity = PhysicalQuantity > = Brand< [ Q, PrefixedSymbols< Q > ], 'unitId' >; +/** + * A registry collecting multiple quantities and their unit definitions. + */ export type UnitCollection = { [ Q in PhysicalQuantity ]?: Quantity< Q >; }; From 9d77ea26c6c70a4a26d6ec77f6e028ecfa7a6daa Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:42:19 +0200 Subject: [PATCH 02/53] Update value.ts --- types/abstract/value.ts | 73 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/types/abstract/value.ts b/types/abstract/value.ts index accdbc36..481af997 100644 --- a/types/abstract/value.ts +++ b/types/abstract/value.ts @@ -1,3 +1,10 @@ +/** + * @file value.ts + * @description Core value representations for scientific data. + * This file provides the abstraction layer for primitive, structured, and physical values, + * supporting complex formats like uncertainty-aware ranges and coupled physical quantities. + */ + import type { RequireAtLeastOne, RequireExactlyOneFrom, RequireFrom, StrictSubset } from 'devtypes/types/constraint'; import type { Primitive } from 'devtypes/types/primitive'; import type { Brand, Expand } from 'devtypes/types/util'; @@ -5,57 +12,106 @@ import type { ValueType, ValueConfidence } from '../../enum/util'; import type { Uncertainty } from './uncertainty'; import type { PhysicalQuantity, UnitId } from './unit'; +/** + * Generic structural type for complex property values. + */ export type StructType = Record< string | number, unknown >; +/** + * Branded base attributes for all scientific value types. + * @template T The classification of the value (Primitive, Struct, Single, etc.). + */ export type BaseValue< T extends ValueType > = Brand< { + /** The degree of scientific certainty or validation status of the data */ confidence?: ValueConfidence; + /** Experimental or statistical uncertainty associated with the value */ uncertainty?: Uncertainty; + /** Contextual information or remarks regarding the specific value or measurement */ note?: string; }, T, 'type', true >; +/** + * Interface defining the possible fields for various value representations. + * @template Q The physical quantity (e.g., 'temperature', 'mass'). + * @template T The primitive data type (e.g., string, boolean). + * @template S The structure of complex objects. + */ export interface ValueFields< Q extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends StructType = StructType > { + /** A single data point */ value?: T; + /** A collection of discrete data points */ values?: T[]; + /** A continuous range between two boundary conditions */ range?: RequireAtLeastOne< Record< 'lower' | 'upper', { + /** The boundary value */ value: number; + /** Uncertainty specific to this boundary */ uncertainty?: Uncertainty; + /** Whether the boundary value is part of the set */ inclusive?: boolean; } > >; + /** The unit identification for physical quantities */ unit?: UnitId< Q >; + /** Structured object for complex data sets */ struct?: S; } +/** + * Represents a standard primitive value (string, number, boolean). + * @template T The specific primitive type. + */ export type PrimitiveValue< T extends Primitive = Primitive > = Expand< BaseValue< ValueType.PRIMITIVE > & RequireExactlyOneFrom< ValueFields< never, T >, 'value' | 'values' > >; +/** + * Represents a complex structured object. + * @template T The structure definition. + */ export type StructValue< T extends StructType = StructType > = Expand< BaseValue< ValueType.STRUCT > & RequireFrom< ValueFields< never, never, T >, 'struct' > >; +/** + * Represents a single measurement of a physical quantity with a unit. + * @template Q The physical quantity. + */ export type SingleValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< BaseValue< ValueType.SINGLE > & StrictSubset< ValueFields< Q, number >, 'value', 'unit' > >; +/** + * Represents an array of measurements for a physical quantity with a common unit. + * @template Q The physical quantity. + */ export type ArrayValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< BaseValue< ValueType.ARRAY > & StrictSubset< ValueFields< Q, number >, 'values', 'unit' > >; +/** + * Represents a numeric interval for a physical quantity. + * @template Q The physical quantity. + */ export type RangeValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< BaseValue< ValueType.RANGE > & StrictSubset< ValueFields< Q, number >, 'range', 'value' | 'unit' > >; +/** + * Represents multiple numeric physical quantities that are measured or defined together. + * @template Q The union of physical quantities involved. + */ export type CoupledNumberValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< BaseValue< ValueType.COUPLED > & { + /** A mapping of quantities to their respective single, array, or range values */ properties: RequireAtLeastOne< { [ K in Q ]?: | SingleValue< K > @@ -65,12 +121,19 @@ export type CoupledNumberValue< Q extends PhysicalQuantity = PhysicalQuantity > } >; +/** + * Represents a heterogeneous coupling of physical, primitive, and structured values. + * @template Q The physical quantities. + * @template T The primitives. + * @template S The structures. + */ export type CoupledValue< Q extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends StructType = StructType > = Expand< BaseValue< ValueType.COUPLED > & { + /** A registry of various value types grouped under a single coupled entity */ properties: RequireAtLeastOne< { [ K in Q ]?: | PrimitiveValue< T > @@ -82,12 +145,22 @@ export type CoupledValue< } >; +/** + * Generic numeric value for any physical quantity. + * @template Q The physical quantity. + */ export type NumberValue< Q extends PhysicalQuantity = PhysicalQuantity > = | SingleValue< Q > | ArrayValue< Q > | RangeValue< Q > | CoupledNumberValue< Q >; +/** + * The most abstract representation of a data value in the system. + * @template Q The physical quantities. + * @template T The primitives. + * @template S The structures. + */ export type Value< Q extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, From a7faed837ddc964fdea06d3762271d68f82aa09c Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:44:20 +0200 Subject: [PATCH 03/53] Update property.ts --- types/abstract/property.ts | 136 ++++++++++++++++++++++++++++++++++--- 1 file changed, 126 insertions(+), 10 deletions(-) diff --git a/types/abstract/property.ts b/types/abstract/property.ts index 5509e924..29a608e9 100644 --- a/types/abstract/property.ts +++ b/types/abstract/property.ts @@ -1,3 +1,10 @@ +/** + * @file property.ts + * @description Defines the abstract scientific property model. + * A property in this context is more than just a value; it encapsulates the measured data + * along with the experimental conditions and the verifiable sources (references). + */ + import type { Primitive } from 'devtypes/types/primitive'; import type { Expand } from 'devtypes/types/util'; import type { Conditions } from './condition'; @@ -5,69 +12,178 @@ import type { RefId } from './reference'; import type { PhysicalQuantity } from './unit'; import type * as value from './value'; +/** + * Base infrastructure for scientific properties, including environmental context and citations. + * @template C Physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export interface BaseProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > { + /** The state of environment (Temp, Press, etc.) during measurement */ conditions?: Conditions< C, T >; + /** Array of reference IDs pointing to the data source */ references?: RefId[]; } +/** + * Property carrying a primitive value (string, boolean, etc.). + * @template P The primitive type. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type PrimitiveProperty< P extends Primitive = Primitive, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.PrimitiveValue< P > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates primitive value structure */ + value.PrimitiveValue< P > +>; +/** + * Property carrying a complex structured object. + * @template S The structure definition. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type StructProperty< S extends value.StructType = value.StructType, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.StructValue< S > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates structured value definition */ + value.StructValue< S > +>; +/** + * Property carrying a single physical measurement (Value + Unit). + * @template Q The physical quantity. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type SingleProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.SingleValue< Q > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates single quantity value struct */ + value.SingleValue< Q > +>; +/** + * Property carrying multiple measurement points for a single quantity. + * @template Q The physical quantity. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type ArrayProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.ArrayValue< Q > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates array of quantity values */ + value.ArrayValue< Q > +>; +/** + * Property carrying a numeric range (interval) for a physical quantity. + * @template Q The physical quantity. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type RangeProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.RangeValue< Q > >; - +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates range value definition */ + value.RangeValue< Q > +>; +/** + * Property carrying multiple coupled numeric physical quantities. + * @template Q The physical quantity. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type CoupledNumberProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.CoupledNumberValue< Q > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates coupled numeric values */ + value.CoupledNumberValue< Q > +>; +/** + * Property carrying a heterogeneous coupling of various value types. + * @template Q The physical quantity. + * @template P The primitive type. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + * @template S The structure definition. + */ export type CoupledProperty< Q extends PhysicalQuantity = PhysicalQuantity, P extends Primitive = Primitive, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends value.StructType = value.StructType -> = Expand< BaseProperty< C, T > & value.CoupledValue< Q, P, S > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Incorporates heterogeneous coupled values */ + value.CoupledValue< Q, P, S > +>; +/** + * General numeric physical property. + * @template Q The physical quantity. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + */ export type NumberProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< BaseProperty< C, T > & value.NumberValue< Q > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Union of all numeric value representations */ + value.NumberValue< Q > +>; +/** + * The most abstract representation of a scientific property in the database. + * @template Q The physical quantity. + * @template P The primitive type. + * @template C The physical quantities defining measurement conditions. + * @template T Primitive types for condition values. + * @template S The structure definition. + */ export type Property< Q extends PhysicalQuantity = PhysicalQuantity, P extends Primitive = Primitive, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends value.StructType = value.StructType -> = Expand< BaseProperty< C, T > & value.Value< Q, P, S > >; +> = Expand< + /** Extends base property with experimental metadata */ + BaseProperty< C, T > & + /** Union of all supported value types */ + value.Value< Q, P, S > +>; From 286b5b60fa1b21c2cdc070504d7d8f4b16e9cae6 Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:48:17 +0200 Subject: [PATCH 04/53] add docs to condition.ts --- types/abstract/condition.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/types/abstract/condition.ts b/types/abstract/condition.ts index 7b36463d..27c9af51 100644 --- a/types/abstract/condition.ts +++ b/types/abstract/condition.ts @@ -1,11 +1,26 @@ +/** + * @file condition.ts + * @description Defines the environmental and experimental conditions under which measurements are performed. + * This ensures that scientific data (like boiling points or solubility) is correctly attributed + * to specific temperatures, pressures, or other states. + */ + import type { Primitive } from 'devtypes/types/primitive'; import type { StandardCondition } from '../../enum/util'; import type { PhysicalQuantity } from './unit'; import type { Value } from './value'; +/** + * A map of experimental conditions defining the state of a measurement. + * It can either be a predefined set (like STP) or a flexible mapping of physical quantities. + * @template Q The physical quantities defining the conditions (e.g., Temperature, Pressure). + * @template T The primitive types allowed for specialized conditions. + */ export type Conditions< Q extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = StandardCondition | { - [ K in Q ]?: Value< K, T >; -}; +> = + /** Predefined environmental standards (e.g., StandardCondition.STP) */ + | StandardCondition + /** A dictionary mapping specific physical quantities to their measured values during the experiment */ + | { [ K in Q ]?: Value< K, T > }; From 72f7c625c7a0764b8e6c223ebbb83aee05d2fdfb Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:49:51 +0200 Subject: [PATCH 05/53] Update collection.ts --- types/abstract/collection.ts | 39 ++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/types/abstract/collection.ts b/types/abstract/collection.ts index 484f9388..c29c1e97 100644 --- a/types/abstract/collection.ts +++ b/types/abstract/collection.ts @@ -1,20 +1,55 @@ +/** + * @file collection.ts + * @description Provides the structural logic for grouping scientific properties into collections. + * This file handles the recursive mapping of properties and nested groups, ensuring that + * the database schema remains modular and highly structured. + */ + import type { Expand } from 'devtypes/types/util'; import type { Property } from './property'; -export type Single< T extends Property > = T | T[]; - +/** + * Identity type wrapper to mark a value as a distinct entity in the collection tree. + * @template T The underlying type. + */ export type Distinct< T = unknown > = T; +/** + * Represents either a single property or an array of properties of the same type. + * @template T The property definition. + */ +export type Single< T extends Property > = T | T[]; + +/** + * A group of properties or distinct metadata entries organized in a record. + * @template T The record structure. + */ export type Group< T extends Record< string, Single< Property > | Distinct< unknown > > > = T; +/** + * Helper type that recursively resolves a value within a collection. + * It differentiates between nested properties, groups, distinct values, and general objects. + * @template T The type to be processed into a collection value. + */ export type CollectionValue< T > = + /** If it's a single property or array of properties, return the base property type */ [ T ] extends [ Single< infer P > ] ? P : + /** If it's a group, recurse into the group members */ [ T ] extends [ Group< infer G > ] ? { [ GK in keyof G ]: Collection< G[ GK ] > } : + /** Direct property match */ [ T ] extends [ Property ] ? T : + /** Distinct metadata/utility match */ [ T ] extends [ Distinct< infer D > ] ? Distinct< D > : + /** Expand any other object structures */ [ T ] extends [ object ] ? Expand< T > : + /** Fallback for primitives */ T; +/** + * Transforms a definition object into a concrete collection of resolved scientific properties. + * @template T The definition structure of the collection. + */ export type Collection< T > = { + /** Map each key of the definition to its resolved collection value */ [ K in keyof T ]: CollectionValue< T[ K ] >; }; From 682390011977f3978898c0b2252cff380074d002 Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:52:41 +0200 Subject: [PATCH 06/53] Update uncertainty.ts --- types/abstract/uncertainty.ts | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/types/abstract/uncertainty.ts b/types/abstract/uncertainty.ts index 3510c80a..468e538c 100644 --- a/types/abstract/uncertainty.ts +++ b/types/abstract/uncertainty.ts @@ -1,34 +1,72 @@ +/** + * @file uncertainty.ts + * @description Provides the data models for representing experimental uncertainty. + * This is crucial for scientific data where measurements are never absolute and require + * a standardized way to communicate precision and error margins. + */ + import type { RequireFrom } from 'devtypes/types/constraint'; import type { Brand, Expand } from 'devtypes/types/util'; import type { UncertaintyType } from '../../enum/util'; +/** + * Base structure for all scientific uncertainty types. + * @template T The specific type of uncertainty (absolute, relative, or asymmetrical). + */ export type BaseUncertainty< T extends UncertaintyType > = Brand< { + /** The statistical confidence level (e.g., 0.95 for a 95% confidence interval) */ confidence?: number; + /** Additional scientific notes regarding the measurement error or calculation method */ note?: string; }, T, 'type', true >; +/** + * Common fields used across different uncertainty models. + */ export interface UncertaintyFields { + /** The constant value of the error in the same unit as the measurement */ absolute?: number; + /** The fractional error relative to the measurement value (e.g., 0.01 for 1%) */ relative?: number; + /** The positive deviation in asymmetrical error models */ plus?: number; + /** The negative deviation in asymmetrical error models */ minus?: number; } +/** + * Represents an absolute error margin (e.g., ±0.05). + */ export type AbsoluteUncertainty = Expand< + /** Extends base uncertainty attributes restricted to the absolute type */ BaseUncertainty< UncertaintyType.ABSOLUTE > & + /** Requires the presence of the 'absolute' field */ RequireFrom< UncertaintyFields, 'absolute' > >; +/** + * Represents a relative error margin (e.g., ±2%). + */ export type RelativeUncertainty = Expand< + /** Extends base uncertainty attributes restricted to the relative type */ BaseUncertainty< UncertaintyType.RELATIVE > & + /** Requires the presence of the 'relative' field */ RequireFrom< UncertaintyFields, 'relative' > >; +/** + * Represents asymmetrical errors where the upper and lower bounds differ (e.g., +0.1/-0.05). + */ export type AsymmetricalUncertainty = Expand< + /** Extends base uncertainty attributes restricted to the asymmetrical type */ BaseUncertainty< UncertaintyType.ASYMMETRICAL > & + /** Requires both 'plus' and 'minus' fields to define the range */ RequireFrom< UncertaintyFields, 'plus' | 'minus' > >; +/** + * Union type facilitating any supported scientific uncertainty model. + */ export type Uncertainty = | AbsoluteUncertainty | RelativeUncertainty From a27c497c850d625585c7066d4f378a0f369457b5 Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:54:35 +0200 Subject: [PATCH 07/53] add documentation to form.ts --- types/abstract/form.ts | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/types/abstract/form.ts b/types/abstract/form.ts index 09296a0d..0c8e1e6c 100644 --- a/types/abstract/form.ts +++ b/types/abstract/form.ts @@ -1,3 +1,10 @@ +/** + * @file form.ts + * @description Defines the physical and structural forms of chemical entities. + * This file allows for the representation of allotropes, polymorphs, and phase-specific + * data, capturing the complexity of matter beyond simple elemental composition. + */ + import type { RequireFrom } from 'devtypes/types/constraint'; import type { DeepPartial } from 'devtypes/types/transform'; import type { Brand, Expand } from 'devtypes/types/util'; @@ -5,37 +12,76 @@ import type { Phase } from '../../enum/generic'; import type { FormType } from '../../enum/util'; import type { Collection, Distinct } from './collection'; +/** + * Base infrastructure for a specific physical form of a substance. + * @template T The classification of the form (Allotrope, Polymorph, etc.). + * @template C The collection of scientific properties applicable to this form. + */ export type BaseForm< T extends FormType, C extends Collection< any > > = Brand< { + /** Partial override of properties specific to this physical form */ properties?: DeepPartial< C >; + /** Descriptive note clarifying the nature or source of this specific form */ note?: Distinct< string >; }, T, 'type', true >; +/** + * Common descriptive fields for chemical forms. + */ export interface FormFields { + /** Specific chemical or structural formula for the form */ formula?: Distinct< string >; + /** The primary physical state (solid, liquid, gas, plasma) of this form */ phase?: Distinct< Phase >; } +/** + * Represents an allotropic variation (e.g., O2 vs O3) or other distinct modification. + */ export type AllotropeForm< C extends Collection< any > > = Expand< + /** Extends base form with Allotrope branding */ BaseForm< FormType.ALLOTROPE | FormType.OTHER, C > & + /** Includes standard formula and phase fields */ FormFields >; +/** + * Represents a molecular species with a strictly defined formula. + */ export type MolecularForm< C extends Collection< any > > = Expand< + /** Extends base form with Molecular branding */ BaseForm< FormType.MOLECULAR, C > & + /** Requires a chemical formula */ RequireFrom< FormFields, 'formula' > >; +/** + * Represents data specific to a certain physical state or phase transition. + */ export type PhaseForm< C extends Collection< any > > = Expand< + /** Extends base form with Phase-specific branding */ BaseForm< FormType.PHASE, C > & + /** Requires the definition of the physical state */ RequireFrom< FormFields, 'phase' > >; +/** + * Represents crystalline modifications (e.g., alpha-iron vs gamma-iron) or amorphous states. + */ export type PolymorphForm< C extends Collection< any > > = Expand< + /** Extends base form with Polymorph or Amorphous branding */ BaseForm< FormType.POLYMORPH | FormType.AMORPHOUS, C > >; +/** + * Branded identifier for a specific physical form within a collection. + */ export type FormId = Brand< string, 'formId' >; +/** + * A registry of multiple physical forms associated with a master chemical collection. + * @template C The base property collection for the substance. + */ export type FormCollection< C extends Collection< any > > = Record< FormId, Collection< + /** Mapping to one of the supported physical form representations */ AllotropeForm< C > | MolecularForm< C > | PhaseForm< C > | PolymorphForm< C > > >; From 37d199e1b322bdbf5ee071b0a0f42e05c29ecfd4 Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:55:48 +0200 Subject: [PATCH 08/53] Update utils.ts --- types/abstract/util.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/types/abstract/util.ts b/types/abstract/util.ts index a9d1633d..115ae638 100644 --- a/types/abstract/util.ts +++ b/types/abstract/util.ts @@ -1,16 +1,38 @@ +/** + * @file util.ts + * @description General utility types for the scientific database schema, including metadata structures + * and specialized groups for localized strings to ensure multi-language data integrity. + */ + import type { Expand } from 'devtypes/types/util'; import type { LangCode } from '../../enum/generic'; import type { Distinct, Group } from '../abstract/collection'; +/** + * Defines the root metadata structure for the schema. + * This ensures that every high-level entity or collection can be tracked for versioning and integrity. + */ export type MetaData = Distinct< { + /** Internal metadata object for administrative tracking */ '@metadata': { + /** The version of the schema used for this data object */ schemaVersion: 1; + /** ISO 8601 timestamp of the last modification */ lastModified: string; + /** Cryptographic hash for data integrity verification */ hash: string; }; } >; +/** + * A specialized group for localized strings or values. + * It enforces at least one primary language (usually English) and allows optional translations. + * @template L The primary language code(s) required for this group. + * @template T The type of the value being localized (defaults to string). + */ export type LangGroup< L extends LangCode = LangCode.ENGLISH, T = string > = Group< Expand< + /** Mandatory entries for the primary language(s) */ Required< { [ K in L ]: Distinct< T > } > & + /** Optional entries for all other supported languages */ Partial< { [ K in Exclude< LangCode, L > ]: Distinct< T > } > > >; From 4cda52ba76e864f0d83f9dd1b3c93158d4ba2e76 Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:56:26 +0200 Subject: [PATCH 09/53] add docs to reference.ts --- types/abstract/reference.ts | 128 ++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/types/abstract/reference.ts b/types/abstract/reference.ts index efd43ad1..a817a623 100644 --- a/types/abstract/reference.ts +++ b/types/abstract/reference.ts @@ -1,40 +1,85 @@ +/** + * @file reference.ts + * @description Provides the bibliographic data models for scientific references. + * The structures are strictly aligned with BibTeX standards to ensure compatibility + * with academic citation workflows and publication metadata. + */ + import type { ExtractFrom, RequireAtLeastOne, RequireExactlyOneFrom, StrictSubset } from 'devtypes/types/constraint'; import type { Brand, Expand } from 'devtypes/types/util'; import type { ReferenceType } from '../../enum/util'; +/** + * Base metadata shared by all bibliographic reference types. + * @template T The classification of the reference (Article, Book, etc.). + */ export type BaseReference< T extends ReferenceType > = Brand< { + /** ISO 8601 date when the source was last accessed (crucial for web resources) */ accessed?: string; + /** Direct link to the source material */ url?: string; + /** Digital Object Identifier - the unique permanent identifier for scholarly work */ doi?: string; }, T, 'type', true >; +/** + * Collection of standard BibTeX fields for academic citations. + */ export interface BibTeXFields { + /** Physical or electronic address of the publisher or institution */ address?: string; + /** Primary creator(s) of the work */ author?: string | string[]; + /** Title of the book when the reference is a chapter or paper within it */ booktitle?: string; + /** Specific chapter number within a larger work */ chapter?: string; + /** Version or edition of the publication (e.g., "3rd ed.") */ edition?: string; + /** Person(s) responsible for assembling the collection or volume */ editor?: string | string[]; + /** Alternative publication method for non-traditional sources */ howpublished?: string; + /** Official entity sponsoring a technical report or thesis */ institution?: string; + /** International Standard Book Number */ isbn?: string; + /** Name of the periodical in which the article was published */ journal?: string; + /** Month of publication */ month?: string; + /** Unstructured supplemental information or remarks */ note?: string; + /** Issue number within a volume */ number?: number | string; + /** Sponsoring organization for proceedings or manuals */ organization?: string; + /** Page numbers or physical extent (e.g., "123--145") */ pages?: number | string; + /** Entity responsible for the distribution of the work */ publisher?: string; + /** Categorization of technical documents (e.g., "Research Memo") */ reportType?: string; + /** The larger collection or series a book belongs to */ series?: string; + /** Academic institution where a thesis was defended */ school?: string; + /** The full title of the cited work */ title?: string; + /** Numerical volume of a journal or multi-volume book */ volume?: number | string; + /** Year of publication */ year?: number | string; } +/** + * Internal helper for thesis types (Master's, PhD, or general Thesis). + * @template T The specific thesis reference type. + */ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | ReferenceType.PHDTHESIS > = Expand< + /** Base reference metadata */ BaseReference< T > & + /** Subset of BibTeX fields mandatory for theses */ StrictSubset< BibTeXFields, 'author' | 'school' | 'title' | 'year', @@ -42,8 +87,14 @@ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | Refe > >; +/** + * Internal helper for conference-related types (Inproceedings or Conference). + * @template T The specific conference reference type. + */ type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDINGS > = Expand< + /** Base reference metadata */ BaseReference< T > & + /** Subset of BibTeX fields mandatory for conference papers */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'title' | 'year', @@ -51,8 +102,13 @@ type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDING > >; +/** + * Represents a standard academic journal article. + */ export type ArticleReference = Expand< + /** Extends base reference with Article type branding */ BaseReference< ReferenceType.ARTICLE > & + /** Mandatory: author, journal, title, year */ StrictSubset< BibTeXFields, 'author' | 'journal' | 'title' | 'year', @@ -60,9 +116,15 @@ export type ArticleReference = Expand< > >; +/** + * Represents a published book or monograph. + */ export type BookReference = Expand< + /** Extends base reference with Book type branding */ BaseReference< ReferenceType.BOOK > & + /** Must have either an author or an editor, but not both */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & + /** Mandatory: publisher, title, year */ StrictSubset< BibTeXFields, 'publisher' | 'title' | 'year', @@ -70,8 +132,13 @@ export type BookReference = Expand< > >; +/** + * Represents a bound work without a formal publisher (e.g., self-published research). + */ export type BookletReference = Expand< + /** Extends base reference with Booklet type branding */ BaseReference< ReferenceType.BOOKLET > & + /** Mandatory: title */ StrictSubset< BibTeXFields, 'title', @@ -79,11 +146,20 @@ export type BookletReference = Expand< > >; +/** + * Represents a paper presented at a scientific conference. + */ export type ConferenceReference = Conference< ReferenceType.CONFERENCE >; +/** + * Represents a specific part or chapter within a book. + */ export type InbookReference = Expand< + /** Extends base reference with Inbook type branding */ BaseReference< ReferenceType.INBOOK > & + /** Choice between primary author or book editor */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & + /** Requires at least a chapter number or page range */ RequireAtLeastOne< StrictSubset< BibTeXFields, @@ -94,8 +170,13 @@ export type InbookReference = Expand< > >; +/** + * Represents a standalone work published within a larger collection. + */ export type IncollectionReference = Expand< + /** Extends base reference with Incollection type branding */ BaseReference< ReferenceType.INCOLLECTION > & + /** Mandatory bibliographical data for collection items */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'publisher' | 'title' | 'year', @@ -103,10 +184,18 @@ export type IncollectionReference = Expand< > >; +/** + * Represents a paper in conference proceedings (aliased to Proceeding paper). + */ export type InproceedingsReference = Conference< ReferenceType.INPROCEEDINGS >; +/** + * Represents technical documentation or instruction manuals. + */ export type ManualReference = Expand< + /** Extends base reference with Manual type branding */ BaseReference< ReferenceType.MANUAL > & + /** Mandatory: title */ StrictSubset< BibTeXFields, 'title', @@ -114,22 +203,41 @@ export type ManualReference = Expand< > >; +/** + * Represents a Master's thesis. + */ export type MastersthesisReference = Thesis< ReferenceType.MASTERSTHESIS >; +/** + * Represents a general academic thesis. + */ export type ThesisReference = Thesis< ReferenceType.THESIS >; +/** + * Represents miscellaneous sources not fitting standard types (e.g., data sets). + */ export type MiscReference = Expand< + /** Extends base reference with Misc type branding */ BaseReference< ReferenceType.MISC > & + /** Allows any standard fields without strict constraints */ ExtractFrom< BibTeXFields, 'author' | 'howpublished' | 'month' | 'note' | 'title' | 'year' > >; +/** + * Represents a Doctoral dissertation. + */ export type PhdthesisReference = Thesis< ReferenceType.PHDTHESIS >; +/** + * Represents the full volume of conference proceedings. + */ export type ProceedingsReference = Expand< + /** Extends base reference with Proceedings type branding */ BaseReference< ReferenceType.PROCEEDINGS > & + /** Mandatory: title, year */ StrictSubset< BibTeXFields, 'title' | 'year', @@ -137,8 +245,13 @@ export type ProceedingsReference = Expand< > >; +/** + * Represents a formal report from an institution or organization. + */ export type TechreportReference = Expand< + /** Extends base reference with Techreport type branding */ BaseReference< ReferenceType.TECHREPORT > & + /** Mandatory: author, institution, title, year */ StrictSubset< BibTeXFields, 'author' | 'institution' | 'title' | 'year', @@ -146,8 +259,13 @@ export type TechreportReference = Expand< > >; +/** + * Represents scholarly work not yet formally published (e.g., pre-prints). + */ export type UnpublishedReference = Expand< + /** Extends base reference with Unpublished type branding */ BaseReference< ReferenceType.UNPUBLISHED > & + /** Mandatory: author, note, title */ StrictSubset< BibTeXFields, 'author' | 'note' | 'title', @@ -155,6 +273,9 @@ export type UnpublishedReference = Expand< > >; +/** + * Union type containing all supported scientific reference models. + */ export type Reference = | ArticleReference | BookReference @@ -172,6 +293,13 @@ export type Reference = | TechreportReference | UnpublishedReference; +/** + * A unique, branded string identifier for a reference within a registry. + */ export type RefId = Brand< string, 'refId' >; +/** + * A registry collecting multiple scientific references indexed by their unique IDs. + */ export type ReferenceCollection = Record< RefId, Reference >; + From 1a58fe7f2765f02722e01387445103795b87a170 Mon Sep 17 00:00:00 2001 From: komed3 Date: Thu, 16 Apr 2026 23:58:43 +0200 Subject: [PATCH 10/53] Update reference.ts --- types/abstract/reference.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/types/abstract/reference.ts b/types/abstract/reference.ts index a817a623..a84a3bac 100644 --- a/types/abstract/reference.ts +++ b/types/abstract/reference.ts @@ -10,7 +10,7 @@ import type { Brand, Expand } from 'devtypes/types/util'; import type { ReferenceType } from '../../enum/util'; /** - * Base metadata shared by all bibliographic reference types. + * Base branded metadata shared by all bibliographic reference types. * @template T The classification of the reference (Article, Book, etc.). */ export type BaseReference< T extends ReferenceType > = Brand< { @@ -79,7 +79,8 @@ export interface BibTeXFields { type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | ReferenceType.PHDTHESIS > = Expand< /** Base reference metadata */ BaseReference< T > & - /** Subset of BibTeX fields mandatory for theses */ + /** Mandatory: author, school, title, year */ + /** Optional: address, month, note, reportType */ StrictSubset< BibTeXFields, 'author' | 'school' | 'title' | 'year', @@ -94,7 +95,8 @@ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | Refe type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDINGS > = Expand< /** Base reference metadata */ BaseReference< T > & - /** Subset of BibTeX fields mandatory for conference papers */ + /** Mandatory: author, booktitle, title, year */ + /** Optional: address, editor, month, note, number, organization, pages, publisher, series, volume */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'title' | 'year', @@ -109,6 +111,7 @@ export type ArticleReference = Expand< /** Extends base reference with Article type branding */ BaseReference< ReferenceType.ARTICLE > & /** Mandatory: author, journal, title, year */ + /** Optional: month, note, number, pages, volume */ StrictSubset< BibTeXFields, 'author' | 'journal' | 'title' | 'year', @@ -125,6 +128,7 @@ export type BookReference = Expand< /** Must have either an author or an editor, but not both */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & /** Mandatory: publisher, title, year */ + /** Optional: address, edition, isbn, month, note, number, series, volume */ StrictSubset< BibTeXFields, 'publisher' | 'title' | 'year', @@ -139,6 +143,7 @@ export type BookletReference = Expand< /** Extends base reference with Booklet type branding */ BaseReference< ReferenceType.BOOKLET > & /** Mandatory: title */ + /** Optional: address, author, howpublished, month, note, year */ StrictSubset< BibTeXFields, 'title', @@ -160,6 +165,7 @@ export type InbookReference = Expand< /** Choice between primary author or book editor */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & /** Requires at least a chapter number or page range */ + /** Optional: address, edition, month, note, number, reportType, series, volume */ RequireAtLeastOne< StrictSubset< BibTeXFields, @@ -177,6 +183,7 @@ export type IncollectionReference = Expand< /** Extends base reference with Incollection type branding */ BaseReference< ReferenceType.INCOLLECTION > & /** Mandatory bibliographical data for collection items */ + /** Optional: address, chapter, edition, editor, month, note, number, pages, reportType, series, volume */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'publisher' | 'title' | 'year', @@ -196,6 +203,7 @@ export type ManualReference = Expand< /** Extends base reference with Manual type branding */ BaseReference< ReferenceType.MANUAL > & /** Mandatory: title */ + /** Optional: address, author, edition, month, note, organization, year */ StrictSubset< BibTeXFields, 'title', @@ -220,6 +228,7 @@ export type MiscReference = Expand< /** Extends base reference with Misc type branding */ BaseReference< ReferenceType.MISC > & /** Allows any standard fields without strict constraints */ + /** Optional: author, howpublished, month, note, title, year */ ExtractFrom< BibTeXFields, 'author' | 'howpublished' | 'month' | 'note' | 'title' | 'year' @@ -238,6 +247,7 @@ export type ProceedingsReference = Expand< /** Extends base reference with Proceedings type branding */ BaseReference< ReferenceType.PROCEEDINGS > & /** Mandatory: title, year */ + /** Optional: address, editor, month, note, number, organization, publisher, series, volume */ StrictSubset< BibTeXFields, 'title' | 'year', @@ -252,6 +262,7 @@ export type TechreportReference = Expand< /** Extends base reference with Techreport type branding */ BaseReference< ReferenceType.TECHREPORT > & /** Mandatory: author, institution, title, year */ + /** Optional: address, month, note, number, reportType */ StrictSubset< BibTeXFields, 'author' | 'institution' | 'title' | 'year', @@ -266,6 +277,7 @@ export type UnpublishedReference = Expand< /** Extends base reference with Unpublished type branding */ BaseReference< ReferenceType.UNPUBLISHED > & /** Mandatory: author, note, title */ + /** Optional: month, year */ StrictSubset< BibTeXFields, 'author' | 'note' | 'title', From 1852120301295b81a302d7717e176618bdf136fd Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 00:04:07 +0200 Subject: [PATCH 11/53] Update reference.ts --- types/abstract/reference.ts | 73 ++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/types/abstract/reference.ts b/types/abstract/reference.ts index a84a3bac..d7163fc7 100644 --- a/types/abstract/reference.ts +++ b/types/abstract/reference.ts @@ -74,13 +74,14 @@ export interface BibTeXFields { /** * Internal helper for thesis types (Master's, PhD, or general Thesis). + * - Mandatory: author, school, title, year + * - Optional: address, month, note, reportType * @template T The specific thesis reference type. */ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | ReferenceType.PHDTHESIS > = Expand< /** Base reference metadata */ BaseReference< T > & - /** Mandatory: author, school, title, year */ - /** Optional: address, month, note, reportType */ + /** Specific BibTeX fields for theses */ StrictSubset< BibTeXFields, 'author' | 'school' | 'title' | 'year', @@ -90,13 +91,14 @@ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | Refe /** * Internal helper for conference-related types (Inproceedings or Conference). + * - Mandatory: author, booktitle, title, year + * - Optional: address, editor, month, note, number, organization, pages, publisher, series, volume * @template T The specific conference reference type. */ type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDINGS > = Expand< /** Base reference metadata */ BaseReference< T > & - /** Mandatory: author, booktitle, title, year */ - /** Optional: address, editor, month, note, number, organization, pages, publisher, series, volume */ + /** Specific BibTeX fields for conferences */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'title' | 'year', @@ -106,12 +108,13 @@ type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDING /** * Represents a standard academic journal article. + * - Mandatory: author, journal, title, year + * - Optional: month, note, number, pages, volume */ export type ArticleReference = Expand< /** Extends base reference with Article type branding */ BaseReference< ReferenceType.ARTICLE > & - /** Mandatory: author, journal, title, year */ - /** Optional: month, note, number, pages, volume */ + /** Specific BibTeX fields for articles */ StrictSubset< BibTeXFields, 'author' | 'journal' | 'title' | 'year', @@ -121,14 +124,15 @@ export type ArticleReference = Expand< /** * Represents a published book or monograph. + * - Constraint: Must have either an author or an editor, but not both. + * - Mandatory: publisher, title, year + * - Optional: address, edition, isbn, month, note, number, series, volume */ export type BookReference = Expand< /** Extends base reference with Book type branding */ BaseReference< ReferenceType.BOOK > & - /** Must have either an author or an editor, but not both */ + /** Specific BibTeX fields for books */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & - /** Mandatory: publisher, title, year */ - /** Optional: address, edition, isbn, month, note, number, series, volume */ StrictSubset< BibTeXFields, 'publisher' | 'title' | 'year', @@ -138,12 +142,13 @@ export type BookReference = Expand< /** * Represents a bound work without a formal publisher (e.g., self-published research). + * - Mandatory: title + * - Optional: address, author, howpublished, month, note, year */ export type BookletReference = Expand< /** Extends base reference with Booklet type branding */ BaseReference< ReferenceType.BOOKLET > & - /** Mandatory: title */ - /** Optional: address, author, howpublished, month, note, year */ + /** Specific BibTeX fields for booklets */ StrictSubset< BibTeXFields, 'title', @@ -153,19 +158,23 @@ export type BookletReference = Expand< /** * Represents a paper presented at a scientific conference. + * - Mandatory: author, booktitle, title, year + * - Optional: address, editor, month, note, number, organization, pages, publisher, series, volume */ export type ConferenceReference = Conference< ReferenceType.CONFERENCE >; /** * Represents a specific part or chapter within a book. + * - Constraint: Choice between primary author or book editor. + * - Constraint: Requires at least a chapter number or page range. + * - Mandatory: booktitle, publisher, title, year + * - Optional: address, edition, month, note, number, reportType, series, volume */ export type InbookReference = Expand< /** Extends base reference with Inbook type branding */ BaseReference< ReferenceType.INBOOK > & - /** Choice between primary author or book editor */ + /** Specific BibTeX fields for inbooks */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & - /** Requires at least a chapter number or page range */ - /** Optional: address, edition, month, note, number, reportType, series, volume */ RequireAtLeastOne< StrictSubset< BibTeXFields, @@ -178,12 +187,13 @@ export type InbookReference = Expand< /** * Represents a standalone work published within a larger collection. + * - Mandatory: author, booktitle, publisher, title, year + * - Optional: address, chapter, edition, editor, month, note, number, pages, reportType, series, volume */ export type IncollectionReference = Expand< /** Extends base reference with Incollection type branding */ BaseReference< ReferenceType.INCOLLECTION > & - /** Mandatory bibliographical data for collection items */ - /** Optional: address, chapter, edition, editor, month, note, number, pages, reportType, series, volume */ + /** Specific BibTeX fields for incollections */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'publisher' | 'title' | 'year', @@ -198,12 +208,13 @@ export type InproceedingsReference = Conference< ReferenceType.INPROCEEDINGS >; /** * Represents technical documentation or instruction manuals. + * - Mandatory: title + * - Optional: address, author, edition, month, note, organization, year */ export type ManualReference = Expand< /** Extends base reference with Manual type branding */ BaseReference< ReferenceType.MANUAL > & - /** Mandatory: title */ - /** Optional: address, author, edition, month, note, organization, year */ + /** Specific BibTeX fields for manuals */ StrictSubset< BibTeXFields, 'title', @@ -213,22 +224,27 @@ export type ManualReference = Expand< /** * Represents a Master's thesis. + * - Mandatory: author, school, title, year + * - Optional: address, month, note, reportType */ export type MastersthesisReference = Thesis< ReferenceType.MASTERSTHESIS >; /** * Represents a general academic thesis. + * - Mandatory: author, school, title, year + * - Optional: address, month, note, reportType */ export type ThesisReference = Thesis< ReferenceType.THESIS >; /** * Represents miscellaneous sources not fitting standard types (e.g., data sets). + * - Mandatory: title + * - Optional: author, howpublished, month, note, year */ export type MiscReference = Expand< /** Extends base reference with Misc type branding */ BaseReference< ReferenceType.MISC > & - /** Allows any standard fields without strict constraints */ - /** Optional: author, howpublished, month, note, title, year */ + /** Specific BibTeX fields for misc */ ExtractFrom< BibTeXFields, 'author' | 'howpublished' | 'month' | 'note' | 'title' | 'year' @@ -237,17 +253,20 @@ export type MiscReference = Expand< /** * Represents a Doctoral dissertation. + * - Mandatory: author, school, title, year + * - Optional: address, month, note, reportType */ export type PhdthesisReference = Thesis< ReferenceType.PHDTHESIS >; /** * Represents the full volume of conference proceedings. + * - Mandatory: title, year + * - Optional: address, editor, month, note, number, organization, publisher, series, volume */ export type ProceedingsReference = Expand< /** Extends base reference with Proceedings type branding */ BaseReference< ReferenceType.PROCEEDINGS > & - /** Mandatory: title, year */ - /** Optional: address, editor, month, note, number, organization, publisher, series, volume */ + /** Specific BibTeX fields for proceedings */ StrictSubset< BibTeXFields, 'title' | 'year', @@ -257,12 +276,13 @@ export type ProceedingsReference = Expand< /** * Represents a formal report from an institution or organization. + * - Mandatory: author, institution, title, year + * - Optional: address, month, note, number, reportType */ export type TechreportReference = Expand< /** Extends base reference with Techreport type branding */ BaseReference< ReferenceType.TECHREPORT > & - /** Mandatory: author, institution, title, year */ - /** Optional: address, month, note, number, reportType */ + /** Specific BibTeX fields for techreports */ StrictSubset< BibTeXFields, 'author' | 'institution' | 'title' | 'year', @@ -272,12 +292,13 @@ export type TechreportReference = Expand< /** * Represents scholarly work not yet formally published (e.g., pre-prints). + * - Mandatory: author, note, title + * - Optional: month, year */ export type UnpublishedReference = Expand< /** Extends base reference with Unpublished type branding */ BaseReference< ReferenceType.UNPUBLISHED > & - /** Mandatory: author, note, title */ - /** Optional: month, year */ + /** Specific BibTeX fields for unpublished */ StrictSubset< BibTeXFields, 'author' | 'note' | 'title', From f6ae1c6414ea33d7572588408909743bcf0ca3a0 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 00:07:40 +0200 Subject: [PATCH 12/53] fix typedoc entry point --- typedoc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typedoc.json b/typedoc.json index 8a1e48f1..bf45b71f 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,6 +1,6 @@ { "$schema": "https://typedoc.org/schema.json", - "entryPoints": [ "./types/*" ], + "entryPoints": [ "./types/*", "./enum/*" ], "entryPointStrategy": "expand", "out": "docs", "githubPages": true, From 8ef8892fcc53c163810ee01e5a99341bdd7ce17d Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 09:32:02 +0200 Subject: [PATCH 13/53] Update form.ts --- types/abstract/form.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/types/abstract/form.ts b/types/abstract/form.ts index 0c8e1e6c..efaa9f5b 100644 --- a/types/abstract/form.ts +++ b/types/abstract/form.ts @@ -36,31 +36,28 @@ export interface FormFields { /** * Represents an allotropic variation (e.g., O2 vs O3) or other distinct modification. + * Includes standard formula and phase fields. */ export type AllotropeForm< C extends Collection< any > > = Expand< - /** Extends base form with Allotrope branding */ BaseForm< FormType.ALLOTROPE | FormType.OTHER, C > & - /** Includes standard formula and phase fields */ FormFields >; /** * Represents a molecular species with a strictly defined formula. + * Requires a chemical formula. */ export type MolecularForm< C extends Collection< any > > = Expand< - /** Extends base form with Molecular branding */ BaseForm< FormType.MOLECULAR, C > & - /** Requires a chemical formula */ RequireFrom< FormFields, 'formula' > >; /** * Represents data specific to a certain physical state or phase transition. + * Requires the definition of the physical state. */ export type PhaseForm< C extends Collection< any > > = Expand< - /** Extends base form with Phase-specific branding */ BaseForm< FormType.PHASE, C > & - /** Requires the definition of the physical state */ RequireFrom< FormFields, 'phase' > >; @@ -68,7 +65,6 @@ export type PhaseForm< C extends Collection< any > > = Expand< * Represents crystalline modifications (e.g., alpha-iron vs gamma-iron) or amorphous states. */ export type PolymorphForm< C extends Collection< any > > = Expand< - /** Extends base form with Polymorph or Amorphous branding */ BaseForm< FormType.POLYMORPH | FormType.AMORPHOUS, C > >; @@ -83,5 +79,8 @@ export type FormId = Brand< string, 'formId' >; */ export type FormCollection< C extends Collection< any > > = Record< FormId, Collection< /** Mapping to one of the supported physical form representations */ - AllotropeForm< C > | MolecularForm< C > | PhaseForm< C > | PolymorphForm< C > + | AllotropeForm< C > + | MolecularForm< C > + | PhaseForm< C > + | PolymorphForm< C > > >; From 51cf99e92b2f57aea6f708b8dd2cb73d32d8d7d8 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 09:35:21 +0200 Subject: [PATCH 14/53] fix comments --- types/abstract/property.ts | 27 +++++++++------------------ types/abstract/uncertainty.ts | 9 +++------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/types/abstract/property.ts b/types/abstract/property.ts index 29a608e9..22aae811 100644 --- a/types/abstract/property.ts +++ b/types/abstract/property.ts @@ -29,6 +29,7 @@ export interface BaseProperty< /** * Property carrying a primitive value (string, boolean, etc.). + * Incorporates primitive value structure. * @template P The primitive type. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -38,14 +39,13 @@ export type PrimitiveProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates primitive value structure */ value.PrimitiveValue< P > >; /** * Property carrying a complex structured object. + * Incorporates structured value definition. * @template S The structure definition. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -55,14 +55,13 @@ export type StructProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates structured value definition */ value.StructValue< S > >; /** * Property carrying a single physical measurement (Value + Unit). + * Incorporates single quantity value struct. * @template Q The physical quantity. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -72,14 +71,13 @@ export type SingleProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates single quantity value struct */ value.SingleValue< Q > >; /** * Property carrying multiple measurement points for a single quantity. + * Incorporates array of quantity values. * @template Q The physical quantity. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -89,14 +87,13 @@ export type ArrayProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates array of quantity values */ value.ArrayValue< Q > >; /** * Property carrying a numeric range (interval) for a physical quantity. + * Incorporates range value definition. * @template Q The physical quantity. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -106,14 +103,13 @@ export type RangeProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates range value definition */ value.RangeValue< Q > >; /** * Property carrying multiple coupled numeric physical quantities. + * Incorporates coupled numeric values. * @template Q The physical quantity. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -123,14 +119,13 @@ export type CoupledNumberProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates coupled numeric values */ value.CoupledNumberValue< Q > >; /** * Property carrying a heterogeneous coupling of various value types. + * Incorporates heterogeneous coupled values. * @template Q The physical quantity. * @template P The primitive type. * @template C The physical quantities defining measurement conditions. @@ -144,14 +139,13 @@ export type CoupledProperty< T extends Primitive = Primitive, S extends value.StructType = value.StructType > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Incorporates heterogeneous coupled values */ value.CoupledValue< Q, P, S > >; /** * General numeric physical property. + * Union of all numeric value representations. * @template Q The physical quantity. * @template C The physical quantities defining measurement conditions. * @template T Primitive types for condition values. @@ -161,14 +155,13 @@ export type NumberProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Union of all numeric value representations */ value.NumberValue< Q > >; /** * The most abstract representation of a scientific property in the database. + * Union of all supported value types. * @template Q The physical quantity. * @template P The primitive type. * @template C The physical quantities defining measurement conditions. @@ -182,8 +175,6 @@ export type Property< T extends Primitive = Primitive, S extends value.StructType = value.StructType > = Expand< - /** Extends base property with experimental metadata */ BaseProperty< C, T > & - /** Union of all supported value types */ value.Value< Q, P, S > >; diff --git a/types/abstract/uncertainty.ts b/types/abstract/uncertainty.ts index 468e538c..66661e9a 100644 --- a/types/abstract/uncertainty.ts +++ b/types/abstract/uncertainty.ts @@ -36,31 +36,28 @@ export interface UncertaintyFields { /** * Represents an absolute error margin (e.g., ±0.05). + * Requires the presence of the 'absolute' field. */ export type AbsoluteUncertainty = Expand< - /** Extends base uncertainty attributes restricted to the absolute type */ BaseUncertainty< UncertaintyType.ABSOLUTE > & - /** Requires the presence of the 'absolute' field */ RequireFrom< UncertaintyFields, 'absolute' > >; /** * Represents a relative error margin (e.g., ±2%). + * Requires the presence of the 'relative' field. */ export type RelativeUncertainty = Expand< - /** Extends base uncertainty attributes restricted to the relative type */ BaseUncertainty< UncertaintyType.RELATIVE > & - /** Requires the presence of the 'relative' field */ RequireFrom< UncertaintyFields, 'relative' > >; /** * Represents asymmetrical errors where the upper and lower bounds differ (e.g., +0.1/-0.05). + * Requires both 'plus' and 'minus' fields to define the range. */ export type AsymmetricalUncertainty = Expand< - /** Extends base uncertainty attributes restricted to the asymmetrical type */ BaseUncertainty< UncertaintyType.ASYMMETRICAL > & - /** Requires both 'plus' and 'minus' fields to define the range */ RequireFrom< UncertaintyFields, 'plus' | 'minus' > >; From 739277b6a6cb86a01b025e229e32c2db466777bf Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 09:36:55 +0200 Subject: [PATCH 15/53] Update unit.ts --- types/abstract/unit.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/abstract/unit.ts b/types/abstract/unit.ts index f22bf21f..9fbb6dc7 100644 --- a/types/abstract/unit.ts +++ b/types/abstract/unit.ts @@ -192,7 +192,9 @@ export type PrefixableUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q * @template Q The physical quantity to generate symbols for. */ export type PrefixedSymbols< Q extends PhysicalQuantity > = + /** Base unit symbols */ | BaseUnitSymbols< Q > + /** SI prefixed unit symbols */ | `${ SIPrefix }${ PrefixableUnitSymbols< Q > }`; /** @@ -258,7 +260,7 @@ export type UnitId< Q extends PhysicalQuantity = PhysicalQuantity > = Brand< >; /** - * A registry collecting multiple quantities and their unit definitions. + * The unit registry collecting all physical quantities and their unit definitions. */ export type UnitCollection = { [ Q in PhysicalQuantity ]?: Quantity< Q >; From c495f81a3ab2b6e7d63398a84850edab1d629749 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 09:40:08 +0200 Subject: [PATCH 16/53] Update value.ts --- types/abstract/value.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/abstract/value.ts b/types/abstract/value.ts index 481af997..444b8d22 100644 --- a/types/abstract/value.ts +++ b/types/abstract/value.ts @@ -62,6 +62,7 @@ export interface ValueFields< /** * Represents a standard primitive value (string, number, boolean). + * Requires either a single value or an array of values. * @template T The specific primitive type. */ export type PrimitiveValue< T extends Primitive = Primitive > = Expand< @@ -71,6 +72,7 @@ export type PrimitiveValue< T extends Primitive = Primitive > = Expand< /** * Represents a complex structured object. + * Requires the presence of the 'struct' field. * @template T The structure definition. */ export type StructValue< T extends StructType = StructType > = Expand< @@ -80,6 +82,7 @@ export type StructValue< T extends StructType = StructType > = Expand< /** * Represents a single measurement of a physical quantity with a unit. + * Requires a single value. Optionally includes a physical quantity unit. * @template Q The physical quantity. */ export type SingleValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< @@ -89,6 +92,7 @@ export type SingleValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expan /** * Represents an array of measurements for a physical quantity with a common unit. + * Requires an array of values. Optionally includes a physical quantity unit. * @template Q The physical quantity. */ export type ArrayValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< @@ -98,6 +102,7 @@ export type ArrayValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand /** * Represents a numeric interval for a physical quantity. + * Requires a range of values. Optionally includes a physical quantity unit and single value. * @template Q The physical quantity. */ export type RangeValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< From 784ff5efb8f3638f1e8e3325cf37155388dda618 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 09:45:25 +0200 Subject: [PATCH 17/53] some types will be internal only --- types/abstract/collection.ts | 2 +- types/abstract/form.ts | 4 ++-- types/abstract/property.ts | 2 +- types/abstract/reference.ts | 4 ++-- types/abstract/uncertainty.ts | 4 ++-- types/abstract/unit.ts | 6 +++--- types/abstract/value.ts | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/abstract/collection.ts b/types/abstract/collection.ts index c29c1e97..4f15c9e5 100644 --- a/types/abstract/collection.ts +++ b/types/abstract/collection.ts @@ -31,7 +31,7 @@ export type Group< T extends Record< string, Single< Property > | Distinct< unkn * It differentiates between nested properties, groups, distinct values, and general objects. * @template T The type to be processed into a collection value. */ -export type CollectionValue< T > = +type CollectionValue< T > = /** If it's a single property or array of properties, return the base property type */ [ T ] extends [ Single< infer P > ] ? P : /** If it's a group, recurse into the group members */ diff --git a/types/abstract/form.ts b/types/abstract/form.ts index efaa9f5b..fc91aac6 100644 --- a/types/abstract/form.ts +++ b/types/abstract/form.ts @@ -17,7 +17,7 @@ import type { Collection, Distinct } from './collection'; * @template T The classification of the form (Allotrope, Polymorph, etc.). * @template C The collection of scientific properties applicable to this form. */ -export type BaseForm< T extends FormType, C extends Collection< any > > = Brand< { +type BaseForm< T extends FormType, C extends Collection< any > > = Brand< { /** Partial override of properties specific to this physical form */ properties?: DeepPartial< C >; /** Descriptive note clarifying the nature or source of this specific form */ @@ -27,7 +27,7 @@ export type BaseForm< T extends FormType, C extends Collection< any > > = Brand< /** * Common descriptive fields for chemical forms. */ -export interface FormFields { +interface FormFields { /** Specific chemical or structural formula for the form */ formula?: Distinct< string >; /** The primary physical state (solid, liquid, gas, plasma) of this form */ diff --git a/types/abstract/property.ts b/types/abstract/property.ts index 22aae811..b3520024 100644 --- a/types/abstract/property.ts +++ b/types/abstract/property.ts @@ -17,7 +17,7 @@ import type * as value from './value'; * @template C Physical quantities defining measurement conditions. * @template T Primitive types for condition values. */ -export interface BaseProperty< +interface BaseProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > { diff --git a/types/abstract/reference.ts b/types/abstract/reference.ts index d7163fc7..9eb89a9c 100644 --- a/types/abstract/reference.ts +++ b/types/abstract/reference.ts @@ -13,7 +13,7 @@ import type { ReferenceType } from '../../enum/util'; * Base branded metadata shared by all bibliographic reference types. * @template T The classification of the reference (Article, Book, etc.). */ -export type BaseReference< T extends ReferenceType > = Brand< { +type BaseReference< T extends ReferenceType > = Brand< { /** ISO 8601 date when the source was last accessed (crucial for web resources) */ accessed?: string; /** Direct link to the source material */ @@ -25,7 +25,7 @@ export type BaseReference< T extends ReferenceType > = Brand< { /** * Collection of standard BibTeX fields for academic citations. */ -export interface BibTeXFields { +interface BibTeXFields { /** Physical or electronic address of the publisher or institution */ address?: string; /** Primary creator(s) of the work */ diff --git a/types/abstract/uncertainty.ts b/types/abstract/uncertainty.ts index 66661e9a..a25bae62 100644 --- a/types/abstract/uncertainty.ts +++ b/types/abstract/uncertainty.ts @@ -13,7 +13,7 @@ import type { UncertaintyType } from '../../enum/util'; * Base structure for all scientific uncertainty types. * @template T The specific type of uncertainty (absolute, relative, or asymmetrical). */ -export type BaseUncertainty< T extends UncertaintyType > = Brand< { +type BaseUncertainty< T extends UncertaintyType > = Brand< { /** The statistical confidence level (e.g., 0.95 for a 95% confidence interval) */ confidence?: number; /** Additional scientific notes regarding the measurement error or calculation method */ @@ -23,7 +23,7 @@ export type BaseUncertainty< T extends UncertaintyType > = Brand< { /** * Common fields used across different uncertainty models. */ -export interface UncertaintyFields { +interface UncertaintyFields { /** The constant value of the error in the same unit as the measurement */ absolute?: number; /** The fractional error relative to the measurement value (e.g., 0.01 for 1%) */ diff --git a/types/abstract/unit.ts b/types/abstract/unit.ts index 9fbb6dc7..bec03617 100644 --- a/types/abstract/unit.ts +++ b/types/abstract/unit.ts @@ -179,19 +179,19 @@ export const ValidUnits = { * Extracts base unit symbols for a specific physical quantity. * @template Q The physical quantity to extract symbols for. */ -export type BaseUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'base' ][ number ]; +type BaseUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'base' ][ number ]; /** * Extracts prefixable unit symbols for a specific physical quantity. * @template Q The physical quantity to extract prefixable symbols for. */ -export type PrefixableUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'prefixable' ][ number ]; +type PrefixableUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'prefixable' ][ number ]; /** * Generates all possible symbols (including SI prefixes) for a quantity. * @template Q The physical quantity to generate symbols for. */ -export type PrefixedSymbols< Q extends PhysicalQuantity > = +type PrefixedSymbols< Q extends PhysicalQuantity > = /** Base unit symbols */ | BaseUnitSymbols< Q > /** SI prefixed unit symbols */ diff --git a/types/abstract/value.ts b/types/abstract/value.ts index 444b8d22..62fea231 100644 --- a/types/abstract/value.ts +++ b/types/abstract/value.ts @@ -21,7 +21,7 @@ export type StructType = Record< string | number, unknown >; * Branded base attributes for all scientific value types. * @template T The classification of the value (Primitive, Struct, Single, etc.). */ -export type BaseValue< T extends ValueType > = Brand< { +type BaseValue< T extends ValueType > = Brand< { /** The degree of scientific certainty or validation status of the data */ confidence?: ValueConfidence; /** Experimental or statistical uncertainty associated with the value */ @@ -36,7 +36,7 @@ export type BaseValue< T extends ValueType > = Brand< { * @template T The primitive data type (e.g., string, boolean). * @template S The structure of complex objects. */ -export interface ValueFields< +interface ValueFields< Q extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends StructType = StructType From 3d3d5b29c9ad98a3a6df0d9364edc37646e279fd Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 10:55:34 +0200 Subject: [PATCH 18/53] remove trailing spaces --- types/abstract/property.ts | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/types/abstract/property.ts b/types/abstract/property.ts index b3520024..b588782a 100644 --- a/types/abstract/property.ts +++ b/types/abstract/property.ts @@ -38,9 +38,9 @@ export type PrimitiveProperty< P extends Primitive = Primitive, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.PrimitiveValue< P > +> = Expand< + BaseProperty< C, T > & + value.PrimitiveValue< P > >; /** @@ -54,9 +54,9 @@ export type StructProperty< S extends value.StructType = value.StructType, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.StructValue< S > +> = Expand< + BaseProperty< C, T > & + value.StructValue< S > >; /** @@ -70,9 +70,9 @@ export type SingleProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.SingleValue< Q > +> = Expand< + BaseProperty< C, T > & + value.SingleValue< Q > >; /** @@ -86,9 +86,9 @@ export type ArrayProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.ArrayValue< Q > +> = Expand< + BaseProperty< C, T > & + value.ArrayValue< Q > >; /** @@ -102,9 +102,9 @@ export type RangeProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.RangeValue< Q > +> = Expand< + BaseProperty< C, T > & + value.RangeValue< Q > >; /** @@ -118,9 +118,9 @@ export type CoupledNumberProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.CoupledNumberValue< Q > +> = Expand< + BaseProperty< C, T > & + value.CoupledNumberValue< Q > >; /** @@ -138,9 +138,9 @@ export type CoupledProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends value.StructType = value.StructType -> = Expand< - BaseProperty< C, T > & - value.CoupledValue< Q, P, S > +> = Expand< + BaseProperty< C, T > & + value.CoupledValue< Q, P, S > >; /** @@ -154,9 +154,9 @@ export type NumberProperty< Q extends PhysicalQuantity = PhysicalQuantity, C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive -> = Expand< - BaseProperty< C, T > & - value.NumberValue< Q > +> = Expand< + BaseProperty< C, T > & + value.NumberValue< Q > >; /** @@ -174,7 +174,7 @@ export type Property< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive, S extends value.StructType = value.StructType -> = Expand< - BaseProperty< C, T > & - value.Value< Q, P, S > +> = Expand< + BaseProperty< C, T > & + value.Value< Q, P, S > >; From 44bdf901ebcfeb332d14d241e77c219721d9577c Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 10:56:14 +0200 Subject: [PATCH 19/53] describe utility enums --- enum/util.ts | 137 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 121 insertions(+), 16 deletions(-) diff --git a/enum/util.ts b/enum/util.ts index ba704ade..1c9c36b0 100644 --- a/enum/util.ts +++ b/enum/util.ts @@ -1,117 +1,222 @@ +/** + * @file util.ts + * @description Defines technical enums for data structuring, metadata, and scientific standards. + * This module includes value types, confidence levels, standard conditions, and units of measurement. + */ + +/** + * Technical representation models for data values within the schema. + */ export enum ValueType { + /** A single, primitive data point (e.g., number or string) */ PRIMITIVE = 'primitive', + /** A complex object containing nested fields and sub-properties */ STRUCT = 'struct', + /** A discrete individual measurement or value */ SINGLE = 'single', + /** A collection of values of the same type */ ARRAY = 'array', + /** A continuous interval between two numeric bounds */ RANGE = 'range', + /** Coupled values for entries based on multiple physical properties */ COUPLED = 'coupled' }; +/** + * Degree of scientific reliability and origin of a specific data point. + */ export enum ValueConfidence { + /** Obtained through direct physical observation or instrumentation */ MEASURED = 'measured', + /** Derived from established formulas or numerical simulations */ CALCULATED = 'calculated', + /** Approximated through heuristic models or incomplete data */ ESTIMATED = 'estimated', + /** Validated through specific, controlled scientific experiments */ EXPERIMENTAL = 'experimental', + /** Based on theoretical physics or chemical principles without empirical validation */ THEORETICAL = 'theoretical' }; +/** + * Structural classification for a variant of a substance; see allotropes. + */ export enum FormType { + /** Elemental variants in the same physical state (e.g., Diamond vs Graphite) */ ALLOTROPE = 'allotrope', + /** Based on the connectivity or arrangement of atoms in a molecule */ MOLECULAR = 'molecular', + /** Corresponding to a specific state of matter (Solid, Liquid, Gas) */ PHASE = 'phase', + /** Solid crystalline forms of the same compound (e.g., Quartz vs Cristobalite) */ POLYMORPH = 'polymorph', + /** Non-crystalline solid lacking long-range atomic order */ AMORPHOUS = 'amorphous', + /** Categorized into a non-standard or miscellaneous structural type */ OTHER = 'other' }; +/** + * Systems of units used to represent physical quantities. + */ export enum MetricSystem { + /** The International System of Units (SI) or its variants */ METRIC = 'metric', + /** Historical system used primarily in the UK */ IMPERIAL = 'imperial', + /** Customary system used in the United States */ US = 'us', + /** Non-standard or application-specific unit set */ CUSTOM = 'custom', + /** System of measurement is not specified or recognized */ UNKNOWN = 'unknown' }; +/** + * Fundamental dimensions of the International System of Units (SI). + */ export enum SIDimension { + /** Physical dimension of temporal duration */ TIME = 'time', + /** Physical dimension of distance or spatial extent */ LENGTH = 'length', + /** Physical dimension of inertia and gravitational attraction */ MASS = 'mass', + /** Rate of flow of electric charge */ ELECTRIC_CURRENT = 'electricCurrent', + /** Degree of thermal energy in a system */ TEMPERATURE = 'temperature', + /** Number of elementary entities in a sample */ AMOUNT_OF_SUBSTANCE = 'amountOfSubstance', + /** Power emitted by a light source in a particular direction */ LUMINOUS_INTENSITY = 'luminousIntensity' }; +/** + * Standard conditions for temperature and pressure in scientific measurements. + */ export enum StandardCondition { - /** T=0; P=100; IUPAC (STP) since 1982 */ + /** T=0°C (273.15K); P=100kPa (1 bar). IUPAC standard since 1982 */ STP = 'STP', - /** T=0; P=101.325; NIST, ISO 10780, former IUPAC STP */ + /** T=0°C; P=101.325kPa (1 atm). Older NIST and ISO standard */ STP_ATM = 'STP_ATM', - /** T=20; P=101.325; EPA, NIST */ + /** T=20°C; P=101.325kPa. EPA and NIST standard conditions */ NTP = 'NTP', - /** T=15; P=101.325; ICAO ISA, ISO 13443, EEA, EGIA (SI) */ + /** T=15°C; P=101.325kPa. International Standard Atmosphere */ ISA = 'ISA', - /** T=22; P=101.325; American Association of Physicists in Medicine */ + /** T=22°C; P=101.325kPa. Medical physics standard (AAPM) */ AAPM = 'AAPM', - /** T=25; P=101.325; SATP, EPA */ + /** T=25°C; P=101.325kPa. Standard Ambient Temperature and Pressure */ SATP = 'SATP', - /** T=20; P=100; CAGI */ + /** T=20°C; P=100kPa. Compressed Air and Gas Institute standard */ CAGI = 'CAGI', - /** T=15; P=100; SPE */ + /** T=15°C; P=100kPa. Society of Petroleum Engineers standard */ SPE = 'SPE', - /** T=20; P=101.3; ISO 5011 */ + /** T=20°C; P=101.3kPa. ISO internal combustion engine standard */ ISO_5011 = 'ISO_5011', - /** T=20; P=101.33; GOST 2939-63 */ + /** T=20°C; P=101.33kPa. Former Soviet Union GOST standard */ GOST_2939_63 = 'GOST_2939_63', - /** T=15.56; P=101.6; EGIA (Imperial System) */ + /** T=15.56°C (60°F); P=101.6kPa. Energy-related industrial standard */ EGIA = 'EGIA', - /** T=15.56; P=101.35; U.S. DOT (SCF) */ + /** T=15.56°C; P=101.35kPa. U.S. Department of Transportation standard */ SCF = 'SCF', - /** T=21.11; P=101.3; AMCA */ + /** T=21.11°C (70°F); P=101.3kPa. Air Movement and Control Association */ AMCA = 'AMCA', - /** T=15; P=101.3; FAA */ + /** T=15°C; P=101.3kPa. Federal Aviation Administration standard */ FAA = 'FAA', - /** T=15; P=101.325; ISO 2533, ISO 13443, ISO 7504 */ + /** T=15°C; P=101.325kPa. Standard reference for natural gas (ISO) */ ISO_13443 = 'ISO_13443', - /** T=0; P=101.325; DIN 1343:1990 */ + /** T=0°C; P=101.325kPa. Industrial standard from DIN 1343 */ DIN_1343 = 'DIN_1343' }; +/** + * Types of statistical or measurement errors associated with data points. + */ export enum UncertaintyType { + /** Expressed in the same units as the measurement itself */ ABSOLUTE = 'absolute', + /** Expressed as a ratio or percentage of the measured value */ RELATIVE = 'relative', + /** Upper and lower bounds are not equidistant from the mean value */ ASYMMETRICAL = 'asymmetrical' }; +/** + * Classification of bibliographic references and data sources based on BibTeX. + */ export enum ReferenceType { + /** Peer-reviewed paper in a scientific journal */ ARTICLE = 'article', + /** Complete published work on a specific subject */ BOOK = 'book', + /** Small, unbound publication or pamphlet */ BOOKLET = 'booklet', + /** Paper presented at a professional meeting or symposium */ CONFERENCE = 'conference', + /** Specific section or chapter within a book */ INBOOK = 'inbook', + /** Article within a collection edited by others */ INCOLLECTION = 'incollection', + /** Full transcript or record of a conference */ INPROCEEDINGS = 'inproceedings', + /** Technical documentation or user guide */ MANUAL = 'manual', + /** Academic work for a Master's degree */ MASTERSTHESIS = 'mastersthesis', + /** General classification for academic dissertations */ THESIS = 'thesis', + /** Fallback for sources that do not fit standard categories */ MISC = 'misc', + /** Academic work for a Doctor of Philosophy degree */ PHDTHESIS = 'phdthesis', + /** Published minutes or records of a scientific meeting */ PROCEEDINGS = 'proceedings', + /** Formal report on research or technical developments */ TECHREPORT = 'techreport', + /** Document that has not yet been formally published */ UNPUBLISHED = 'unpublished' }; +/** + * Standard digital image encodings supported for visual assets. + */ export enum ImageFormat { + /** Compressed photographic format with lossy encoding */ JPG = 'jpg', + /** Lossless raster format with transparency support */ PNG = 'png', + /** Vector format based on XML for resolution-independent graphics */ SVG = 'svg', + /** Modern high-performance container for lossy and lossless images */ WEBP = 'webp' }; +/** + * Chemical and spatial file formats for 3D molecular structures. + */ export enum D3Format { + /** Protein Data Bank format for three-dimensional structures */ PDB = 'pdb', + /** MDL Molfile format for chemical bonding and structure */ MOL = 'mol', + /** Structure-Data File for handling chemical data sets */ SDF = 'sdf', + /** Simple Cartesian coordinates for atomic positions */ XYZ = 'xyz', + /** Crystallographic Information File for crystal structures */ CIF = 'cif' }; + +/** + * Two-letter ISO 639-1 language identifiers for scientific nomenclature. + */ +export enum LangCode { + ARABIC = 'ar', BENGALI = 'bn', BULGARIAN = 'bg', CHINESE = 'zh', CROATIAN = 'hr', CZECH = 'cs', + DANISH = 'da', DUTCH = 'nl', ENGLISH = 'en', ESTONIAN = 'et', FINNISH = 'fi', FRENCH = 'fr', + GERMAN = 'de', GREEK = 'el', HEBREW = 'he', HINDI = 'hi', HUNGARIAN = 'hu', INDONESIAN = 'id', + IRISH = 'ga', ITALIAN = 'it', JAPANESE = 'ja', KOREAN = 'ko', LATIN = 'la', LATVIAN = 'lv', + LITHUANIAN = 'lt', MALAY = 'ms', NORWEGIAN = 'no', PERSIAN = 'fa', POLISH = 'pl', PORTUGUESE = 'pt', + ROMANIAN = 'ro', RUSSIAN = 'ru', SLOVAK = 'sk', SLOVENIAN = 'sl', SPANISH = 'es', SWEDISH = 'sv', + THAI = 'th', TURKISH = 'tr', UKRAINIAN = 'uk', VIETNAMESE = 'vi' +}; From d3dd7effff6e0f83bb6d0fac544d5011e5d4bb3c Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:03:21 +0200 Subject: [PATCH 20/53] add comments to safety enums --- enum/safety.ts | 142 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/enum/safety.ts b/enum/safety.ts index 4d2d54ff..97daa7c3 100644 --- a/enum/safety.ts +++ b/enum/safety.ts @@ -1,135 +1,277 @@ +/** + * @file safety.ts + * @description Defines enums for chemical safety, hazard classification, and toxicity. + * This module includes NFPA, GHS, WHMIS, ADR, and DOT international safety standards. + */ + +/** + * Standard signal words used on hazard labels to indicate relative severity. + */ export enum SignalWord { + /** Serious health or environmental risk */ DANGER = 'danger', + /** Moderate health or environmental risk */ WARNING = 'warning', + /** Lower level of potential injury or hazard */ CAUTION = 'caution' }; +/** + * National Fire Protection Association (NFPA) 704 numerical ratings for hazard severity. + */ export enum NFPACode { + /** No significant hazard */ NONE = 0, + /** Slight hazard; caution required */ SLIGHT = 1, + /** Moderate hazard; potential for injury */ MODERATE = 2, + /** Serious hazard; specialized equipment needed */ SERIOUS = 3, + /** Severe hazard; life-threatening */ SEVERE = 4 }; +/** + * Special notices for specific chemical hazards defined by NFPA 704. + */ export enum NFPANotice { + /** Substance with oxidizing properties */ OXIDIZER = 'OX', + /** Reacts violently or explosively with water; do not extinguish with water */ WATER_REACTIVE = 'W', + /** Gases that displace air and can cause suffocation */ SIMPLE_ASPHYXIANT = 'SA', + /** Causes destruction of human tissue or corrosion of metals */ CORROSIVE = 'COR', + /** Specifically acidic material */ ACID = 'ACID', + /** Specifically alkaline (basic) material */ ALKALINE = 'ALK', + /** Contains pathogenic biological agents */ BIOHAZARDOUS = 'BIO', + /** Highly toxic or lethal substance */ POISONOUS = 'POI', + /** Emits ionizing radiation */ RADIOACTIVE = 'RAD', + /** Specifically cold-stored liquids or materials */ CRYOGENIC = 'CRY', + /** Oxidizing gas specifically at standard conditions */ OXYGEN_GAS = 'G OX' }; +/** + * Globally Harmonized System (GHS) visual symbols for hazard communication. + */ export enum GHSPictogram { + /** Unstable explosives or items with mass explosion hazard */ EXPLOSIVE = 'explosive', + /** Flammable gases, aerosols, liquids, or solids */ FLAMMABLE = 'flammable', + /** Oxidizing gases, liquids, or solids */ OXIDIZING = 'oxidizing', + /** Gases under pressure in a cylinder */ COMPRESSED_GAS = 'compressedGas', + /** Skin corrosion, serious eye damage, or metal corrosion */ CORROSIVE = 'corrosive', + /** Acute toxicity (fatal or toxic if ingested or inhaled) */ TOXIC = 'toxic', + /** Skin and eye irritation, sensitization, or narcotic effects */ HARMFUL = 'harmful', + /** Respiratory sensitizer, mutagen, or carcinogen */ HEALTH_HAZARD = 'healthHazard', + /** Acute or chronic aquatic toxicity */ ENVIRONMENTAL_HAZARD = 'environmentalHazard' }; +/** + * GHS hazard categories based on the nature of the chemical risk. + */ export enum GHSClass { + /** Explosives */ CLASS_01 = '01', + /** Flammable gases and aerosols */ CLASS_02 = '02', + /** Oxidizing gases */ CLASS_03 = '03', + /** Gases under pressure */ CLASS_04 = '04', + /** Flammable liquids */ CLASS_05 = '05', + /** Flammable solids */ CLASS_06 = '06', + /** Self-reactive substances */ CLASS_07 = '07', + /** Pyrophoric liquids and solids */ CLASS_08 = '08', + /** Self-heating substances */ CLASS_09 = '09' }; +/** + * Workplace Hazardous Materials Information System (WHMIS) classification codes. + */ export enum WHMISClass { + /** Class A: Compressed gas */ COMPRESSED_GAS = 'A', + /** Class B: Flammable and combustible material */ FLAMMABLE = 'B', + /** Class C: Oxidizing material */ OXIDIZING = 'C', + /** Class D-1: Poisonous and infectious material (immediate) */ TOXIC_ACUTE = 'D-1', + /** Class D-2: Poisonous and infectious material (other) */ TOXIC_OTHER = 'D-2', + /** Class D-3: Biohazardous infectious material */ BIOHAZARDOUS = 'D-3', + /** Class E: Corrosive material */ CORROSIVE = 'E', + /** Class F: Dangerously reactive material */ DANGEROUSLY_REACTIVE = 'F' }; +/** + * Agreement concerning the International Carriage of Dangerous Goods by Road (ADR). + */ export enum ADRClass { + /** Explosive substances and articles */ CLASS_1 = '1', + /** Substances with high explosion hazard */ DIV_1_1 = '1.1', + /** Projectile hazard but no mass explosion */ DIV_1_2 = '1.2', + /** Fire hazard with minor blast or projection hazard */ DIV_1_3 = '1.3', + /** Minor explosion hazard confined to packaging */ DIV_1_4 = '1.4', + /** Very insensitive substances with mass explosion hazard */ DIV_1_5 = '1.5', + /** Extremely insensitive articles with no mass explosion */ DIV_1_6 = '1.6', + /** Flammable gases */ DIV_2_1 = '2.1', + /** Non-flammable, non-toxic gases */ DIV_2_2 = '2.2', + /** Toxic gases */ DIV_2_3 = '2.3', + /** Flammable liquids */ CLASS_3 = '3', + /** Flammable solids */ DIV_4_1 = '4.1', + /** Substances liable to spontaneous combustion */ DIV_4_2 = '4.2', + /** Substances emitting flammable gases in contact with water */ DIV_4_3 = '4.3', + /** Oxidizing substances */ DIV_5_1 = '5.1', + /** Organic peroxides */ DIV_5_2 = '5.2', + /** Toxic substances */ DIV_6_1 = '6.1', + /** Infectious substances */ DIV_6_2 = '6.2', + /** Radioactive material (White label I) */ CAT_7A = '7A', + /** Radioactive material (Yellow label II) */ CAT_7B = '7B', + /** Radioactive material (Yellow label III) */ CAT_7C = '7C', + /** Fissile material (specifically containing U-235) */ CAT_7E = '7E', + /** Corrosive substances */ CLASS_8 = '8', + /** Miscellaneous dangerous substances and articles */ CLASS_9 = '9', + /** Specifically lithium batteries or related electronics */ CLASS_9A = '9A', + /** Substance transported at elevated temperatures */ HOT = 'HOT', + /** Marine pollutants */ POL = 'POL' }; +/** + * U.S. Department of Transportation (DOT) hazardous material classification. + */ export enum DOTClass { + /** Mass explosion hazard */ DIV_1_1 = '1.1', + /** Projection hazard */ DIV_1_2 = '1.2', + /** Predominantly fire hazard */ DIV_1_3 = '1.3', + /** No significant blast hazard */ DIV_1_4 = '1.4', + /** Very insensitive mass explosion hazard */ DIV_1_5 = '1.5', + /** Extremely insensitive articles */ DIV_1_6 = '1.6', + /** Flammable gases */ DIV_2_1 = '2.1', + /** Non-flammable, non-toxic gases */ DIV_2_2 = '2.2', + /** Toxic gases */ DIV_2_3 = '2.3', + /** Flammable liquids */ CLASS_3 = '3', + /** Flammable solids */ DIV_4_1 = '4.1', + /** Substances liable to spontaneous combustion */ DIV_4_2 = '4.2', + /** Dangerous when wet */ DIV_4_3 = '4.3', + /** Oxidizers */ DIV_5_1 = '5.1', + /** Organic peroxides */ DIV_5_2 = '5.2', + /** Toxic substances */ DIV_6_1 = '6.1', + /** Infectious substances */ DIV_6_2 = '6.2', + /** Radioactive material */ CLASS_7 = '7', + /** Corrosive material */ CLASS_8 = '8', + /** Miscellaneous hazard */ CLASS_9 = '9' }; +/** + * Standard metrics for determining the toxicity of a chemical substance. + */ export enum ToxicityType { + /** Half maximal effective concentration causing a response in 50% of people */ EC50 = 'EC50', + /** Lethal concentration resulting in death for 50% of the population */ LC50 = 'LC50', + /** Lethal dose resulting in death for 50% of the population */ LD50 = 'LD50', + /** Toxic dose causing adverse effects in 50% of the population */ TD50 = 'TD50', + /** Lowest Observed Adverse Effect Level */ LOAEL = 'LOAEL', + /** Lowest Observed Effect Level */ LOEL = 'LOEL', + /** No Observed Adverse Effect Level */ NOAEL = 'NOAEL', + /** No Observed Effect Level */ NOEL = 'NOEL' }; +/** + * Route of exposure used during toxicological testing. + */ export enum ToxicityApplication { + /** Through direct contact with the skin */ DERMAL = 'dermal', + /** Through breathing of gas, vapor, or particulates */ INHALATION = 'inhalation', + /** Injection into the body cavity */ INTRAPERITONEAL = 'intraperitoneal', + /** Direct injection into a vein */ INTRAVENOUS = 'intravenous', + /** Ingestion through the mouth */ ORAL = 'oral', + /** Injection under the skin */ SUBCUTANEOUS = 'subcutaneous' }; From 38b81852e3af28fc5bbf9ce48ba4bf2e0d70980d Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:09:09 +0200 Subject: [PATCH 21/53] Update physics.ts --- enum/physics.ts | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/enum/physics.ts b/enum/physics.ts index ac5ce1e9..b04033ff 100644 --- a/enum/physics.ts +++ b/enum/physics.ts @@ -1,45 +1,114 @@ +/** + * @file physics.ts + * @description Defines enums for physical states, properties, and phenomena. + * This module covers phases of matter, magnetic ordering, and optical properties + * like lustre and diaphaneity. + */ + +/** + * Fundamental states of matter based on particle arrangement and energy. + */ +export enum Phase { + /** Rigid state where molecules/atoms are closely packed in a fixed lattice */ + SOLID = 'solid', + /** Fluid state with fixed volume but variable shape, allowing molecular flow */ + LIQUID = 'liquid', + /** Compressible fluid phase with neither definite shape nor volume */ + GASEOUS = 'gaseous', + /** Ionized state of matter where atoms are stripped of their electrons */ + PLASMA = 'plasma', + /** Current state is undetermined or scientifically undefined */ + UNKNOWN = 'unknown' +}; + +/** + * States of electrical conductivity where resistance vanishes at low temperatures. + */ export enum Superconductivity { + /** Conducts electricity without loss below a critical temperature. */ NORMAL = 'normal', + /** Exhibits unusual Cooper pair coupling or non-standard critical mechanics. */ SPECIAL = 'special', + /** Material does not exhibit superconducting properties under any known condition. */ NONE = 'none' }; +/** + * Classification of materials based on their response to an external magnetic field. + */ export enum MagneticOrdering { + /** Repelled by a magnetic field; atoms have no permanent net magnetic moment. */ DIAMAGNETIC = 'diamagnetic', + /** Weakly attracted by a magnetic field; magnetic moments align only while field is present. */ PARAMAGNETIC = 'paramagnetic', + /** Strong attraction with spontaneous magnetization below a Curie temperature. */ FERROMAGNETIC = 'ferromagnetic', + /** Adjacent magnetic moments point in opposite directions, resulting in no net magnetization. */ ANTIFERROMAGNETIC = 'antiferromagnetic', + /** Opposing magnetic moments are unequal, leading to a net spontaneous magnetization. */ FERRIMAGNETIC = 'ferrimagnetic', + /** Occurs in small ferromagnetic or ferrimagnetic nanoparticles with single-domain behavior. */ SUPERPARAMAGNETIC = 'superparamagnetic' }; +/** + * Qualitative description of the surface reflective properties of a substance. + */ export enum Gloss { + /** High reflectivity and opacity typical of polished metals. */ METALLIC = 'metallic', + /** Brilliant, high-index reflectivity similar to a cut diamond. */ DIAMOND = 'diamond', + /** Surface appears to be coated with a thin layer of oil or fat. */ GREASY = 'greasy', + /** Smooth, vitreous reflection typical of glass. */ GLASSY = 'glassy', + /** Iridescent, multi-layered reflection like the interior of a mollusk shell. */ PEARLY = 'pearly', + /** Parallel, fibrous arrangement reflecting light in thread-like patterns. */ SILKY = 'silky', + /** Dull, plastic-like reflection typical of amber or resin. */ RESINOUS = 'resinous', + /** Soft, matte reflection typical of candle wax or paraffin. */ WAXY = 'waxy', + /** Non-reflective surface indicating high light absorption or scattering. */ DULL = 'dull' }; +/** + * Detailed mineralogical classification of how light interacts with a surface. + */ export enum Lustre { + /** Hardest, most brilliant lustre seen in minerals with high refractive indices. */ ADAMANTINE = 'adamantine', + /** Lacks any noticeable reflection, appearing earthy or granular. */ DULL = 'dull', + /** Feels and looks oily, often seen in minerals with surface weathering. */ GREASY = 'greasy', + /** Opaque, shiny surface characteristic of metals and some sulfides. */ METALLIC = 'metallic', + /** Sheen caused by light interference in thin surface layers (e.g., muscovite). */ PEARLY = 'pearly', + /** Characteristic of resins like amber, often with medium refractive indices. */ RESINOUS = 'resinous', + /** Radiating, fibrous lustre seen in minerals like gypsum or tiger's eye. */ SILKY = 'silky', + /** Intermediate between metallic and vitreous, often seen in oxides with high density. */ SUBMETALLIC = 'submetallic', + /** Standard glass-like lustre, typical of 70% of all minerals. */ VITREOUS = 'vitreous', + /** Soft, translucent sheen reminiscent of beeswax. */ WAXY = 'waxy' }; +/** + * Degrees of light transmission through a material. + */ export enum Diaphaneity { + /** Blocks all visible light transmission, even in thin sections. */ OPAQUE = 'opaque', + /** Allows light to pass through but scatters it, preventing clear vision. */ TRANSLUCENT = 'translucent', + /** Light passes through with minimal scattering, allowing clear images. */ TRANSPARENT = 'transparent' }; From fbf57a7f59f12dedfb941ac374699688209b7c7e Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:12:21 +0200 Subject: [PATCH 22/53] Update chemistry.ts --- enum/chemistry.ts | 118 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/enum/chemistry.ts b/enum/chemistry.ts index 9528598d..f5bac9dd 100644 --- a/enum/chemistry.ts +++ b/enum/chemistry.ts @@ -1,110 +1,228 @@ +/** + * @file chemistry.ts + * @description Defines enums for chemical behavior, classification, and structural properties. + * This module covers acid-base character, chemical bonding, molecular geometry, + * and solubility qualifiers. + */ + +/** + * Qualitative scale for the pH-dependent reactivity of a substance. + */ export enum AcidBaseCharacter { + /** Neither acidic nor basic at standard conditions. */ NEUTRAL = 'neutral', + /** Highly ionized in aqueous solution, exhibiting extreme acidity. */ STRONG_ACIDIC = 'strongAcidic', + /** General classification for substances with a low pH. */ ACIDIC = 'acidic', + /** Exhibits significant but non-extreme acidic behavior. */ MODERATE_ACIDIC = 'moderateAcidic', + /** Partially dissociates in solution, resulting in low concentration of H+ ions. */ WEAK_ACIDIC = 'weakAcidic', + /** Capable of reacting as both an acid and a base. */ AMPHOTERIC = 'amphoteric', + /** Partially dissociates in solution, resulting in low concentration of OH- ions. */ WEAK_BASIC = 'weakBasic', + /** Exhibits significant but non-extreme basic behavior. */ MODERATE_BASIC = 'moderateBasic', + /** General classification for substances with a high pH. */ BASIC = 'basic', + /** Highly ionized in aqueous solution, exhibiting extreme alkalinity. */ STRONG_BASIC = 'strongBasic' }; +/** + * Functional role of a substance in an acid-base reaction. + */ export enum BasicityType { + /** Proton donor or electron pair acceptor. */ ACID = 'acid', + /** Proton acceptor or electron pair donor. */ BASE = 'base' }; +/** + * Pearson's Hard and Soft Acids and Bases (HSAB) classification for chemical stability. + */ export enum HSAB { + /** Small, high-charge, non-polarizable species that prefer similar partners. */ HARD = 'hard', + /** Species with intermediate characteristics between hard and soft. */ EDGE = 'edge', + /** Large, low-charge, highly polarizable species that prefer similar partners. */ SOFT = 'soft' }; +/** + * Geochemical classification of elements according to their preferred host phase. + */ export enum Goldschmidt { + /** Elements that occur in the gaseous phase or in planetary atmospheres. */ ATMOPHILE = 'atmophile', + /** Elements that combine with sulfur to form sulfide minerals. */ CHALCOPHILE = 'chalcophile', + /** Elements that occur in silicate minerals or the Earth's crust. */ LITHOPHILE = 'lithophile', + /** Elements that occur as native metals or alloyed with iron in planetary cores. */ SIDEROPHILE = 'siderophile', + /** Artificially produced elements not naturally occurring in geochemical cycles. */ SYNTHETIC = 'synthetic' }; +/** + * Relative strength of donors/acceptors based on the electronic structure model. + */ export enum LewisModel { + /** High affinity for sharing or accepting electron pairs. */ STRONG = 'strong', + /** Moderate affinity for sharing or accepting electron pairs. */ MODERATE = 'moderate', + /** Low affinity for sharing or accepting electron pairs. */ WEAK = 'weak', + /** Does not exhibit significant Lewis acidic/basic behavior. */ NONE = 'none' }; +/** + * Chemical character of an oxide based on its reaction with water or acids/bases. + */ export enum OxideCharacter { + /** Reacts with water to form an acid or with a base to form a salt. */ ACIDIC = 'acidic', + /** Reacts with both acids and bases. */ AMPHOTERIC = 'amphoteric', + /** Reacts with water to form a base or with an acid to form a salt. */ BASIC = 'basic' }; +/** + * Degrees of solubility for a solute in a solvent at a specific temperature. + */ export enum SolubilityQualifier { + /** High capacity to dissolve (usually > 1000 mg/mL). */ VERY_SOLUBLE = 'verySoluble', + /** Dissolves easily in standard solvent volumes. */ FREELY_SOLUBLE = 'freelySoluble', + /** Requires reasonable amount of solvent to dissolve. */ SOLUBLE = 'soluble', + /** Limited dissolution in large volumes (typically 10-30 mg/mL). */ SPARINGLY_SOLUBLE = 'sparinglySoluble', + /** Very low solubility (typically 1-10 mg/mL). */ SLIGHTLY_SOLUBLE = 'slightlySoluble', + /** Extremely low dissolution (typically 0.1-1 mg/mL). */ VERY_SLIGHTLY_SOLUBLE = 'verySlightlySoluble', + /** Effectively does not dissolve (< 0.1 mg/mL). */ PRACTICALLY_INSOLUBLE = 'practicallyInsoluble' }; +/** + * Three-dimensional arrangement of atoms within a molecule as predicted by VSEPR theory. + */ export enum MolecularShape { + /** Atoms in a straight line at 180° angles. */ LINEAR = 'linear', + /** Three atoms at the corners of an equilateral triangle around a center. */ TRIGONAL_PLANAR = 'trigonalPlanar', + /** Non-linear arrangement typical of molecules with lone pairs. */ BENT = 'bent', + /** Central atom with four substituents at the corners of a tetrahedron. */ TETRAHEDRAL = 'tetrahedral', + /** Pyramid with a triangular base and a central atom at the apex. */ TRIGONAL_PYRAMIDAL = 'trigonalPyramidal', + /** Two pyramids joined at their triangular base. */ TRIGONAL_BIPYRAMIDAL = 'trigonalBipyramidal', + /** Derived from trigonal bipyramidal with one lone pair. */ SEESAW = 'seesaw', + /** Three substituents forming a 'T' shape around a central atom. */ T_SHAPED = 'tShaped', + /** Eight-faced structure with six substituents at the vertices. */ OCTAHEDRAL = 'octahedral', + /** Pyramid with a square base. */ SQUARE_PYRAMIDAL = 'squarePyramidal', + /** Four substituents at the corners of a square in a single plane. */ SQUARE_PLANAR = 'squarePlanar', + /** Two pyramids joined at their pentagonal base. */ PENTAGONAL_BIPYRAMIDAL = 'pentagonalBipyramidal', + /** Pyramid with a pentagonal base. */ PENTAGONAL_PYRAMIDAL = 'pentagonalPyramidal', + /** Five substituents at the corners of a pentagon in a single plane. */ PENTAGONAL_PLANAR = 'pentagonalPlanar', + /** Geometry in which eight atoms lie at the vertices of a square antiprism. */ SQUARE_ANTIPRISMATIC = 'squareAntiprismatic', + /** Nine-coordinate geometry in which nine atoms surround a central atom. */ TRICAPPED_TRIGONAL_PRISMATIC = 'tricappedTrigonalPrismatic' }; +/** + * Primary types of chemical attraction and bonding between atoms or molecules. + */ export enum BondType { + /** Electrostatic attraction between oppositely charged ions. */ IONIC = 'ionic', + /** Sharing of electron pairs between atoms. */ COVALENT = 'covalent', + /** Delocalized sharing of valence electrons across a lattice of metal cations. */ METALLIC = 'metallic', + /** Weak attractive forces between molecules due to dipole fluctuations. */ VDW = 'vdw', + /** Specific dipole-dipole attraction between hydrogen and highly electronegative atoms. */ HYDROGEN = 'hydrogen' }; +/** + * Mixing of atomic orbitals to form new hybrid orbitals for chemical bonding. + */ export enum Hybridization { + /** Transition metal hybridization involving s and two d orbitals. */ SD2 = 'sd2', + /** Transition metal hybridization involving s and three d orbitals. */ SD3 = 'sd3', + /** Transition metal hybridization involving s and four d orbitals. */ SD4 = 'sd4', + /** Transition metal hybridization involving s and five d orbitals. */ SD5 = 'sd5', + /** Linear combination of s and p orbitals. */ SP = 'sp', + /** Planar combination of s and two p orbitals. */ SP2 = 'sp2', + /** Tetrahedral combination of s and three p orbitals. */ SP3 = 'sp3', + /** Planar combination involving s, two p, and one d orbital. */ SP2D = 'sp2d', + /** Combination involving s, three p, and one d orbital. */ SP3D = 'sp3d', + /** Octahedral combination involving s, three p, and two d orbitals. */ SP3D2 = 'sp3d2', + /** Combination involving s, three p, and three d orbitals. */ SP3D3 = 'sp3d3', + /** Combination involving s, three p, and four d orbitals. */ SP3D4 = 'sp3d4', + /** Combination involving s, three p, and five d orbitals. */ SP3D5 = 'sp3d5' }; +/** + * Specific roles of chemical constituents within a substance or mixture. + */ export enum ComponentRole { + /** Positively charged ion. */ CATION = 'cation', + /** Negatively charged ion. */ ANION = 'anion', + /** Uncharged molecular unit. */ NEUTRAL = 'neutral', + /** Atom or molecule with an unpaired valence electron. */ RADICAL = 'radical', + /** Coordination entity consisting of a central atom and surrounding ligands. */ COMPLEX = 'complex', + /** Minor constituent that is not part of the intended substance. */ IMPURITY = 'impurity', + /** Deliberately added trace element used to modify material properties. */ DOPANT = 'dopant', + /** Distinct material trapped inside the crystal structure of another mineral. */ INCLUSION = 'inclusion', + /** The primary medium in which other components are embedded or dissolved. */ MATRIX = 'matrix', + /** Liquid phase in which a solute is dissolved to form a solution. */ SOLVENT = 'solvent' }; From 31665f38cf2773ca5c0b7daabf75f230fea14d44 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:14:34 +0200 Subject: [PATCH 23/53] Update crystallography.ts --- enum/crystallography.ts | 121 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/enum/crystallography.ts b/enum/crystallography.ts index 08a797c8..8ef529e7 100644 --- a/enum/crystallography.ts +++ b/enum/crystallography.ts @@ -1,114 +1,235 @@ +/** + * @file crystallography.ts + * @description Defines enums for crystal systems, symmetries, habits, and twinning mechanisms. + * This module covers the structural and geometric properties of solid-state matter. + */ + +/** + * High-level grouping of crystal systems based on their axial and angular constraints. + */ export enum CrystalFamily { + /** Three unequal axes with all angles non-perpendicular. */ TRICLINIC = 'triclinic', + /** Three unequal axes, two of which are perpendicular. */ MONOCLINIC = 'monoclinic', + /** Three unequal axes that are all mutually perpendicular. */ ORTHORHOMBIC = 'orthorhombic', + /** Single three-fold rotation axis. */ TRIGONAL = 'trigonal', + /** Single six-fold rotation axis. */ HEXAGONAL = 'hexagonal', + /** Single four-fold rotation axis. */ TETRAGONAL = 'tetragonal', + /** Three equal axes that are all mutually perpendicular. */ CUBIC = 'cubic' }; +/** + * Comprehensive classification of unit cell geometries and specific packing symmetries. + */ export enum CrystalSystem { + /** Sixfold symmetry with axes at 120° and 90°. */ HEXAGONAL = 'hexagonal', + /** Most dense packing of equal spheres with ABAB stacking. */ HEXAGONAL_CLOSE_PACKED = 'hexagonalClosePacked', + /** Atoms at the eight corners and one in the center of a cube. */ BODY_CENTERED_CUBIC = 'bodyCenteredCubic', + /** Three equal axes at identical non-right angles. */ RHOMBOHEDRAL = 'rhombohedral', + /** Primitive cubic lattice with atoms only at the corners. */ SIMPLE_CUBIC = 'simpleCubic', + /** Atoms at the corners and in the center of each face. */ FACE_CENTERED_CUBIC = 'faceCenteredCubic', + /** Interlocking tetrahedral structure typical of carbon. */ DIAMOND_CUBIC = 'diamondCubic', + /** Three unequal orthogonal axes. */ ORTHORHOMBIC = 'orthorhombic', + /** Two equal orthogonal axes and one different axis. */ TETRAGONAL = 'tetragonal', + /** Hexagonal packing with ABAC stacking sequence. */ DOUBLE_HEXAGONAL_CLOSE_PACKED = 'doubleHexagonalClosePacked', + /** Single non-orthogonal axis angle. */ MONOCLINIC = 'monoclinic', + /** No orthogonal axes or equal axis lengths. */ TRICLINIC = 'triclinic' }; +/** + * Qualitative description of the external shape and morphology of a crystal especimen. + */ export enum CrystalHabit { + /** Needle-like crystals. */ ACICULAR = 'acicular', + /** Branching, tree-like formation. */ ARBORESCENT = 'arborescent', + /** Extremely thin, hair-like fibers. */ CAPILLARY = 'capillary', + /** Smooth, spherical or rounded surfaces. */ COLLOFORM = 'colloform', + /** Layered growth around a central point. */ CONCENTRIC = 'concentric', + /** Random, plant-like branching branching (e.g., Manganese oxides). */ DENDRITIC = 'dendritic', + /** Crust of tiny crystals on a surface. */ DRUSE = 'druse', + /** Parallel thread-like units. */ FIBROUS = 'fibrous', + /** Leaves or flakes that can be separated. */ FOLIATED = 'foliated', + /** Mass of aggregate, non-interlocking grains. */ GRANULAR = 'granular', + /** Face-centered growth where edges grow faster than faces. */ HOPPER = 'hopper', + /** Aggregate of small, egg-like concentric spheres. */ OOLITHIC = 'oolithic', + /** Similar to oolithic but with larger, pea-sized grains. */ PISOLITIC = 'pisolitic', + /** Thin, plate-like crystals. */ PLATY = 'platy', + /** Feather-like radiating structures. */ PLUMOSE = 'plumose', + /** Diverging outward from a single center. */ RADIAL = 'radial', + /** Interlaced into a net-like structure. */ RETICULATED = 'reticulated', + /** Clustered like the petals of a flower. */ ROSETTE = 'rosette', + /** Formed like icicles on a cave roof. */ STALACTITIC = 'stalactitic', + /** Star-shaped radiating arrangement. */ STELLATE = 'stellate', + /** Result of fluid filling gas bubbles in volcanic rock. */ AMYGDALOIDAL = 'amygdaloidal', + /** Development of different faces at opposite ends of the crystal. */ HEMIMORPHIC = 'hemimorphic', + /** Lacks any recognizable individual crystal faces. */ MASSIVE = 'massive', + /** A small crystal perched on the tip of a larger, stalk-like crystal. */ SCEPTERED = 'sceptered', + /** Six equal square faces. */ CUBIC = 'cubic', + /** Twelve rhombic faces. */ DODECAHEDRAL = 'dodecahedral', + /** Non-superimposable mirror image forms. */ ENANTIOMORPHIC = 'enantiomorphic', + /** Six-sided prisms or pyramids. */ HEXAGONAL = 'hexagonal', + /** Twenty-four faced solid. */ ICOSITETRAHEDRAL = 'icositetrahedral', + /** Eight equilateral triangular faces. */ OCTAHEDRAL = 'octahedral', + /** Elongated faces parallel to the c-axis. */ PRISMATIC = 'prismatic', + /** Six faces that are rhombi. */ RHOMBOHEDRAL = 'rhombohedral', + /** Twelve faces that are scalene triangles. */ SCALENOEHEDRAL = 'scalenohedral', + /** Four triangular faces. */ TETRAHEDRAL = 'tetrahedral', + /** Grape-like clusters of rounded masses. */ BOTRYOIDAL = 'botryoidal', + /** Spherical rounded masses, smaller than botryoidal. */ GLOBULAR = 'globular', + /** Large breast-like rounded masses. */ MAMMILLARY = 'mammillary', + /** Reddish-brown, kidney-shaped clusters. */ RENIFORM = 'reniform' }; +/** + * Orientation of the standard cleavage planes in a crystal structure. + */ export enum CleavageType { + /** Parallel to the base of the crystal (e.g., Micas). */ BASAL = 'basal', + /** Parallel to vertical prism faces. */ PRISMATIC = 'prismatic', + /** Three planes mutually perpendicular (e.g., Halite). */ CUBIC = 'cubic', + /** Three planes at non-right angles. */ RHOMBOHEDRAL = 'rhombohedral', + /** Four planes at angles to the axes. */ OCTAHEDRAL = 'octahedral', + /** Six planes parallel to the faces of a dodecahedron. */ DODECAHEDRAL = 'dodecahedral' }; +/** + * Symmetrical intergrowth of two or more crystals of the same substance. + */ export enum TwinningType { + /** Two crystals joined along a single plane. */ CONTACT = 'contact', + /** Two crystals intertwined through each other (e.g., Staurolite). */ PENETRATION = 'penetration', + /** Repeated contact twins resulting in parallel lamellae. */ POLYSYNTHETIC = 'polysynthetic', + /** Twins arranged in a ring-like circular pattern. */ CYCLIC = 'cyclic' }; +/** + * Geological or thermal process that induced the twinning. + */ export enum TwinningMode { + /** Occurs während crystal formation from a melt or solution. */ GROWTH = 'growth', + /** Occurs when a crystal is cooled and changes symmetry. */ TRANSFORMATION = 'transformation', + /** Occurs due to mechanical stress or pressure (slip twinning). */ DEFORMATION = 'deformation' }; +/** + * Quality and ease of achieving a smooth cleavage surface. + */ export enum CleavageQuality { + /** Excellent, flat surfaces with no irregularities. */ PERFECT = 'perfect', + /** Predictable surfaces with some stepping. */ GOOD = 'good', + /** Rough surface that still follows a plane. */ IMPERFECT = 'imperfect', + /** Barely recognizable plane. */ INDISTINCT = 'indistinct', + /** No predictable cleavage. */ NONE = 'none' }; +/** + * Non-planar breakage pattern of a mineral when stressed. + */ export enum FractureType { + /** Smooth, shell-like curved surface (e.g., Obsidian). */ CONCHOIDAL = 'conchoidal', + /** Rough or irregular breakage. */ UNEVEN = 'uneven', + /** Relatively flat but not a cleavage plane. */ SMOOTH = 'smooth', + /** Splintery or thread-like breakage. */ FIBROUS = 'fibrous', + /** Jagged, sharp-edged surface (typical of native metals). */ HACKLY = 'hackly', + /** Sharp, pointed splinters. */ SPLINTERY = 'splintery', + /** Crumbles easily like soil or clay. */ EARTHY = 'earthy' }; +/** + * Resistance of a material to breaking, bending, or crushing. + */ export enum Tenacity { + /** Crumbles or powders under stress. */ BRITTLE = 'brittle', + /** Can be hammered into thin sheets. */ MALLEABLE = 'malleable', + /** Can be drawn out into thin wires. */ DUCTILE = 'ductile', + /** Can be cut smoothly with a knife to form shavings. */ SECTILE = 'sectile', + /** Bends but returns to its original shape. */ ELASTIC = 'elastic', + /** Bends and stays in its new shape. */ PLASTIC = 'plastic' }; From 4007b65d9ee6d70eb87459dd079d6d998e642e9e Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:18:47 +0200 Subject: [PATCH 24/53] rework nuclear enums --- enum/nuclear.ts | 170 ++++++++++++++++++++++++++++++++++++++++++++++++ enum/nuclide.ts | 81 ----------------------- 2 files changed, 170 insertions(+), 81 deletions(-) create mode 100644 enum/nuclear.ts delete mode 100644 enum/nuclide.ts diff --git a/enum/nuclear.ts b/enum/nuclear.ts new file mode 100644 index 00000000..5733ba9e --- /dev/null +++ b/enum/nuclear.ts @@ -0,0 +1,170 @@ +/** + * @file nuclear.ts + * @description Defines enums for nuclear properties, decay modes, and stability. + * This module covers atomic nuclide states, radiation types, and radioactive decay paths. + */ + +/** + * Energy state of an atomic nucleus relative to its lowest potential. + */ +export enum NuclideState { + /** Lowest energy state of the nucleus. */ + GROUND = 'ground', + /** Long-lived excited state with a measurable half-life. */ + METASTABLE = 'metastable', + /** Discrete energetic nuclear state above the ground state (level 1). */ + M1 = 'm1', + /** Discrete energetic nuclear state above the ground state (level 2). */ + M2 = 'm2', + /** Discrete energetic nuclear state above the ground state (level 3). */ + M3 = 'm3', + /** Discrete energetic nuclear state above the ground state (level 4). */ + M4 = 'm4' +}; + +/** + * Classification of nuclear stability and environmental persistence. + */ +export enum NuclideStability { + /** Does not undergo radioactive decay within the age of the universe. */ + STABLE = 'stable', + /** Susceptible to spontaneous radioactive decay. */ + UNSTABLE = 'unstable', + /** Radioactive isotope that existed since the formation of the Earth. */ + PRIMORDIAL = 'primordial', + /** Produced in reactors or particle accelerators, not found naturally. */ + SYNTHETIC = 'synthetic', + /** Specifically created through human nuclear processes or synthesis. */ + ARTIFICIAL = 'artificial' +}; + +/** + * Intrinsic angular momentum (spin) and spatial symmetry (parity) of a nucleus. + */ +export enum SpinParity { + /** Even symmetry under spatial inversion. */ + POSITIVE = 'positive', + /** Odd symmetry under spatial inversion. */ + NEGATIVE = 'negative', + /** Nuclear symmetry properties are currently undetermined. */ + UNKNOWN = 'unknown' +}; + +/** + * Spontaneous transformation of an unstable atomic nucleus into a different entity. + * Notation follows common nuclear physics shorthand for emission processes. + */ +export enum DecayMode { + /** Simultaneous conversion of two protons to neutrons with positron emission. */ + DOUBLE_BETA_PLUS = '2B+', + /** Simultaneous conversion of two neutrons to protons with electron emission. */ + DOUBLE_BETA_MINUS = '2B-', + /** Capture of two inner-shell electrons by the nucleus. */ + DOUBLE_ELECTRON_CAPTURE = '2EC', + /** Spontaneous emission of two neutrons from an unstable nucleus. */ + DOUBLE_NEUTRON_EMISSION = '2N', + /** Spontaneous emission of two protons from an unstable nucleus. */ + DOUBLE_PROTON_EMISSION = '2P', + /** Helium-4 nucleus emission, reducing atomic number by 2 and mass by 4. */ + ALPHA = 'A', + /** Positron emission through the conversion of a proton to a neutron. */ + BETA_PLUS = 'B+', + /** Positron emission followed by the emission of two protons. */ + BETA_PLUS_TWO_PROTON = 'B+2P', + /** Beta-plus decay resulting in an excited state that emits an alpha particle. */ + BETA_PLUS_ALPHA = 'B+A', + /** Beta-plus decay followed by the emission of one proton. */ + BETA_PLUS_PROTON = 'B+P', + /** Electron emission through the conversion of a neutron to a proton. */ + BETA_MINUS = 'B-', + /** Beta-minus decay followed by the emission of two neutrons. */ + BETA_MINUS_TWO_NEUTRON = 'B-2N', + /** Beta-minus decay followed by the emission of three neutrons. */ + BETA_MINUS_THREE_NEUTRON = 'B-3N', + /** Beta-minus decay followed by the emission of four neutrons. */ + BETA_MINUS_FOUR_NEUTRON = 'B-4N', + /** Beta-minus decay followed by the emission of five neutrons. */ + BETA_MINUS_FIVE_NEUTRON = 'B-5N', + /** Beta-minus decay followed by the emission of six neutrons. */ + BETA_MINUS_SIX_NEUTRON = 'B-6N', + /** Beta-minus decay followed by the emission of seven neutrons. */ + BETA_MINUS_SEVEN_NEUTRON = 'B-7N', + /** Beta-minus decay resulting in an excited state that emits an alpha particle. */ + BETA_MINUS_ALPHA = 'B-A', + /** Beta-minus decay followed by the emission of one neutron. */ + BETA_MINUS_NEUTRON = 'B-N', + /** Beta-minus decay followed by the emission of one proton. */ + BETA_MINUS_PROTON = 'B-P', + /** Beta-minus decay followed by spontaneous fission of the daughter nucleus. */ + BETA_MINUS_SPONTANEOUS_FISSION = 'B-SF', + /** Capture of an orbital electron by a proton in the nucleus. */ + ELECTRON_CAPTURE = 'EC', + /** Competition between electron capture and positron emission. */ + ELECTRON_CAPTURE_BETA_PLUS = 'EC+B+', + /** Electron capture followed by the emission of two protons. */ + ELECTRON_CAPTURE_TWO_PROTON = 'EC2P', + /** Electron capture results in an excited state that emits an alpha particle. */ + ELECTRON_CAPTURE_ALPHA = 'ECA', + /** Electron capture followed by the emission of one proton. */ + ELECTRON_CAPTURE_PROTON = 'ECP', + /** Electron capture followed by spontaneous fission. */ + ELECTRON_CAPTURE_SPONTANEOUS_FISSION = 'ECSF', + /** Transition from an excited nuclear isomorphism to the ground state. */ + ISOMERIC_TRANSITION = 'IT', + /** Release of a single neutron to achieve greater stability. */ + NEUTRON_EMISSION = 'N', + /** Release of a single proton to achieve greater stability. */ + PROTON_EMISSION = 'P', + /** Splitting of a heavy nucleus into two smaller nuclei without external interaction. */ + SPONTANEOUS_FISSION = 'SF', + /** Spontaneous fission accompanied by positron emission or electron capture. */ + SPONTANEOUS_FISSION_EC_BPLUS = 'SF+EC+B+' +}; + +/** + * Types of ionizing and non-ionizing particles or waves emitted by radionuclides. + */ +export enum RadiationType { + /** Flux of helium nuclei. */ + ALPHA = 'alpha', + /** Flux of high-speed electrons or positrons. */ + BETA = 'beta', + /** High-energy electromagnetic waves emitted from the nucleus. */ + GAMMA = 'gamma', + /** High-energy electromagnetic waves originating from electron transitions. */ + XRAY = 'xray', + /** Interaction of nucleus with an orbital electron, causing its emission. */ + CONVERSION_ELECTRON = 'conversionElectron', + /** Antimatter particle with the same mass as an electron but positive charge. */ + POSITRON = 'positron', + /** Uncharged subatomic particles with high penetrating power. */ + NEUTRON = 'neutron', + /** Positively charged subatomic particles consisting of one hydrogen nucleus. */ + PROTON = 'proton', + /** Rare emission of particles larger than alpha particles (e.g., carbon-14). */ + CLUSTER = 'cluster' +}; + +/** + * Qualitative attributes describing the nuclear or environmental behavior of a nuclide. + */ +export enum NuclideProperty { + /** Non-decaying nuclear configuration. */ + STABLE = 'stable', + /** Subject to nuclear transmutation over time. */ + UNSTABLE = 'unstable', + /** Originating from before the formation of the Earth. */ + PRIMORDIAL = 'primordial', + /** Result of human nuclear synthesis in reactors. */ + SYNTHETIC = 'synthetic', + /** Produced through artificial bombardment or fission. */ + ARTIFICIAL = 'artificial', + /** Occurring as a single stable isotope for a given element. */ + MONONUCLEIDE = 'mononuclide', + /** Spontaneously emitting radiation. */ + RADIOACTIVE = 'radioactive', + /** Occurring naturally on Earth though natural cycles. */ + NATUREAL = 'natural', + /** Existing in a long-lived nuclear excited state. */ + METASTABLE = 'metastable' +}; diff --git a/enum/nuclide.ts b/enum/nuclide.ts deleted file mode 100644 index c28c5e58..00000000 --- a/enum/nuclide.ts +++ /dev/null @@ -1,81 +0,0 @@ -export enum NuclideState { - GROUND = 'ground', - METASTABLE = 'metastable', - M1 = 'm1', - M2 = 'm2', - M3 = 'm3', - M4 = 'm4' -}; - -export enum NuclideStability { - STABLE = 'stable', - UNSTABLE = 'unstable', - PRIMORDIAL = 'primordial', - SYNTHETIC = 'synthetic', - ARTIFICIAL = 'artificial' -}; - -export enum SpinParity { - POSITIVE = 'positive', - NEGATIVE = 'negative', - UNKNOWN = 'unknown' -}; - -export enum DecayMode { - DOUBLE_BETA_PLUS = '2B+', - DOUBLE_BETA_MINUS = '2B-', - DOUBLE_ELECTRON_CAPTURE = '2EC', - DOUBLE_NEUTRON_EMISSION = '2N', - DOUBLE_PROTON_EMISSION = '2P', - ALPHA = 'A', - BETA_PLUS = 'B+', - BETA_PLUS_TWO_PROTON = 'B+2P', - BETA_PLUS_ALPHA = 'B+A', - BETA_PLUS_PROTON = 'B+P', - BETA_MINUS = 'B-', - BETA_MINUS_TWO_NEUTRON = 'B-2N', - BETA_MINUS_THREE_NEUTRON = 'B-3N', - BETA_MINUS_FOUR_NEUTRON = 'B-4N', - BETA_MINUS_FIVE_NEUTRON = 'B-5N', - BETA_MINUS_SIX_NEUTRON = 'B-6N', - BETA_MINUS_SEVEN_NEUTRON = 'B-7N', - BETA_MINUS_ALPHA = 'B-A', - BETA_MINUS_NEUTRON = 'B-N', - BETA_MINUS_PROTON = 'B-P', - BETA_MINUS_SPONTANEOUS_FISSION = 'B-SF', - ELECTRON_CAPTURE = 'EC', - ELECTRON_CAPTURE_BETA_PLUS = 'EC+B+', - ELECTRON_CAPTURE_TWO_PROTON = 'EC2P', - ELECTRON_CAPTURE_ALPHA = 'ECA', - ELECTRON_CAPTURE_PROTON = 'ECP', - ELECTRON_CAPTURE_SPONTANEOUS_FISSION = 'ECSF', - ISOMERIC_TRANSITION = 'IT', - NEUTRON_EMISSION = 'N', - PROTON_EMISSION = 'P', - SPONTANEOUS_FISSION = 'SF', - SPONTANEOUS_FISSION_EC_BPLUS = 'SF+EC+B+' -}; - -export enum RadiationType { - ALPHA = 'alpha', - BETA = 'beta', - GAMMA = 'gamma', - XRAY = 'xray', - CONVERSION_ELECTRON = 'conversionElectron', - POSITRON = 'positron', - NEUTRON = 'neutron', - PROTON = 'proton', - CLUSTER = 'cluster' -}; - -export enum NuclideProperty { - STABLE = 'stable', - UNSTABLE = 'unstable', - PRIMORDIAL = 'primordial', - SYNTHETIC = 'synthetic', - ARTIFICIAL = 'artificial', - MONONUCLEIDE = 'mononuclide', - RADIOACTIVE = 'radioactive', - NATUREAL = 'natural', - METASTABLE = 'metastable' -}; From 4b0272899a54258e963e350db69c94d42c918288 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:24:40 +0200 Subject: [PATCH 25/53] Update element.ts --- enum/element.ts | 306 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 290 insertions(+), 16 deletions(-) diff --git a/enum/element.ts b/enum/element.ts index 98fbb966..9eff2dc6 100644 --- a/enum/element.ts +++ b/enum/element.ts @@ -1,74 +1,348 @@ +/** + * @file element.ts + * @description Defines enums related to chemical elements and their periodic classification. + * This module covers elemental symbols, periodic table structure, blocks, chemical sets, + * and specific elemental properties. + */ + +/** + * Unique chemical symbols for all known elements in the periodic table. + * These symbols follow IUPAC nomenclature and represent elements from Hydrogen to Oganesson. + */ export enum ElementSymbol { - H = 'h', He = 'he', Li = 'li', Be = 'be', B = 'b', C = 'c', N = 'n', O = 'o', F = 'f', - Ne = 'ne', Na = 'na', Mg = 'mg', Al = 'al', Si = 'si', P = 'p', S = 's', Cl = 'cl', - Ar = 'ar', K = 'k', Ca = 'ca', Sc = 'sc', Ti = 'ti', V = 'v', Cr = 'cr', Mn = 'mn', - Fe = 'fe', Co = 'co', Ni = 'ni', Cu = 'cu', Zn = 'zn', Ga = 'ga', Ge = 'ge', As = 'as', - Se = 'se', Br = 'br', Kr = 'kr', Rb = 'rb', Sr = 'sr', Y = 'y', Zr = 'zr', Nb = 'nb', - Mo = 'mo', Tc = 'tc', Ru = 'ru', Rh = 'rh', Pd = 'pd', Ag = 'ag', Cd = 'cd', In = 'in', - Sn = 'sn', Sb = 'sb', Te = 'te', I = 'i', Xe = 'xe', Cs = 'cs', Ba = 'ba', La = 'la', - Ce = 'ce', Pr = 'pr', Nd = 'nd', Pm = 'pm', Sm = 'sm', Eu = 'eu', Gd = 'gd', Tb = 'tb', - Dy = 'dy', Ho = 'ho', Er = 'er', Tm = 'tm', Yb = 'yb', Lu = 'lu', Hf = 'hf', Ta = 'ta', - W = 'w', Re = 're', Os = 'os', Ir = 'ir', Pt = 'pt', Au = 'au', Hg = 'hg', Tl = 'tl', - Pb = 'pb', Bi = 'bi', Po = 'po', At = 'at', Rn = 'rn', Fr = 'fr', Ra = 'ra', Ac = 'ac', - Th = 'th', U = 'u', Np = 'np', Pu = 'pu', Am = 'am', Cm = 'cm', Bk = 'bk', Cf = 'cf', - Es = 'es', Fm = 'fm', Md = 'md', No = 'no', Lr = 'lr', Rf = 'rf', Db = 'db', Sg = 'sg', - Bh = 'bh', Hs = 'hs', Mt = 'mt', Ds = 'ds', Rg = 'rg', Cn = 'cn', Nh = 'nh', Fl = 'fl', - Mc = 'mc', Lv = 'lv', Ts = 'ts', Og = 'og' + /** Hydrogen */ H = 'h', + /** Helium */ He = 'he', + /** Lithium */ Li = 'li', + /** Beryllium */ Be = 'be', + /** Boron */ B = 'b', + /** Carbon */ C = 'c', + /** Nitrogen */ N = 'n', + /** Oxygen */ O = 'o', + /** Fluorine */ F = 'f', + /** Neon */ Ne = 'ne', + /** Sodium */ Na = 'na', + /** Magnesium */ Mg = 'mg', + /** Aluminium */ Al = 'al', + /** Silicon */ Si = 'si', + /** Phosphorus */ P = 'p', + /** Sulfur */ S = 's', + /** Chlorine */ Cl = 'cl', + /** Argon */ Ar = 'ar', + /** Potassium */ K = 'k', + /** Calcium */ Ca = 'ca', + /** Scandium */ Sc = 'sc', + /** Titanium */ Ti = 'ti', + /** Vanadium */ V = 'v', + /** Chromium */ Cr = 'cr', + /** Manganese */ Mn = 'mn', + /** Iron */ Fe = 'fe', + /** Cobalt */ Co = 'co', + /** Nickel */ Ni = 'ni', + /** Copper */ Cu = 'cu', + /** Zinc */ Zn = 'zn', + /** Gallium */ Ga = 'ga', + /** Germanium */ Ge = 'ge', + /** Arsenic */ As = 'as', + /** Selenium */ Se = 'se', + /** Bromine */ Br = 'br', + /** Krypton */ Kr = 'kr', + /** Rubidium */ Rb = 'rb', + /** Strontium */ Sr = 'sr', + /** Yttrium */ Y = 'y', + /** Zirconium */ Zr = 'zr', + /** Niobium */ Nb = 'nb', + /** Molybdenum */ Mo = 'mo', + /** Technetium */ Tc = 'tc', + /** Ruthenium */ Ru = 'ru', + /** Rhodium */ Rh = 'rh', + /** Palladium */ Pd = 'pd', + /** Silver */ Ag = 'ag', + /** Cadmium */ Cd = 'cd', + /** Indium */ In = 'in', + /** Tin */ Sn = 'sn', + /** Antimony */ Sb = 'sb', + /** Tellurium */ Te = 'te', + /** Iodine */ I = 'i', + /** Xenon */ Xe = 'xe', + /** Caesium */ Cs = 'cs', + /** Barium */ Ba = 'ba', + /** Lanthanum */ La = 'la', + /** Cerium */ Ce = 'ce', + /** Praseodymium */ Pr = 'pr', + /** Neodymium */ Nd = 'nd', + /** Promethium */ Pm = 'pm', + /** Samarium */ Sm = 'sm', + /** Europium */ Eu = 'eu', + /** Gadolinium */ Gd = 'gd', + /** Terbium */ Tb = 'tb', + /** Dysprosium */ Dy = 'dy', + /** Holmium */ Ho = 'ho', + /** Erbium */ Er = 'er', + /** Thulium */ Tm = 'tm', + /** Ytterbium */ Yb = 'yb', + /** Lutetium */ Lu = 'lu', + /** Hafnium */ Hf = 'hf', + /** Tantalum */ Ta = 'ta', + /** Tungsten */ W = 'w', + /** Rhenium */ Re = 're', + /** Osmium */ Os = 'os', + /** Iridium */ Ir = 'ir', + /** Platinum */ Pt = 'pt', + /** Gold */ Au = 'au', + /** Mercury */ Hg = 'hg', + /** Thallium */ Tl = 'tl', + /** Lead */ Pb = 'pb', + /** Bismuth */ Bi = 'bi', + /** Polonium */ Po = 'po', + /** Astatine */ At = 'at', + /** Radon */ Rn = 'rn', + /** Francium */ Fr = 'fr', + /** Radium */ Ra = 'ra', + /** Actinium */ Ac = 'ac', + /** Thorium */ Th = 'th', + /** Uranium */ U = 'u', + /** Neptunium */ Np = 'np', + /** Plutonium */ Pu = 'pu', + /** Americium */ Am = 'am', + /** Curium */ Cm = 'cm', + /** Berkelium */ Bk = 'bk', + /** Californium */ Cf = 'cf', + /** Einsteinium */ Es = 'es', + /** Fermium */ Fm = 'fm', + /** Mendelevium */ Md = 'md', + /** Nobelium */ No = 'no', + /** Lawrencium */ Lr = 'lr', + /** Rutherfordium */ Rf = 'rf', + /** Dubnium */ Db = 'db', + /** Seaborgium */ Sg = 'sg', + /** Bohrium */ Bh = 'bh', + /** Hassium */ Hs = 'hs', + /** Meitnerium */ Mt = 'mt', + /** Darmstadtium */ Ds = 'ds', + /** Roentgenium */ Rg = 'rg', + /** Copernicium */ Cn = 'cn', + /** Nihonium */ Nh = 'nh', + /** Flerovium */ Fl = 'fl', + /** Moscovium */ Mc = 'mc', + /** Livermorium */ Lv = 'lv', + /** Tennessine */ Ts = 'ts', + /** Oganesson */ Og = 'og' }; -export enum ElementBlock { S = 's', P = 'p', D = 'd', F = 'f' }; +/** + * Periodic table blocks based on the orbital subshell being filled by the valence electrons. + */ +export enum ElementBlock { + /** Sharp orbital block containing groups 1 and 2, plus helium. */ + S = 's', + /** Principal orbital block containing groups 13 to 18 (excluding helium). */ + P = 'p', + /** Diffuse orbital block containing the transition metals (groups 3 to 12). */ + D = 'd', + /** Fundamental orbital block containing lanthanoids and actinoids. */ + F = 'f' +}; +/** + * Classifies elements into groups with similar physical and chemical characteristics. + */ export enum ElementSet { + /** Elements lacking metallic properties, typically highly electronegative. */ NON_METAL = 'nonMetal', + /** Chemically inert, monoatomic gases at standard conditions with full valence shells. */ NOBLE_GAS = 'nobleGas', + /** Highly reactive metals in group 1 that readily lose one electron to form cations. */ ALKALI_METAL = 'alkaliMetal', + /** Shiny, silvery-white, somewhat reactive metals in group 2. */ ALKALINE_EARTH_METAL = 'alkalineEarthMetal', + /** Elements with properties intermediate between those of metals and solid nonmetals. */ METALLOID = 'metalloid', + /** Group 17 elements that form strongly acidic compounds with hydrogen and salts with metals. */ HALOGEN = 'halogen', + /** General classification for elements that are good conductors of heat and electricity. */ METAL = 'metal', + /** Elements whose atoms have a partially filled d sub-shell, characterized by multiple oxidation states. */ TRANSITION_METAL = 'transitionMetal', + /** Fifteen metallic elements with atomic numbers 57 through 71, characterized by filling the 4f subshell. */ LANTHANOIDE = 'lanthanoid', + /** Fifteen metallic elements with atomic numbers 89 through 103, all being radioactive. */ ACTINOIDE = 'actinoide' }; +/** + * Standard group names for the vertical columns in the periodic table. + */ export enum ElementGroup { + /** Elements in the first vertical column, excluding hydrogen. */ ALKALI_METAL = 'alkaliMetal', + /** Elements in the second vertical column. */ ALKALINE_EARTH_METAL = 'alkalineEarthMetal', + /** Elements in the third vertical column. */ SCANDIUM_GROUP = 'scandiumGroup', + /** Elements in the fourth vertical column. */ TITANIUM_GROUP = 'titaniumGroup', + /** Elements in the fifth vertical column. */ VANADIUM_GROUP = 'vanadiumGroup', + /** Elements in the sixth vertical column. */ CHROMIUM_GROUP = 'chromiumGroup', + /** Elements in the seventh vertical column. */ MANGANESE_GROUP = 'manganeseGroup', + /** Elements in the eighth vertical column. */ IRON_GROUP = 'ironGroup', + /** Elements in the ninth vertical column. */ COBALT_GROUP = 'cobaltGroup', + /** Elements in the tenth vertical column. */ NICKEL_GROUP = 'nickelGroup', + /** Elements in the eleventh vertical column. */ COPPER_GROUP = 'copperGroup', + /** Elements in the twelfth vertical column. */ ZINC_GROUP = 'zincGroup', + /** Elements in column 13, also known as the icosagens. */ BORON_GROUP = 'boronGroup', + /** Elements in column 14, also known as the crystallogens. */ CARBON_GROUP = 'carbonGroup', + /** Elements in column 15, known for forming stable nitrides and phosphides. */ PNICTOGEN = 'pnictogen', + /** Elements in column 16, known as the ore-forming elements. */ CHALCOGEN = 'chalcogen', + /** Elements in column 17, highly reactive nonmetals. */ HALOGEN = 'halogen', + /** Elements in column 18, characterized by minimal chemical reactivity. */ NOBLE_GAS = 'nobleGas', + /** The series of elements from lanthanum to lutetium. */ LANTHANOID_SERIES = 'lanthanoidSeries', + /** The series of elements from actinium to lawrencium. */ ACTINOID_SERIES = 'actinoidSeries' }; +/** + * Qualitative properties and descriptors associated with chemical elements. + */ export enum ElementProperty { + /** Elements known to and used by ancient civilizations (e.g., Gold, Copper). */ ANTIQUITY = 'antiquity', + /** Produced primarily through human activity or nuclear synthesis. */ ARTIFICIAL = 'artificial', + /** Metals with high density, atomic weight, or atomic number, often toxic. */ HEAVY_METAL = 'heavyMetal', + /** Metals with relatively low density (typically less than 5 g/cm³). */ LIGHT_METAL = 'lightMetal', + /** Elements occurring in nature as a single stable isotope. */ MONONUCLEIDE = 'mononuclide', + /** Found in nature in its metallic form, either pure or as an alloy. */ NATIVE = 'native', + /** Formed through natural processes without human intervention. */ NATURAL = 'natural', + /** Elements that are resistant to corrosion and oxidation in moist air. */ NOBLE = 'noble', + /** Six transition metal elements (Ru, Rh, Pd, Os, Ir, Pt) clustered together in the d-block. */ PLATINUM_METAL = 'platinumMetal', + /** Emitting radiation as a result of nuclear decay. */ RADIOACTIVE = 'radioactive', + /** Set of seventeen elements including the lanthanoids plus scandium and yttrium. */ RARE_EARTHS = 'rareEarths', + /** Metals that are extraordinarily resistant to heat and wear. */ REFRACTOR_METAL = 'refractorMetal', + /** Material with electrical conductivity between that of a conductor and an insulator. */ SEMICONDUCTOR = 'semiconductor', + /** Having at least one isotope that does not undergo radioactive decay. */ STABLE = 'stable', + /** Specifically created in laboratory or nuclear reactors, not found naturally on Earth. */ SYNTHETIC = 'synthetic', + /** Essential or strictly associated with biological life processes. */ VITAL = 'vital' }; + +/** + * The 18 vertical columns of the periodic table representing groups of elements. + */ +export enum PTColumn { + /** Group 1: Alkali metals and Hydrogen. */ + COLUMN_1 = 1, + /** Group 2: Alkaline earth metals. */ + COLUMN_2 = 2, + /** Group 3: Scandium group. */ + COLUMN_3 = 3, + /** Group 4: Titanium group. */ + COLUMN_4 = 4, + /** Group 5: Vanadium group. */ + COLUMN_5 = 5, + /** Group 6: Chromium group. */ + COLUMN_6 = 6, + /** Group 7: Manganese group. */ + COLUMN_7 = 7, + /** Group 8: Iron group. */ + COLUMN_8 = 8, + /** Group 9: Cobalt group. */ + COLUMN_9 = 9, + /** Group 10: Nickel group. */ + COLUMN_10 = 10, + /** Group 11: Copper group. */ + COLUMN_11 = 11, + /** Group 12: Zinc group. */ + COLUMN_12 = 12, + /** Group 13: Boron group. */ + COLUMN_13 = 13, + /** Group 14: Carbon group. */ + COLUMN_14 = 14, + /** Group 15: Pnictogens. */ + COLUMN_15 = 15, + /** Group 16: Chalcogens. */ + COLUMN_16 = 16, + /** Group 17: Halogens. */ + COLUMN_17 = 17, + /** Group 18: Noble gases. */ + COLUMN_18 = 18 +}; + +/** + * The 7 horizontal rows of the periodic table representing electron shells. + */ +export enum PTPeriod { + /** First period: contains Hydrogen and Helium. */ + PERIOD_1 = 1, + /** Second period: Li through Ne. */ + PERIOD_2 = 2, + /** Third period: Na through Ar. */ + PERIOD_3 = 3, + /** Fourth period: K through Kr. */ + PERIOD_4 = 4, + /** Fifth period: Rb through Xe. */ + PERIOD_5 = 5, + /** Sixth period: Cs through Rn (including Lanthanoides). */ + PERIOD_6 = 6, + /** Seventh period: Fr through Og (including Actinoides). */ + PERIOD_7 = 7 +}; + +/** + * Letter designations for the principal electron shells of an atom. + */ +export enum ShellModel { + /** The innermost electron shell (n=1). */ + K = 'k', + /** The second electron shell (n=2). */ + L = 'l', + /** The third electron shell (n=3). */ + M = 'm', + /** The fourth electron shell (n=4). */ + N = 'n', + /** The fifth electron shell (n=5). */ + O = 'o', + /** The sixth electron shell (n=6). */ + P = 'p', + /** The seventh electron shell (n=7). */ + Q = 'q' +}; + +/** + * Classification of elements based on their origin and existence on Earth. + */ +export enum NaturalOccurrence { + /** Existed in its current form since the formation of the Earth. */ + PRIMORDIAL = 'primordial', + /** Produced through the radioactive decay of a heavier parent isotope. */ + DECAY_PRODUCT = 'decayProduct', + /** Created artificially through nuclear transmutation, not naturally occuring. */ + SYNTHETIC = 'synthetic' +}; From 6b54a0805b117466777e4b8128beef5648bba91d Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:24:56 +0200 Subject: [PATCH 26/53] del unused generic.ts --- enum/generic.ts | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 enum/generic.ts diff --git a/enum/generic.ts b/enum/generic.ts deleted file mode 100644 index 35ebfbf1..00000000 --- a/enum/generic.ts +++ /dev/null @@ -1,38 +0,0 @@ -export enum LangCode { - ARABIC = 'ar', BENGALI = 'bn', BULGARIAN = 'bg', CHINESE = 'zh', CROATIAN = 'hr', - CZECH = 'cs', DANISH = 'da', DUTCH = 'nl', ENGLISH = 'en', ESTONIAN = 'et', - FINNISH = 'fi', FRENCH = 'fr', GERMAN = 'de', GREEK = 'el', HEBREW = 'he', HINDI = 'hi', - HUNGARIAN = 'hu', INDONESIAN = 'id', IRISH = 'ga', ITALIAN = 'it', JAPANESE = 'ja', - KOREAN = 'ko', LATIN = 'la', LATVIAN = 'lv', LITHUANIAN = 'lt', MALAY = 'ms', - NORWEGIAN = 'no', PERSIAN = 'fa', POLISH = 'pl', PORTUGUESE = 'pt', ROMANIAN = 'ro', - RUSSIAN = 'ru', SLOVAK = 'sk', SLOVENIAN = 'sl', SPANISH = 'es', SWEDISH = 'sv', - THAI = 'th', TURKISH = 'tr', UKRAINIAN = 'uk', VIETNAMESE = 'vi' -}; - -export enum PTColumn { - COLUMN_1 = 1, COLUMN_2 = 2, COLUMN_3 = 3, COLUMN_4 = 4, COLUMN_5 = 5, COLUMN_6 = 6, - COLUMN_7 = 7, COLUMN_8 = 8, COLUMN_9 = 9, COLUMN_10 = 10, COLUMN_11 = 11, COLUMN_12 = 12, - COLUMN_13 = 13, COLUMN_14 = 14, COLUMN_15 = 15, COLUMN_16 = 16, COLUMN_17 = 17, - COLUMN_18 = 18 -}; - -export enum PTPeriod { - PERIOD_1 = 1, PERIOD_2 = 2, PERIOD_3 = 3, PERIOD_4 = 4, PERIOD_5 = 5, PERIOD_6 = 6, - PERIOD_7 = 7 -}; - -export enum ShellModel { K = 'k', L = 'l', M = 'm', N = 'n', O = 'o', P = 'p', Q = 'q' }; - -export enum Phase { - SOLID = 'solid', - GASEOUS = 'gaseous', - LIQUID = 'liquid', - PLASMA = 'plasma', - UNKNOWN = 'unknown' -}; - -export enum NaturalOccurrence { - PRIMORDIAL = 'primordial', - DECAY_PRODUCT = 'decayProduct', - SYNTHETIC = 'synthetic' -}; From 19bba46eed00540486d8f53cc7e8028d60b229b6 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:27:08 +0200 Subject: [PATCH 27/53] Update compound.ts --- enum/compound.ts | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/enum/compound.ts b/enum/compound.ts index 85b9db0e..02dccb14 100644 --- a/enum/compound.ts +++ b/enum/compound.ts @@ -1,40 +1,89 @@ +/** + * @file compound.ts + * @description Defines enums for chemical compounds, their categories, and reactive properties. + * This module covers bonding-based classification and structural qualifiers. + */ + +/** + * High-level grouping of substances based on their predominant bonding and structure. + */ export enum CompoundCategory { + /** Discrete groups of atoms held together by covalent bonds. */ MOLECULE = 'molecule', + /** Arranged in a rigid crystal lattice of alternating cations and anions. */ IONIC = 'ionic', + /** Formed from two or more metallic elements in a fixed ratio. */ INTERMETALLIC = 'intermetallic', + /** Coordination compounds involving a central metal atom and ligands. */ COMPLEX = 'complex' }; +/** + * Classification based on the number of distinct elements present in the compound. + */ export enum CompoundUnion { + /** Consisting of exactly two different elements (e.g., NaCl). */ BINARY = 'binary', + /** Consisting of exactly three different elements (e.g., Na2CO3). */ TERNARY = 'ternary', + /** Consisting of exactly four different elements. */ QUATERNARY = 'quaternary' }; +/** + * Functional and descriptive traits associated with chemical compounds. + */ export enum CompoundProperty { + /** Based on carbon-hydrogen frameworks, often containing O, N, S, P. */ ORGANIC = 'organic', + /** General classification for non-carbon based mineral-like compounds. */ INORGANIC = 'inorganic', + /** Substances containing at least one bond between carbon and a metal. */ ORGANOMETALLIC = 'organometallic', + /** Chemically involved in the metabolic processes of living organisms. */ BIOCHEMICAL = 'biochemical', + /** Large molecule consisting of many repeating structural subunits. */ POLYMER = 'polymer', + /** Product of a neutralization reaction between an acid and a base. */ SALT = 'salt', + /** Exhibits low pH behavior or proton donor characteristics. */ ACIDIC = 'acidic', + /** Exhibits high pH behavior or proton acceptor characteristics. */ BASIC = 'basic', + /** Combinations of oxygen with one or more other elements. */ OXIDE = 'oxide', + /** Binary compounds of hydrogen with another element. */ HYDRIDE = 'hydride', + /** Complexes held together by non-covalent intermolecular forces. */ SUPRAMOLECULAR = 'supramolecular', + /** Occurring in nature without human intervention. */ NATURAL = 'natural', + /** Produced through intentional chemical synthesis. */ SYNTHETIC = 'synthetic', + /** Capable of behaving as both an acid and a base. */ AMPHOTERIC = 'amphoteric', + /** Cyclic planar molecule with delocalized pi-electrons (e.g., Benzene). */ AROMATIC = 'aromatic', + /** Highly reactive species with an unpaired valence electron. */ RADICAL = 'radical', + /** Lacking any observable color in the visible spectrum. */ COLORLESS = 'colorless', + /** Absorbing specific wavelengths of light to exhibit visual color. */ COLORED = 'colored', + /** Destructive to living tissue or metals upon contact. */ CORROSIVE = 'corrosive', + /** Rapidly decomposing with significant release of energy and gas. */ EXPLOSIVE = 'explosive', + /** Capable of catching fire and burning easily. */ FLAMMABLE = 'flammable', + /** Potentially fatal in very small doses. */ HIGHLY_TOXIC = 'highlyToxic', + /** Containing unstable nuclei that emit radiation. */ RADIOACTIVE = 'radioactive', + /** Harmful if ingested, inhaled, or absorbed by the skin. */ TOXIC = 'toxic', - VOLATILE = 'volatile' + /** Easily evaporated at normal temperatures. */ + VOLATILE = 'volatile', + /** Essential for life. */ + VITAL = 'vital' }; From ee960dbda848f74474278f0a711e9cb3b809489e Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:27:57 +0200 Subject: [PATCH 28/53] Update mineral.ts --- enum/mineral.ts | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/enum/mineral.ts b/enum/mineral.ts index 29db9329..8662c869 100644 --- a/enum/mineral.ts +++ b/enum/mineral.ts @@ -1,58 +1,123 @@ +/** + * @file mineral.ts + * @description Defines enums for mineral classification and physical diagnostic properties. + * This module covers IMA mineral categories, chemical classes, and physical identifiers. + */ + +/** + * High-level chemical classification of minerals based on their dominant redundant anions. + */ export enum MineralCategory { + /** Pure elements occurring in nature (e.g., Diamond, Gold). */ ELEMENTS = 'elements', + /** Compounds of sulfur with a metal or semi-metal (e.g., Pyrite). */ SULFIDES = 'sulfides', + /** Salts containing a halogen as the dominant anion (e.g., Halite). */ HALIDES = 'halides', + /** Oxygen-bearing compounds, typically with a metal (e.g., Hematite). */ OXIDES = 'oxides', + /** Minerals containing the carbonate ion (CO3)2- (e.g., Calcite). */ CARBONATES = 'carbonates', + /** Boron-oxygen bearing minerals (e.g., Borax). */ BORATES = 'borates', + /** Minerals containing the sulfate ion (SO4)2- (e.g., Gypsum). */ SULFATES = 'sulfates', + /** Minerals containing the phosphate ion (PO4)3- (e.g., Apatite). */ PHOSPHATES = 'phosphates', + /** The largest group, containing silicon and oxygen (e.g., Quartz, Feldspar). */ SILICATES = 'silicates', + /** Naturally occurring organic chemical compounds (e.g., Whewellite). */ ORGANIC = 'organic', + /** Mineral species whose chemical classification is currently unconfirmed. */ UNKNOWN = 'unknown' }; +/** + * Detailed Strunz or Dana mineralogical classes based on chemical composition. + */ export enum MineralClass { + /** Native elements and alloys. */ ELEMENTS = 'elements', + /** Sulfides and sulfosalts. */ SULFIDES = 'sulfides', + /** Complex sulfur-arsenic/antimony compounds. */ SULFOSALTS = 'sulfosalts', + /** Natural halogen salts. */ HALIDES = 'halides', + /** Metal oxides and hydroxides. */ OXIDES = 'oxides', + /** Hydroxyl-bearing metal oxides. */ HYDROXIDES = 'hydroxides', + /** Minerals containing trivalent arsenic (AsO3)3-. */ ARSENITES = 'arsenites', + /** Carbonate minerals. */ CARBONATES = 'carbonates', + /** Minerals containing the nitrate ion (NO3)-. */ NITRATES = 'nitrates', + /** Borate minerals. */ BORATES = 'borates', + /** Sulfate minerals. */ SULFATES = 'sulfates', + /** Chromium-oxygen bearing minerals. */ CHROMATES = 'chromates', + /** Molybdenum-oxygen bearing minerals. */ MOLYBDATES = 'molybdates', + /** Phosphate minerals. */ PHOSPHATES = 'phosphates', + /** Arsenic-oxygen bearing minerals in the +5 oxidation state. */ ARSENATES = 'arsenates', + /** Organic mineral species. */ ORGANIC = 'organic', + /** Silicate framework and sheet minerals. */ SILICATES = 'silicates', + /** Unspecified class. */ UNKNOWN = 'unknown' }; +/** + * Physical diagnostic traits used for the identification of mineral specimens. + */ export enum MineralProperty { + /** Exhibit a distinct hue (idiochromatic or allochromatic). */ COLORED = 'colored', + /** Lacking any intrinsic or external coloration. */ COLORLESS = 'colorless', + /** Light passes through but objects cannot be clearly seen. */ TRANSLUCENT = 'translucent', + /** Completely blocks light transmission. */ OPAQUE = 'opaque', + /** Completely clear, allowing light and images to pass through. */ TRANSPARENT = 'transparent', + /** Responsive to external magnetic fields or exhibiting permanent magnetism. */ MAGNETIC = 'magnetic', + /** Emits light after excitation by an energy source. */ LUMINESCENT = 'luminescent', + /** Emits light immediately after UV or X-ray excitation. */ FLUORESCENT = 'fluorescent', + /** Continues to emit light after the excitation source is removed. */ PHOSPHORESCENT = 'phosphorescent', + /** Emits ionizing radiation due to unstable isotopes. */ RADIOACTIVE = 'radioactive', + /** Susceptible to nuclear fission. */ FISSIONABLE = 'fissionable', + /** Fractures or powders easily under pressure without deformation. */ BRITTLE = 'brittle', + /** Reflective or lustrous surface. */ SHINY = 'shiny', + /** Lacks reflective lustre; earthy or matte appearance. */ DULL = 'dull', + /** Surface sheen typical of metals or sulfides. */ METALLIC = 'metallic', + /** Generates an electric charge in response to mechanical stress. */ PIEZOELECTRIC = 'piezoelectric', + /** Generates an electric charge in response to temperature changes. */ PYROELECTRIC = 'pyroelectric', + /** Allows the flow of electric current. */ CONDUCTIVE = 'conductive', + /** Exhibits electrical conductivity between a conductor and an insulator. */ SEMICONDUCTIVE = 'semiconductive', + /** Highly resistant to the flow of electric current. */ INSULATIVE = 'insulative', + /** Specimen created in a laboratory rather than by geologic processes. */ SYNTHETIC = 'synthetic' }; From c1c2ceb71ea182be009d2b7e71b639cef2f3e719 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:28:34 +0200 Subject: [PATCH 29/53] Update mixture.ts --- enum/mixture.ts | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/enum/mixture.ts b/enum/mixture.ts index 3f0cd710..5ba29850 100644 --- a/enum/mixture.ts +++ b/enum/mixture.ts @@ -1,49 +1,105 @@ +/** + * @file mixture.ts + * @description Defines enums for chemical mixtures, their homogeneity, and physical states. + * This module covers the classification of solutions, colloids, and heterogeneous mixtures. + */ + +/** + * Classification of mixtures based on the physical state of their components. + */ export enum MixtureType { + /** Homogeneous liquid phase with uniform distribution. */ SOLUTION = 'solution', + /** Dispersed particles in a medium that do not settle. */ COLLOID = 'colloid', + /** Large particles that eventually settle under gravity. */ SUSPENSION = 'suspension' }; +/** + * Degree of uniformity in the distribution of components within a mixture. + */ export enum MixtureHomogeneity { + /** Components are uniformly distributed at the molecular or atomic level. */ HOMOGENEOUS = 'homogeneous', + /** Components are not uniformly distributed and can often be visually distinguished. */ HETEROGENEOUS = 'heterogeneous' }; +/** + * Detailed categories of mixtures based on the dispersed and continuous phases. + */ export enum MixtureCategory { + /** Uniform mixture of gases. */ GAS_MIXTURE = 'gasMixture', + /** Liquid droplets dispersed in a gas. */ LIQUID_AEROSOL = 'liquidAerosol', + /** Solid particles dispersed in a gas. */ SOLID_AEROSOL = 'solidAerosol', + /** Gas bubbles dispersed in a liquid. */ LIQUID_FOAM = 'liquidFoam', + /** Gas bubbles dispersed in a solid. */ SOLID_FOAM = 'solidFoam', + /** Liquid droplets dispersed in another liquid. */ EMULSION = 'emulsion', + /** Solid particles dispersed in a liquid (e.g., Ink). */ SOL = 'sol', + /** Solid particles dispersed in a solid. */ SOLID_SOL = 'solidSol', + /** Semi-solid or jelly-like colloidal system. */ GEL = 'gel', + /** Homogeneous solid solution of two or more metals. */ ALLOY = 'alloy', + /** Specifically a mercury-based metal alloy. */ AMALGAM = 'amalgam', + /** Mixture of liquids with a constant boiling point. */ AZEOTROPE = 'azeotrope', + /** Large solid particles dispersed in a fluid. */ SUSPENSION = 'suspension', + /** Macroscopic mixture of distinct substances. */ COARSE_MIXTURE = 'coarseMixture', + /** Unspecified category. */ UNKNOWN = 'unknown' }; +/** + * Qualitative attributes describing the behavior and separation properties of a mixture. + */ export enum MixtureProperty { + /** Boiling at a constant temperature without change in composition. */ AZEOTROPIC = 'azeotropic', + /** Boiling over a range of temperatures with changing composition. */ ZEOTROPIC = 'zeotropic', + /** Having the lowest possible melting point for a mixture of specific components. */ EUTECTIC = 'eutectic', + /** Solid lacking long-range atomic order. */ AMORPHOUS = 'amorphous', + /** Structured into a network or grid-like pattern. */ RETICULATED = 'reticulated', + /** Containing discrete pores that do not communicate. */ CLOSED_CELL = 'closedCell', + /** Two phases intertwined in a three-dimensional network. */ BICONTINUOUS = 'bicontinuous', + /** Components are unable to mix to form a homogeneous phase. */ IMMISCIBLE = 'immiscible', + /** Ratio of components varies across samples. */ VARIABLE_COMPOSITION = 'variableComposition', + /** Every part of the sample contains the same ratio of components. */ UNIFORM_COMPOSITION = 'uniformComposition', + /** Parts of the sample differ significantly in composition. */ NON_UNIFORM_COMPOSITION = 'nonUniformComposition', + /** Connected network allowing movement through the sample. */ PERCOLATING = 'percolating', + /** Containing extraneous substances not part of the base mixture. */ IMPURE = 'impure', + /** Components can be separated by filtration or sorting. */ MECHANICALLY_SEPARABLE = 'mechanicallySeparable', + /** Components can be separated by distillation or sublimation. */ THERMALLY_SEPARABLE = 'thermallySeparable', + /** Emitting radiation from radioactive isotopes. */ RADIOACTIVE = 'radioactive', + /** Produced in a laboratory or factory. */ SYNTHETIC = 'synthetic', + /** Found in nature. */ NATURAL = 'natural' }; From 82cc8944815e08c2a83e050599c6fa872cf8c5e7 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:30:48 +0200 Subject: [PATCH 30/53] fix imports for abstract types --- types/abstract/form.ts | 2 +- types/abstract/util.ts | 2 +- types/abstract/value.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/abstract/form.ts b/types/abstract/form.ts index fc91aac6..676b21ff 100644 --- a/types/abstract/form.ts +++ b/types/abstract/form.ts @@ -8,7 +8,7 @@ import type { RequireFrom } from 'devtypes/types/constraint'; import type { DeepPartial } from 'devtypes/types/transform'; import type { Brand, Expand } from 'devtypes/types/util'; -import type { Phase } from '../../enum/generic'; +import type { Phase } from '../../enum/physics'; import type { FormType } from '../../enum/util'; import type { Collection, Distinct } from './collection'; diff --git a/types/abstract/util.ts b/types/abstract/util.ts index 115ae638..0177b844 100644 --- a/types/abstract/util.ts +++ b/types/abstract/util.ts @@ -5,7 +5,7 @@ */ import type { Expand } from 'devtypes/types/util'; -import type { LangCode } from '../../enum/generic'; +import type { LangCode } from '../../enum/util'; import type { Distinct, Group } from '../abstract/collection'; /** diff --git a/types/abstract/value.ts b/types/abstract/value.ts index 62fea231..618779c0 100644 --- a/types/abstract/value.ts +++ b/types/abstract/value.ts @@ -8,7 +8,7 @@ import type { RequireAtLeastOne, RequireExactlyOneFrom, RequireFrom, StrictSubset } from 'devtypes/types/constraint'; import type { Primitive } from 'devtypes/types/primitive'; import type { Brand, Expand } from 'devtypes/types/util'; -import type { ValueType, ValueConfidence } from '../../enum/util'; +import type { ValueConfidence, ValueType } from '../../enum/util'; import type { Uncertainty } from './uncertainty'; import type { PhysicalQuantity, UnitId } from './unit'; From 3519216b6e81ccea4896710b8be1cf30088ecd6e Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:37:13 +0200 Subject: [PATCH 31/53] fix import paths + order --- types/collection/abundance.ts | 2 +- types/collection/atomics.ts | 2 +- types/collection/descriptive.ts | 3 +-- types/collection/nuclear.ts | 2 +- types/collection/physics.ts | 3 +-- types/entity/compound.ts | 4 ++-- types/entity/element.ts | 4 ++-- types/entity/mineral.ts | 4 ++-- types/entity/mixture.ts | 4 ++-- types/entity/nuclide.ts | 4 ++-- 10 files changed, 15 insertions(+), 17 deletions(-) diff --git a/types/collection/abundance.ts b/types/collection/abundance.ts index a1cb0918..10d09eb2 100644 --- a/types/collection/abundance.ts +++ b/types/collection/abundance.ts @@ -1,4 +1,4 @@ -import type { NaturalOccurrence } from '../../enum/generic'; +import type { NaturalOccurrence } from '../../enum/element'; import type { Collection, Single } from '../abstract/collection'; import type { NumberProperty, PrimitiveProperty } from '../abstract/property'; diff --git a/types/collection/atomics.ts b/types/collection/atomics.ts index 8ac3ec48..d8b3b91c 100644 --- a/types/collection/atomics.ts +++ b/types/collection/atomics.ts @@ -1,4 +1,4 @@ -import type { ShellModel } from '../../enum/generic'; +import type { ShellModel } from '../../enum/element'; import type { Collection, Group, Single } from '../abstract/collection'; import type { ArrayProperty, NumberProperty, PrimitiveProperty, StructProperty } from '../abstract/property'; diff --git a/types/collection/descriptive.ts b/types/collection/descriptive.ts index e1d102af..3a0bac62 100644 --- a/types/collection/descriptive.ts +++ b/types/collection/descriptive.ts @@ -1,5 +1,4 @@ -import type { LangCode } from '../../enum/generic'; -import type { D3Format, ImageFormat } from '../../enum/util'; +import type { D3Format, ImageFormat, LangCode } from '../../enum/util'; import type { Collection, Distinct, Group, Single } from '../abstract/collection'; import type { PrimitiveProperty } from '../abstract/property'; import type { RefId } from '../abstract/reference'; diff --git a/types/collection/nuclear.ts b/types/collection/nuclear.ts index 410c65e8..c05091eb 100644 --- a/types/collection/nuclear.ts +++ b/types/collection/nuclear.ts @@ -1,4 +1,4 @@ -import type { DecayMode, RadiationType, SpinParity } from '../../enum/nuclide'; +import type { DecayMode, RadiationType, SpinParity } from '../../enum/nuclear'; import type { Collection, Single } from '../abstract/collection'; import type { StructProperty } from '../abstract/property'; import type { NumberValue, PrimitiveValue } from '../abstract/value'; diff --git a/types/collection/physics.ts b/types/collection/physics.ts index 4074ceba..26ce9d18 100644 --- a/types/collection/physics.ts +++ b/types/collection/physics.ts @@ -1,5 +1,4 @@ -import type { Phase } from '../../enum/generic'; -import type { Diaphaneity, Gloss, Lustre, MagneticOrdering, Superconductivity } from '../../enum/physics'; +import type { Diaphaneity, Gloss, Lustre, MagneticOrdering, Phase, Superconductivity } from '../../enum/physics'; import type { Collection, Group, Single } from '../abstract/collection'; import type { CoupledNumberProperty, NumberProperty, PrimitiveProperty } from '../abstract/property'; import type { LangGroup } from '../abstract/util'; diff --git a/types/entity/compound.ts b/types/entity/compound.ts index 93c227a3..80bdc6f6 100644 --- a/types/entity/compound.ts +++ b/types/entity/compound.ts @@ -1,6 +1,6 @@ -import type { CompoundCategory, CompoundProperty, CompoundUnion } from '../../enum/compound'; -import type { Phase } from '../../enum/generic'; import type { Brand, Expand } from 'devtypes/types/util'; +import type { CompoundCategory, CompoundProperty, CompoundUnion } from '../../enum/compound'; +import type { Phase } from '../../enum/physics'; import type { Collection, Distinct } from '../abstract/collection'; import type { FormCollection } from '../abstract/form'; import type { MetaData } from '../abstract/util'; diff --git a/types/entity/element.ts b/types/entity/element.ts index 14fe87e9..914a0b80 100644 --- a/types/entity/element.ts +++ b/types/entity/element.ts @@ -1,6 +1,6 @@ -import type { ElementBlock, ElementGroup, ElementProperty, ElementSet, ElementSymbol } from '../../enum/element'; -import type { Phase, PTColumn, PTPeriod } from '../../enum/generic'; import type { Expand } from 'devtypes/types/util'; +import type { ElementBlock, ElementGroup, ElementProperty, ElementSet, ElementSymbol, PTColumn, PTPeriod } from '../../enum/element'; +import type { Phase } from '../../enum/physics'; import type { Collection, Distinct } from '../abstract/collection'; import type { FormCollection } from '../abstract/form'; import type { MetaData } from '../abstract/util'; diff --git a/types/entity/mineral.ts b/types/entity/mineral.ts index e3faf97f..91f490d6 100644 --- a/types/entity/mineral.ts +++ b/types/entity/mineral.ts @@ -1,6 +1,6 @@ -import type { Phase } from '../../enum/generic'; -import type { MineralCategory, MineralClass, MineralProperty } from '../../enum/mineral'; import type { Brand, Expand } from 'devtypes/types/util'; +import type { MineralCategory, MineralClass, MineralProperty } from '../../enum/mineral'; +import type { Phase } from '../../enum/physics'; import type { Collection, Distinct } from '../abstract/collection'; import type { FormCollection } from '../abstract/form'; import type { MetaData } from '../abstract/util'; diff --git a/types/entity/mixture.ts b/types/entity/mixture.ts index 9d2889f2..4ddfe5ec 100644 --- a/types/entity/mixture.ts +++ b/types/entity/mixture.ts @@ -1,6 +1,6 @@ -import type { Phase } from '../../enum/generic'; -import type { MixtureCategory, MixtureHomogeneity, MixtureProperty, MixtureType } from '../../enum/mixture'; import type { Brand, Expand } from 'devtypes/types/util'; +import type { MixtureCategory, MixtureHomogeneity, MixtureProperty, MixtureType } from '../../enum/mixture'; +import type { Phase } from '../../enum/physics'; import type { Collection, Distinct } from '../abstract/collection'; import type { MetaData } from '../abstract/util'; import type { Composite } from './composite'; diff --git a/types/entity/nuclide.ts b/types/entity/nuclide.ts index 3eaf8fc3..31a0a892 100644 --- a/types/entity/nuclide.ts +++ b/types/entity/nuclide.ts @@ -1,6 +1,6 @@ -import type { ElementSymbol } from '../../enum/element'; -import type { DecayMode, NuclideProperty, NuclideStability, NuclideState, SpinParity } from '../../enum/nuclide'; import type { Brand, Expand } from 'devtypes/types/util'; +import type { ElementSymbol } from '../../enum/element'; +import type { DecayMode, NuclideProperty, NuclideStability, NuclideState, SpinParity } from '../../enum/nuclear'; import type { Collection, Distinct, Group } from '../abstract/collection'; import type { MetaData } from '../abstract/util'; import type { DescriptiveCollection } from '../collection/descriptive'; From 08a230a0541a740c031e4f2cb4a76f146fdaccb5 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 11:49:12 +0200 Subject: [PATCH 32/53] min fixes --- enum/physics.ts | 10 +-- enum/safety.ts | 84 ++++++++++---------- enum/util.ts | 144 +++++++++++++++++----------------- types/abstract/collection.ts | 14 ++-- types/abstract/condition.ts | 4 +- types/abstract/form.ts | 10 +-- types/abstract/property.ts | 4 +- types/abstract/reference.ts | 98 +++++++++++------------ types/abstract/uncertainty.ts | 12 +-- types/abstract/unit.ts | 32 ++++---- types/abstract/util.ts | 12 +-- types/abstract/value.ts | 26 +++--- 12 files changed, 225 insertions(+), 225 deletions(-) diff --git a/enum/physics.ts b/enum/physics.ts index b04033ff..bc143dcd 100644 --- a/enum/physics.ts +++ b/enum/physics.ts @@ -9,15 +9,15 @@ * Fundamental states of matter based on particle arrangement and energy. */ export enum Phase { - /** Rigid state where molecules/atoms are closely packed in a fixed lattice */ + /** Rigid state where molecules/atoms are closely packed in a fixed lattice. */ SOLID = 'solid', - /** Fluid state with fixed volume but variable shape, allowing molecular flow */ + /** Fluid state with fixed volume but variable shape, allowing molecular flow. */ LIQUID = 'liquid', - /** Compressible fluid phase with neither definite shape nor volume */ + /** Compressible fluid phase with neither definite shape nor volume. */ GASEOUS = 'gaseous', - /** Ionized state of matter where atoms are stripped of their electrons */ + /** Ionized state of matter where atoms are stripped of their electrons. */ PLASMA = 'plasma', - /** Current state is undetermined or scientifically undefined */ + /** Current state is undetermined or scientifically undefined. */ UNKNOWN = 'unknown' }; diff --git a/enum/safety.ts b/enum/safety.ts index 97daa7c3..8fc1ee8d 100644 --- a/enum/safety.ts +++ b/enum/safety.ts @@ -8,11 +8,11 @@ * Standard signal words used on hazard labels to indicate relative severity. */ export enum SignalWord { - /** Serious health or environmental risk */ + /** Serious health or environmental risk. */ DANGER = 'danger', - /** Moderate health or environmental risk */ + /** Moderate health or environmental risk. */ WARNING = 'warning', - /** Lower level of potential injury or hazard */ + /** Lower level of potential injury or hazard. */ CAUTION = 'caution' }; @@ -20,15 +20,15 @@ export enum SignalWord { * National Fire Protection Association (NFPA) 704 numerical ratings for hazard severity. */ export enum NFPACode { - /** No significant hazard */ + /** No significant hazard. */ NONE = 0, - /** Slight hazard; caution required */ + /** Slight hazard; caution required. */ SLIGHT = 1, - /** Moderate hazard; potential for injury */ + /** Moderate hazard; potential for injury. */ MODERATE = 2, - /** Serious hazard; specialized equipment needed */ + /** Serious hazard; specialized equipment needed. */ SERIOUS = 3, - /** Severe hazard; life-threatening */ + /** Severe hazard; life-threatening. */ SEVERE = 4 }; @@ -36,27 +36,27 @@ export enum NFPACode { * Special notices for specific chemical hazards defined by NFPA 704. */ export enum NFPANotice { - /** Substance with oxidizing properties */ + /** Substance with oxidizing properties. */ OXIDIZER = 'OX', - /** Reacts violently or explosively with water; do not extinguish with water */ + /** Reacts violently or explosively with water; do not extinguish with water. */ WATER_REACTIVE = 'W', - /** Gases that displace air and can cause suffocation */ + /** Gases that displace air and can cause suffocation. */ SIMPLE_ASPHYXIANT = 'SA', - /** Causes destruction of human tissue or corrosion of metals */ + /** Causes destruction of human tissue or corrosion of metals. */ CORROSIVE = 'COR', - /** Specifically acidic material */ + /** Specifically acidic material. */ ACID = 'ACID', - /** Specifically alkaline (basic) material */ + /** Specifically alkaline (basic) material. */ ALKALINE = 'ALK', - /** Contains pathogenic biological agents */ + /** Contains pathogenic biological agents. */ BIOHAZARDOUS = 'BIO', - /** Highly toxic or lethal substance */ + /** Highly toxic or lethal substance. */ POISONOUS = 'POI', - /** Emits ionizing radiation */ + /** Emits ionizing radiation. */ RADIOACTIVE = 'RAD', - /** Specifically cold-stored liquids or materials */ + /** Specifically cold-stored liquids or materials. */ CRYOGENIC = 'CRY', - /** Oxidizing gas specifically at standard conditions */ + /** Oxidizing gas specifically at standard conditions. */ OXYGEN_GAS = 'G OX' }; @@ -64,23 +64,23 @@ export enum NFPANotice { * Globally Harmonized System (GHS) visual symbols for hazard communication. */ export enum GHSPictogram { - /** Unstable explosives or items with mass explosion hazard */ + /** Unstable explosives or items with mass explosion hazard. */ EXPLOSIVE = 'explosive', - /** Flammable gases, aerosols, liquids, or solids */ + /** Flammable gases, aerosols, liquids, or solids. */ FLAMMABLE = 'flammable', - /** Oxidizing gases, liquids, or solids */ + /** Oxidizing gases, liquids, or solids. */ OXIDIZING = 'oxidizing', - /** Gases under pressure in a cylinder */ + /** Gases under pressure in a cylinder. */ COMPRESSED_GAS = 'compressedGas', - /** Skin corrosion, serious eye damage, or metal corrosion */ + /** Skin corrosion, serious eye damage, or metal corrosion. */ CORROSIVE = 'corrosive', - /** Acute toxicity (fatal or toxic if ingested or inhaled) */ + /** Acute toxicity (fatal or toxic if ingested or inhaled). */ TOXIC = 'toxic', - /** Skin and eye irritation, sensitization, or narcotic effects */ + /** Skin and eye irritation, sensitization, or narcotic effects. */ HARMFUL = 'harmful', - /** Respiratory sensitizer, mutagen, or carcinogen */ + /** Respiratory sensitizer, mutagen, or carcinogen. */ HEALTH_HAZARD = 'healthHazard', - /** Acute or chronic aquatic toxicity */ + /** Acute or chronic aquatic toxicity. */ ENVIRONMENTAL_HAZARD = 'environmentalHazard' }; @@ -240,21 +240,21 @@ export enum DOTClass { * Standard metrics for determining the toxicity of a chemical substance. */ export enum ToxicityType { - /** Half maximal effective concentration causing a response in 50% of people */ + /** Half maximal effective concentration causing a response in 50% of people. */ EC50 = 'EC50', - /** Lethal concentration resulting in death for 50% of the population */ + /** Lethal concentration resulting in death for 50% of the population. */ LC50 = 'LC50', - /** Lethal dose resulting in death for 50% of the population */ + /** Lethal dose resulting in death for 50% of the population. */ LD50 = 'LD50', - /** Toxic dose causing adverse effects in 50% of the population */ + /** Toxic dose causing adverse effects in 50% of the population. */ TD50 = 'TD50', - /** Lowest Observed Adverse Effect Level */ + /** Lowest Observed Adverse Effect Level. */ LOAEL = 'LOAEL', - /** Lowest Observed Effect Level */ + /** Lowest Observed Effect Level. */ LOEL = 'LOEL', - /** No Observed Adverse Effect Level */ + /** No Observed Adverse Effect Level. */ NOAEL = 'NOAEL', - /** No Observed Effect Level */ + /** No Observed Effect Level. */ NOEL = 'NOEL' }; @@ -262,16 +262,16 @@ export enum ToxicityType { * Route of exposure used during toxicological testing. */ export enum ToxicityApplication { - /** Through direct contact with the skin */ + /** Through direct contact with the skin. */ DERMAL = 'dermal', - /** Through breathing of gas, vapor, or particulates */ + /** Through breathing of gas, vapor, or particulates. */ INHALATION = 'inhalation', - /** Injection into the body cavity */ + /** Injection into the body cavity. */ INTRAPERITONEAL = 'intraperitoneal', - /** Direct injection into a vein */ + /** Direct injection into a vein. */ INTRAVENOUS = 'intravenous', - /** Ingestion through the mouth */ + /** Ingestion through the mouth. */ ORAL = 'oral', - /** Injection under the skin */ + /** Injection under the skin. */ SUBCUTANEOUS = 'subcutaneous' }; diff --git a/enum/util.ts b/enum/util.ts index 1c9c36b0..09ac3e07 100644 --- a/enum/util.ts +++ b/enum/util.ts @@ -8,17 +8,17 @@ * Technical representation models for data values within the schema. */ export enum ValueType { - /** A single, primitive data point (e.g., number or string) */ + /** A single, primitive data point (e.g., number or string). */ PRIMITIVE = 'primitive', - /** A complex object containing nested fields and sub-properties */ + /** A complex object containing nested fields and sub-properties. */ STRUCT = 'struct', - /** A discrete individual measurement or value */ + /** A discrete individual measurement or value. */ SINGLE = 'single', - /** A collection of values of the same type */ + /** A collection of values of the same type. */ ARRAY = 'array', - /** A continuous interval between two numeric bounds */ + /** A continuous interval between two numeric bounds. */ RANGE = 'range', - /** Coupled values for entries based on multiple physical properties */ + /** Coupled values for entries based on multiple physical properties. */ COUPLED = 'coupled' }; @@ -26,15 +26,15 @@ export enum ValueType { * Degree of scientific reliability and origin of a specific data point. */ export enum ValueConfidence { - /** Obtained through direct physical observation or instrumentation */ + /** Obtained through direct physical observation or instrumentation. */ MEASURED = 'measured', - /** Derived from established formulas or numerical simulations */ + /** Derived from established formulas or numerical simulations. */ CALCULATED = 'calculated', - /** Approximated through heuristic models or incomplete data */ + /** Approximated through heuristic models or incomplete data. */ ESTIMATED = 'estimated', - /** Validated through specific, controlled scientific experiments */ + /** Validated through specific, controlled scientific experiments. */ EXPERIMENTAL = 'experimental', - /** Based on theoretical physics or chemical principles without empirical validation */ + /** Based on theoretical physics or chemical principles without empirical validation. */ THEORETICAL = 'theoretical' }; @@ -42,17 +42,17 @@ export enum ValueConfidence { * Structural classification for a variant of a substance; see allotropes. */ export enum FormType { - /** Elemental variants in the same physical state (e.g., Diamond vs Graphite) */ + /** Elemental variants in the same physical state (e.g., Diamond vs Graphite). */ ALLOTROPE = 'allotrope', - /** Based on the connectivity or arrangement of atoms in a molecule */ + /** Based on the connectivity or arrangement of atoms in a molecule. */ MOLECULAR = 'molecular', - /** Corresponding to a specific state of matter (Solid, Liquid, Gas) */ + /** Corresponding to a specific state of matter (Solid, Liquid, Gas). */ PHASE = 'phase', - /** Solid crystalline forms of the same compound (e.g., Quartz vs Cristobalite) */ + /** Solid crystalline forms of the same compound (e.g., Quartz vs Cristobalite). */ POLYMORPH = 'polymorph', - /** Non-crystalline solid lacking long-range atomic order */ + /** Non-crystalline solid lacking long-range atomic order. */ AMORPHOUS = 'amorphous', - /** Categorized into a non-standard or miscellaneous structural type */ + /** Categorized into a non-standard or miscellaneous structural type. */ OTHER = 'other' }; @@ -60,15 +60,15 @@ export enum FormType { * Systems of units used to represent physical quantities. */ export enum MetricSystem { - /** The International System of Units (SI) or its variants */ + /** The International System of Units (SI) or its variants. */ METRIC = 'metric', - /** Historical system used primarily in the UK */ + /** Historical system used primarily in the UK. */ IMPERIAL = 'imperial', - /** Customary system used in the United States */ + /** Customary system used in the United States. */ US = 'us', - /** Non-standard or application-specific unit set */ + /** Non-standard or application-specific unit set. */ CUSTOM = 'custom', - /** System of measurement is not specified or recognized */ + /** System of measurement is not specified or recognized. */ UNKNOWN = 'unknown' }; @@ -76,19 +76,19 @@ export enum MetricSystem { * Fundamental dimensions of the International System of Units (SI). */ export enum SIDimension { - /** Physical dimension of temporal duration */ + /** Physical dimension of temporal duration. */ TIME = 'time', - /** Physical dimension of distance or spatial extent */ + /** Physical dimension of distance or spatial extent. */ LENGTH = 'length', - /** Physical dimension of inertia and gravitational attraction */ + /** Physical dimension of inertia and gravitational attraction. */ MASS = 'mass', - /** Rate of flow of electric charge */ + /** Rate of flow of electric charge. */ ELECTRIC_CURRENT = 'electricCurrent', - /** Degree of thermal energy in a system */ + /** Degree of thermal energy in a system. */ TEMPERATURE = 'temperature', - /** Number of elementary entities in a sample */ + /** Number of elementary entities in a sample. */ AMOUNT_OF_SUBSTANCE = 'amountOfSubstance', - /** Power emitted by a light source in a particular direction */ + /** Power emitted by a light source in a particular direction. */ LUMINOUS_INTENSITY = 'luminousIntensity' }; @@ -96,37 +96,37 @@ export enum SIDimension { * Standard conditions for temperature and pressure in scientific measurements. */ export enum StandardCondition { - /** T=0°C (273.15K); P=100kPa (1 bar). IUPAC standard since 1982 */ + /** T=0°C (273.15K); P=100kPa (1 bar). IUPAC standard since 1982. */ STP = 'STP', - /** T=0°C; P=101.325kPa (1 atm). Older NIST and ISO standard */ + /** T=0°C; P=101.325kPa (1 atm). Older NIST and ISO standard. */ STP_ATM = 'STP_ATM', - /** T=20°C; P=101.325kPa. EPA and NIST standard conditions */ + /** T=20°C; P=101.325kPa. EPA and NIST standard conditions. */ NTP = 'NTP', - /** T=15°C; P=101.325kPa. International Standard Atmosphere */ + /** T=15°C; P=101.325kPa. International Standard Atmosphere. */ ISA = 'ISA', - /** T=22°C; P=101.325kPa. Medical physics standard (AAPM) */ + /** T=22°C; P=101.325kPa. Medical physics standard (AAPM). */ AAPM = 'AAPM', - /** T=25°C; P=101.325kPa. Standard Ambient Temperature and Pressure */ + /** T=25°C; P=101.325kPa. Standard Ambient Temperature and Pressure. */ SATP = 'SATP', - /** T=20°C; P=100kPa. Compressed Air and Gas Institute standard */ + /** T=20°C; P=100kPa. Compressed Air and Gas Institute standard. */ CAGI = 'CAGI', - /** T=15°C; P=100kPa. Society of Petroleum Engineers standard */ + /** T=15°C; P=100kPa. Society of Petroleum Engineers standard. */ SPE = 'SPE', - /** T=20°C; P=101.3kPa. ISO internal combustion engine standard */ + /** T=20°C; P=101.3kPa. ISO internal combustion engine standard. */ ISO_5011 = 'ISO_5011', - /** T=20°C; P=101.33kPa. Former Soviet Union GOST standard */ + /** T=20°C; P=101.33kPa. Former Soviet Union GOST standard. */ GOST_2939_63 = 'GOST_2939_63', - /** T=15.56°C (60°F); P=101.6kPa. Energy-related industrial standard */ + /** T=15.56°C (60°F); P=101.6kPa. Energy-related industrial standard. */ EGIA = 'EGIA', - /** T=15.56°C; P=101.35kPa. U.S. Department of Transportation standard */ + /** T=15.56°C; P=101.35kPa. U.S. Department of Transportation standard. */ SCF = 'SCF', - /** T=21.11°C (70°F); P=101.3kPa. Air Movement and Control Association */ + /** T=21.11°C (70°F); P=101.3kPa. Air Movement and Control Association. */ AMCA = 'AMCA', - /** T=15°C; P=101.3kPa. Federal Aviation Administration standard */ + /** T=15°C; P=101.3kPa. Federal Aviation Administration standard. */ FAA = 'FAA', - /** T=15°C; P=101.325kPa. Standard reference for natural gas (ISO) */ + /** T=15°C; P=101.325kPa. Standard reference for natural gas (ISO). */ ISO_13443 = 'ISO_13443', - /** T=0°C; P=101.325kPa. Industrial standard from DIN 1343 */ + /** T=0°C; P=101.325kPa. Industrial standard from DIN 1343. */ DIN_1343 = 'DIN_1343' }; @@ -134,11 +134,11 @@ export enum StandardCondition { * Types of statistical or measurement errors associated with data points. */ export enum UncertaintyType { - /** Expressed in the same units as the measurement itself */ + /** Expressed in the same units as the measurement itself. */ ABSOLUTE = 'absolute', - /** Expressed as a ratio or percentage of the measured value */ + /** Expressed as a ratio or percentage of the measured value. */ RELATIVE = 'relative', - /** Upper and lower bounds are not equidistant from the mean value */ + /** Upper and lower bounds are not equidistant from the mean value. */ ASYMMETRICAL = 'asymmetrical' }; @@ -146,35 +146,35 @@ export enum UncertaintyType { * Classification of bibliographic references and data sources based on BibTeX. */ export enum ReferenceType { - /** Peer-reviewed paper in a scientific journal */ + /** Peer-reviewed paper in a scientific journal. */ ARTICLE = 'article', - /** Complete published work on a specific subject */ + /** Complete published work on a specific subject. */ BOOK = 'book', - /** Small, unbound publication or pamphlet */ + /** Small, unbound publication or pamphlet. */ BOOKLET = 'booklet', - /** Paper presented at a professional meeting or symposium */ + /** Paper presented at a professional meeting or symposium. */ CONFERENCE = 'conference', - /** Specific section or chapter within a book */ + /** Specific section or chapter within a book. */ INBOOK = 'inbook', - /** Article within a collection edited by others */ + /** Article within a collection edited by others. */ INCOLLECTION = 'incollection', - /** Full transcript or record of a conference */ + /** Full transcript or record of a conference. */ INPROCEEDINGS = 'inproceedings', - /** Technical documentation or user guide */ + /** Technical documentation or user guide. */ MANUAL = 'manual', - /** Academic work for a Master's degree */ + /** Academic work for a Master's degree. */ MASTERSTHESIS = 'mastersthesis', - /** General classification for academic dissertations */ + /** General classification for academic dissertations. */ THESIS = 'thesis', - /** Fallback for sources that do not fit standard categories */ + /** Fallback for sources that do not fit standard categories. */ MISC = 'misc', - /** Academic work for a Doctor of Philosophy degree */ + /** Academic work for a Doctor of Philosophy degree. */ PHDTHESIS = 'phdthesis', - /** Published minutes or records of a scientific meeting */ + /** Published minutes or records of a scientific meeting. */ PROCEEDINGS = 'proceedings', - /** Formal report on research or technical developments */ + /** Formal report on research or technical developments. */ TECHREPORT = 'techreport', - /** Document that has not yet been formally published */ + /** Document that has not yet been formally published. */ UNPUBLISHED = 'unpublished' }; @@ -182,13 +182,13 @@ export enum ReferenceType { * Standard digital image encodings supported for visual assets. */ export enum ImageFormat { - /** Compressed photographic format with lossy encoding */ + /** Compressed photographic format with lossy encoding. */ JPG = 'jpg', - /** Lossless raster format with transparency support */ + /** Lossless raster format with transparency support. */ PNG = 'png', - /** Vector format based on XML for resolution-independent graphics */ + /** Vector format based on XML for resolution-independent graphics. */ SVG = 'svg', - /** Modern high-performance container for lossy and lossless images */ + /** Modern high-performance container for lossy and lossless images. */ WEBP = 'webp' }; @@ -196,15 +196,15 @@ export enum ImageFormat { * Chemical and spatial file formats for 3D molecular structures. */ export enum D3Format { - /** Protein Data Bank format for three-dimensional structures */ + /** Protein Data Bank format for three-dimensional structures. */ PDB = 'pdb', - /** MDL Molfile format for chemical bonding and structure */ + /** MDL Molfile format for chemical bonding and structure. */ MOL = 'mol', - /** Structure-Data File for handling chemical data sets */ + /** Structure-Data File for handling chemical data sets. */ SDF = 'sdf', - /** Simple Cartesian coordinates for atomic positions */ + /** Simple Cartesian coordinates for atomic positions. */ XYZ = 'xyz', - /** Crystallographic Information File for crystal structures */ + /** Crystallographic Information File for crystal structures. */ CIF = 'cif' }; diff --git a/types/abstract/collection.ts b/types/abstract/collection.ts index 4f15c9e5..3e9d3322 100644 --- a/types/abstract/collection.ts +++ b/types/abstract/collection.ts @@ -32,17 +32,17 @@ export type Group< T extends Record< string, Single< Property > | Distinct< unkn * @template T The type to be processed into a collection value. */ type CollectionValue< T > = - /** If it's a single property or array of properties, return the base property type */ + /** If it's a single property or array of properties, return the base property type. */ [ T ] extends [ Single< infer P > ] ? P : - /** If it's a group, recurse into the group members */ + /** If it's a group, recurse into the group members. */ [ T ] extends [ Group< infer G > ] ? { [ GK in keyof G ]: Collection< G[ GK ] > } : - /** Direct property match */ + /** Direct property match. */ [ T ] extends [ Property ] ? T : - /** Distinct metadata/utility match */ + /** Distinct metadata/utility match. */ [ T ] extends [ Distinct< infer D > ] ? Distinct< D > : - /** Expand any other object structures */ + /** Expand any other object structures. */ [ T ] extends [ object ] ? Expand< T > : - /** Fallback for primitives */ + /** Fallback for primitives. */ T; /** @@ -50,6 +50,6 @@ type CollectionValue< T > = * @template T The definition structure of the collection. */ export type Collection< T > = { - /** Map each key of the definition to its resolved collection value */ + /** Map each key of the definition to its resolved collection value. */ [ K in keyof T ]: CollectionValue< T[ K ] >; }; diff --git a/types/abstract/condition.ts b/types/abstract/condition.ts index 27c9af51..c38d334e 100644 --- a/types/abstract/condition.ts +++ b/types/abstract/condition.ts @@ -20,7 +20,7 @@ export type Conditions< Q extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > = - /** Predefined environmental standards (e.g., StandardCondition.STP) */ + /** Predefined environmental standards (e.g., StandardCondition.STP). */ | StandardCondition - /** A dictionary mapping specific physical quantities to their measured values during the experiment */ + /** A dictionary mapping specific physical quantities to their measured values during the experiment. */ | { [ K in Q ]?: Value< K, T > }; diff --git a/types/abstract/form.ts b/types/abstract/form.ts index 676b21ff..b139030d 100644 --- a/types/abstract/form.ts +++ b/types/abstract/form.ts @@ -18,9 +18,9 @@ import type { Collection, Distinct } from './collection'; * @template C The collection of scientific properties applicable to this form. */ type BaseForm< T extends FormType, C extends Collection< any > > = Brand< { - /** Partial override of properties specific to this physical form */ + /** Partial override of properties specific to this physical form. */ properties?: DeepPartial< C >; - /** Descriptive note clarifying the nature or source of this specific form */ + /** Descriptive note clarifying the nature or source of this specific form. */ note?: Distinct< string >; }, T, 'type', true >; @@ -28,9 +28,9 @@ type BaseForm< T extends FormType, C extends Collection< any > > = Brand< { * Common descriptive fields for chemical forms. */ interface FormFields { - /** Specific chemical or structural formula for the form */ + /** Specific chemical or structural formula for the form. */ formula?: Distinct< string >; - /** The primary physical state (solid, liquid, gas, plasma) of this form */ + /** The primary physical state (solid, liquid, gas, plasma) of this form. */ phase?: Distinct< Phase >; } @@ -78,7 +78,7 @@ export type FormId = Brand< string, 'formId' >; * @template C The base property collection for the substance. */ export type FormCollection< C extends Collection< any > > = Record< FormId, Collection< - /** Mapping to one of the supported physical form representations */ + /** Mapping to one of the supported physical form representations. */ | AllotropeForm< C > | MolecularForm< C > | PhaseForm< C > diff --git a/types/abstract/property.ts b/types/abstract/property.ts index b588782a..b37040bf 100644 --- a/types/abstract/property.ts +++ b/types/abstract/property.ts @@ -21,9 +21,9 @@ interface BaseProperty< C extends PhysicalQuantity = PhysicalQuantity, T extends Primitive = Primitive > { - /** The state of environment (Temp, Press, etc.) during measurement */ + /** The state of environment (Temp, Press, etc.) during measurement. */ conditions?: Conditions< C, T >; - /** Array of reference IDs pointing to the data source */ + /** Array of reference IDs pointing to the data source. */ references?: RefId[]; } diff --git a/types/abstract/reference.ts b/types/abstract/reference.ts index 9eb89a9c..9f9ef800 100644 --- a/types/abstract/reference.ts +++ b/types/abstract/reference.ts @@ -14,11 +14,11 @@ import type { ReferenceType } from '../../enum/util'; * @template T The classification of the reference (Article, Book, etc.). */ type BaseReference< T extends ReferenceType > = Brand< { - /** ISO 8601 date when the source was last accessed (crucial for web resources) */ + /** ISO 8601 date when the source was last accessed (crucial for web resources). */ accessed?: string; - /** Direct link to the source material */ + /** Direct link to the source material. */ url?: string; - /** Digital Object Identifier - the unique permanent identifier for scholarly work */ + /** Digital Object Identifier - the unique permanent identifier for scholarly work. */ doi?: string; }, T, 'type', true >; @@ -26,49 +26,49 @@ type BaseReference< T extends ReferenceType > = Brand< { * Collection of standard BibTeX fields for academic citations. */ interface BibTeXFields { - /** Physical or electronic address of the publisher or institution */ + /** Physical or electronic address of the publisher or institution. */ address?: string; - /** Primary creator(s) of the work */ + /** Primary creator(s) of the work. */ author?: string | string[]; - /** Title of the book when the reference is a chapter or paper within it */ + /** Title of the book when the reference is a chapter or paper within it. */ booktitle?: string; - /** Specific chapter number within a larger work */ + /** Specific chapter number within a larger work. */ chapter?: string; - /** Version or edition of the publication (e.g., "3rd ed.") */ + /** Version or edition of the publication (e.g., "3rd ed."). */ edition?: string; - /** Person(s) responsible for assembling the collection or volume */ + /** Person(s) responsible for assembling the collection or volume. */ editor?: string | string[]; - /** Alternative publication method for non-traditional sources */ + /** Alternative publication method for non-traditional sources. */ howpublished?: string; - /** Official entity sponsoring a technical report or thesis */ + /** Official entity sponsoring a technical report or thesis. */ institution?: string; - /** International Standard Book Number */ + /** International Standard Book Number. */ isbn?: string; - /** Name of the periodical in which the article was published */ + /** Name of the periodical in which the article was published. */ journal?: string; - /** Month of publication */ + /** Month of publication. */ month?: string; - /** Unstructured supplemental information or remarks */ + /** Unstructured supplemental information or remarks. */ note?: string; - /** Issue number within a volume */ + /** Issue number within a volume. */ number?: number | string; - /** Sponsoring organization for proceedings or manuals */ + /** Sponsoring organization for proceedings or manuals. */ organization?: string; - /** Page numbers or physical extent (e.g., "123--145") */ + /** Page numbers or physical extent (e.g., "123--145"). */ pages?: number | string; - /** Entity responsible for the distribution of the work */ + /** Entity responsible for the distribution of the work. */ publisher?: string; - /** Categorization of technical documents (e.g., "Research Memo") */ + /** Categorization of technical documents (e.g., "Research Memo"). */ reportType?: string; - /** The larger collection or series a book belongs to */ + /** The larger collection or series a book belongs to. */ series?: string; - /** Academic institution where a thesis was defended */ + /** Academic institution where a thesis was defended. */ school?: string; - /** The full title of the cited work */ + /** The full title of the cited work. */ title?: string; - /** Numerical volume of a journal or multi-volume book */ + /** Numerical volume of a journal or multi-volume book. */ volume?: number | string; - /** Year of publication */ + /** Year of publication. */ year?: number | string; } @@ -79,9 +79,9 @@ interface BibTeXFields { * @template T The specific thesis reference type. */ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | ReferenceType.PHDTHESIS > = Expand< - /** Base reference metadata */ + /** Base reference metadata. */ BaseReference< T > & - /** Specific BibTeX fields for theses */ + /** Specific BibTeX fields for theses. */ StrictSubset< BibTeXFields, 'author' | 'school' | 'title' | 'year', @@ -96,9 +96,9 @@ type Thesis< T extends ReferenceType.MASTERSTHESIS | ReferenceType.THESIS | Refe * @template T The specific conference reference type. */ type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDINGS > = Expand< - /** Base reference metadata */ + /** Base reference metadata. */ BaseReference< T > & - /** Specific BibTeX fields for conferences */ + /** Specific BibTeX fields for conferences. */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'title' | 'year', @@ -112,9 +112,9 @@ type Conference< T extends ReferenceType.CONFERENCE | ReferenceType.INPROCEEDING * - Optional: month, note, number, pages, volume */ export type ArticleReference = Expand< - /** Extends base reference with Article type branding */ + /** Extends base reference with Article type branding. */ BaseReference< ReferenceType.ARTICLE > & - /** Specific BibTeX fields for articles */ + /** Specific BibTeX fields for articles. */ StrictSubset< BibTeXFields, 'author' | 'journal' | 'title' | 'year', @@ -129,9 +129,9 @@ export type ArticleReference = Expand< * - Optional: address, edition, isbn, month, note, number, series, volume */ export type BookReference = Expand< - /** Extends base reference with Book type branding */ + /** Extends base reference with Book type branding. */ BaseReference< ReferenceType.BOOK > & - /** Specific BibTeX fields for books */ + /** Specific BibTeX fields for books. */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & StrictSubset< BibTeXFields, @@ -146,9 +146,9 @@ export type BookReference = Expand< * - Optional: address, author, howpublished, month, note, year */ export type BookletReference = Expand< - /** Extends base reference with Booklet type branding */ + /** Extends base reference with Booklet type branding. */ BaseReference< ReferenceType.BOOKLET > & - /** Specific BibTeX fields for booklets */ + /** Specific BibTeX fields for booklets. */ StrictSubset< BibTeXFields, 'title', @@ -171,9 +171,9 @@ export type ConferenceReference = Conference< ReferenceType.CONFERENCE >; * - Optional: address, edition, month, note, number, reportType, series, volume */ export type InbookReference = Expand< - /** Extends base reference with Inbook type branding */ + /** Extends base reference with Inbook type branding. */ BaseReference< ReferenceType.INBOOK > & - /** Specific BibTeX fields for inbooks */ + /** Specific BibTeX fields for inbooks. */ RequireExactlyOneFrom< BibTeXFields, 'author' | 'editor' > & RequireAtLeastOne< StrictSubset< @@ -191,9 +191,9 @@ export type InbookReference = Expand< * - Optional: address, chapter, edition, editor, month, note, number, pages, reportType, series, volume */ export type IncollectionReference = Expand< - /** Extends base reference with Incollection type branding */ + /** Extends base reference with Incollection type branding. */ BaseReference< ReferenceType.INCOLLECTION > & - /** Specific BibTeX fields for incollections */ + /** Specific BibTeX fields for incollections. */ StrictSubset< BibTeXFields, 'author' | 'booktitle' | 'publisher' | 'title' | 'year', @@ -212,9 +212,9 @@ export type InproceedingsReference = Conference< ReferenceType.INPROCEEDINGS >; * - Optional: address, author, edition, month, note, organization, year */ export type ManualReference = Expand< - /** Extends base reference with Manual type branding */ + /** Extends base reference with Manual type branding. */ BaseReference< ReferenceType.MANUAL > & - /** Specific BibTeX fields for manuals */ + /** Specific BibTeX fields for manuals. */ StrictSubset< BibTeXFields, 'title', @@ -242,9 +242,9 @@ export type ThesisReference = Thesis< ReferenceType.THESIS >; * - Optional: author, howpublished, month, note, year */ export type MiscReference = Expand< - /** Extends base reference with Misc type branding */ + /** Extends base reference with Misc type branding. */ BaseReference< ReferenceType.MISC > & - /** Specific BibTeX fields for misc */ + /** Specific BibTeX fields for misc. */ ExtractFrom< BibTeXFields, 'author' | 'howpublished' | 'month' | 'note' | 'title' | 'year' @@ -264,9 +264,9 @@ export type PhdthesisReference = Thesis< ReferenceType.PHDTHESIS >; * - Optional: address, editor, month, note, number, organization, publisher, series, volume */ export type ProceedingsReference = Expand< - /** Extends base reference with Proceedings type branding */ + /** Extends base reference with Proceedings type branding. */ BaseReference< ReferenceType.PROCEEDINGS > & - /** Specific BibTeX fields for proceedings */ + /** Specific BibTeX fields for proceedings. */ StrictSubset< BibTeXFields, 'title' | 'year', @@ -280,9 +280,9 @@ export type ProceedingsReference = Expand< * - Optional: address, month, note, number, reportType */ export type TechreportReference = Expand< - /** Extends base reference with Techreport type branding */ + /** Extends base reference with Techreport type branding. */ BaseReference< ReferenceType.TECHREPORT > & - /** Specific BibTeX fields for techreports */ + /** Specific BibTeX fields for techreports. */ StrictSubset< BibTeXFields, 'author' | 'institution' | 'title' | 'year', @@ -296,9 +296,9 @@ export type TechreportReference = Expand< * - Optional: month, year */ export type UnpublishedReference = Expand< - /** Extends base reference with Unpublished type branding */ + /** Extends base reference with Unpublished type branding. */ BaseReference< ReferenceType.UNPUBLISHED > & - /** Specific BibTeX fields for unpublished */ + /** Specific BibTeX fields for unpublished. */ StrictSubset< BibTeXFields, 'author' | 'note' | 'title', diff --git a/types/abstract/uncertainty.ts b/types/abstract/uncertainty.ts index a25bae62..731cb700 100644 --- a/types/abstract/uncertainty.ts +++ b/types/abstract/uncertainty.ts @@ -14,9 +14,9 @@ import type { UncertaintyType } from '../../enum/util'; * @template T The specific type of uncertainty (absolute, relative, or asymmetrical). */ type BaseUncertainty< T extends UncertaintyType > = Brand< { - /** The statistical confidence level (e.g., 0.95 for a 95% confidence interval) */ + /** The statistical confidence level (e.g., 0.95 for a 95% confidence interval). */ confidence?: number; - /** Additional scientific notes regarding the measurement error or calculation method */ + /** Additional scientific notes regarding the measurement error or calculation method. */ note?: string; }, T, 'type', true >; @@ -24,13 +24,13 @@ type BaseUncertainty< T extends UncertaintyType > = Brand< { * Common fields used across different uncertainty models. */ interface UncertaintyFields { - /** The constant value of the error in the same unit as the measurement */ + /** The constant value of the error in the same unit as the measurement. */ absolute?: number; - /** The fractional error relative to the measurement value (e.g., 0.01 for 1%) */ + /** The fractional error relative to the measurement value (e.g., 0.01 for 1%). */ relative?: number; - /** The positive deviation in asymmetrical error models */ + /** The positive deviation in asymmetrical error models. */ plus?: number; - /** The negative deviation in asymmetrical error models */ + /** The negative deviation in asymmetrical error models. */ minus?: number; } diff --git a/types/abstract/unit.ts b/types/abstract/unit.ts index bec03617..95855814 100644 --- a/types/abstract/unit.ts +++ b/types/abstract/unit.ts @@ -192,9 +192,9 @@ type PrefixableUnitSymbols< Q extends PhysicalQuantity > = ValidUnits[ Q ][ 'pre * @template Q The physical quantity to generate symbols for. */ type PrefixedSymbols< Q extends PhysicalQuantity > = - /** Base unit symbols */ + /** Base unit symbols. */ | BaseUnitSymbols< Q > - /** SI prefixed unit symbols */ + /** SI prefixed unit symbols. */ | `${ SIPrefix }${ PrefixableUnitSymbols< Q > }`; /** @@ -209,19 +209,19 @@ export type DimensionVector = [ number, number, number, number, number, number, * @template U The specific symbol of this unit. */ export type Unit< Q extends PhysicalQuantity, U extends BaseUnitSymbols< Q > > = Brand< { - /** The full human-readable name of the unit (e.g., "meters per second") */ + /** The full human-readable name of the unit (e.g., "meters per second"). */ name?: string; - /** Indicates if this is the fundamental base unit for the system */ + /** Indicates if this is the fundamental base unit for the system. */ isBase?: boolean; - /** Whether this unit can be combined with SI prefixes */ + /** Whether this unit can be combined with SI prefixes. */ prefixable?: U extends PrefixableUnitSymbols< Q > ? true : false; - /** The metric or imperial system this unit originates from */ + /** The metric or imperial system this unit originates from. */ system?: MetricSystem; - /** Factors for converting this unit to the system base unit */ + /** Factors for converting this unit to the system base unit. */ conversion?: { - /** The multiplication factor */ + /** The multiplication factor. */ factor: number; - /** The additive offset (primarily for temperature scales) */ + /** The additive offset (primarily for temperature scales). */ offset?: number; }; }, U, 'symbol', true >; @@ -231,20 +231,20 @@ export type Unit< Q extends PhysicalQuantity, U extends BaseUnitSymbols< Q > > = * @template Q The physical quantity being defined. */ export type Quantity< Q extends PhysicalQuantity > = { - /** The physical dimension of the quantity */ + /** The physical dimension of the quantity. */ dimension?: { - /** The shorthand symbol for the dimension (e.g., "L" for length) */ + /** The shorthand symbol for the dimension (e.g., "L" for length). */ symbol: string; - /** The full name of the dimension (e.g., "length") */ + /** The full name of the dimension (e.g., "length"). */ name: string; - /** Whether this is a fundamental SI base dimension */ + /** Whether this is a fundamental SI base dimension. */ si: Q extends SIDimension ? true : false; - /** The exponents of the base SI dimensions */ + /** The exponents of the base SI dimensions. */ vector: DimensionVector; }; - /** The reference unit symbol for this quantity */ + /** The reference unit symbol for this quantity. */ baseUnit: BaseUnitSymbols< Q >; - /** A collection of all valid units for this quantity */ + /** A collection of all valid units for this quantity. */ units: { [ U in BaseUnitSymbols< Q > ]: Unit< Q, U >; }; diff --git a/types/abstract/util.ts b/types/abstract/util.ts index 0177b844..b1a3d05e 100644 --- a/types/abstract/util.ts +++ b/types/abstract/util.ts @@ -13,13 +13,13 @@ import type { Distinct, Group } from '../abstract/collection'; * This ensures that every high-level entity or collection can be tracked for versioning and integrity. */ export type MetaData = Distinct< { - /** Internal metadata object for administrative tracking */ + /** Internal metadata object for administrative tracking. */ '@metadata': { - /** The version of the schema used for this data object */ + /** The version of the schema used for this data object. */ schemaVersion: 1; - /** ISO 8601 timestamp of the last modification */ + /** ISO 8601 timestamp of the last modification. */ lastModified: string; - /** Cryptographic hash for data integrity verification */ + /** Cryptographic hash for data integrity verification. */ hash: string; }; } >; @@ -31,8 +31,8 @@ export type MetaData = Distinct< { * @template T The type of the value being localized (defaults to string). */ export type LangGroup< L extends LangCode = LangCode.ENGLISH, T = string > = Group< Expand< - /** Mandatory entries for the primary language(s) */ + /** Mandatory entries for the primary language(s). */ Required< { [ K in L ]: Distinct< T > } > & - /** Optional entries for all other supported languages */ + /** Optional entries for all other supported languages. */ Partial< { [ K in Exclude< LangCode, L > ]: Distinct< T > } > > >; diff --git a/types/abstract/value.ts b/types/abstract/value.ts index 618779c0..d11377e1 100644 --- a/types/abstract/value.ts +++ b/types/abstract/value.ts @@ -22,11 +22,11 @@ export type StructType = Record< string | number, unknown >; * @template T The classification of the value (Primitive, Struct, Single, etc.). */ type BaseValue< T extends ValueType > = Brand< { - /** The degree of scientific certainty or validation status of the data */ + /** The degree of scientific certainty or validation status of the data. */ confidence?: ValueConfidence; - /** Experimental or statistical uncertainty associated with the value */ + /** Experimental or statistical uncertainty associated with the value. */ uncertainty?: Uncertainty; - /** Contextual information or remarks regarding the specific value or measurement */ + /** Contextual information or remarks regarding the specific value or measurement. */ note?: string; }, T, 'type', true >; @@ -41,22 +41,22 @@ interface ValueFields< T extends Primitive = Primitive, S extends StructType = StructType > { - /** A single data point */ + /** A single data point. */ value?: T; - /** A collection of discrete data points */ + /** A collection of discrete data points. */ values?: T[]; - /** A continuous range between two boundary conditions */ + /** A continuous range between two boundary conditions. */ range?: RequireAtLeastOne< Record< 'lower' | 'upper', { - /** The boundary value */ + /** The boundary value. */ value: number; - /** Uncertainty specific to this boundary */ + /** Uncertainty specific to this boundary. */ uncertainty?: Uncertainty; - /** Whether the boundary value is part of the set */ + /** Whether the boundary value is part of the set. */ inclusive?: boolean; } > >; - /** The unit identification for physical quantities */ + /** The unit identification for physical quantities. */ unit?: UnitId< Q >; - /** Structured object for complex data sets */ + /** Structured object for complex data sets. */ struct?: S; } @@ -116,7 +116,7 @@ export type RangeValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand */ export type CoupledNumberValue< Q extends PhysicalQuantity = PhysicalQuantity > = Expand< BaseValue< ValueType.COUPLED > & { - /** A mapping of quantities to their respective single, array, or range values */ + /** A mapping of quantities to their respective single, array, or range values. */ properties: RequireAtLeastOne< { [ K in Q ]?: | SingleValue< K > @@ -138,7 +138,7 @@ export type CoupledValue< S extends StructType = StructType > = Expand< BaseValue< ValueType.COUPLED > & { - /** A registry of various value types grouped under a single coupled entity */ + /** A registry of various value types grouped under a single coupled entity. */ properties: RequireAtLeastOne< { [ K in Q ]?: | PrimitiveValue< T > From ce8b1dff3f6300f8d1769e3c088a3d9645c38b9b Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 14:34:45 +0200 Subject: [PATCH 33/53] Update abundance.ts --- types/collection/abundance.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/types/collection/abundance.ts b/types/collection/abundance.ts index 10d09eb2..1958b395 100644 --- a/types/collection/abundance.ts +++ b/types/collection/abundance.ts @@ -1,23 +1,46 @@ +/** + * @file abundance.ts + * @description Defines the abundance of chemical elements and substances across various environments. + * This collection captures the relative presence of matter in the universe, solar system, + * Earth's layers, and biological systems. + */ + import type { NaturalOccurrence } from '../../enum/element'; import type { Collection, Single } from '../abstract/collection'; import type { NumberProperty, PrimitiveProperty } from '../abstract/property'; +/** + * Registry of environmental and geological occurrences. + */ export type AbundanceCollection = Collection< { + /** The primary classification of how a substance exists or is formed on Earth. */ naturalOccurrence?: Single< PrimitiveProperty< NaturalOccurrence > >; + /** The estimated mass or molar fraction of the substance in the observable universe. */ universeAbundance?: Single< NumberProperty< 'quantity' > >; + /** The estimated concentration of the substance within the entirety of the solar system. */ solarSystemAbundance?: Single< NumberProperty< 'quantity' > >; + /** The concentration of the substance found in the Sun's photosphere or corona. */ sunAbundance?: Single< NumberProperty< 'quantity' > >; + /** The characteristic concentration of the substance found in CI chondrite meteorites. */ meteoriteAbundance?: Single< NumberProperty< 'quantity' > >; + /** The average mass fraction of the substance found in the Earth's continental crust. */ crustalAbundance?: Single< NumberProperty< 'quantity' > >; + /** The average concentration of the substance within the global oceanic volume. */ oceanAbundance?: Single< NumberProperty< 'quantity' > >; + /** The typical concentration of the substance found specifically in seawater. */ seaAbundance?: Single< NumberProperty< 'quantity' > >; + /** The concentration of the substance found in terrestrial freshwater streams. */ streamAbundance?: Single< NumberProperty< 'quantity' > >; + /** The volume or mass fraction of the substance within the planetary atmosphere. */ atmosphereAbundance?: Single< NumberProperty< 'quantity' > >; + /** The average mass percentage of the substance found within the human body. */ humanAbundance?: Single< NumberProperty< 'quantity' > >; + /** The relative typical concentration of the substance found in the Earth's mineralogy. */ mineralAbundance?: Single< NumberProperty< 'quantity' > >; + /** The concentration of the substance in economically exploitable geological formations. */ oreAbundance?: Single< NumberProperty< 'quantity' > >; } >; From 2e0b1ed2a67d0a48894e9073b197c9b8c2f64482 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 14:44:13 +0200 Subject: [PATCH 34/53] rework atomics collection --- types/collection/atomics.ts | 44 ++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/types/collection/atomics.ts b/types/collection/atomics.ts index d8b3b91c..f4645702 100644 --- a/types/collection/atomics.ts +++ b/types/collection/atomics.ts @@ -1,49 +1,87 @@ +/** + * @file atomics.ts + * @description Defines atomic-level properties including nuclear structure, electron configuration, and elemental radii. + * This collection serves as the foundation for elemental classification and atomic behavior. + */ + import type { ShellModel } from '../../enum/element'; import type { Collection, Group, Single } from '../abstract/collection'; import type { ArrayProperty, NumberProperty, PrimitiveProperty, StructProperty } from '../abstract/property'; +/** + * Registry of properties defining the internal structure and behavior of an atom. + */ export type AtomicsCollection = Collection< { + /** The total number of protons found in the nucleus of an atom. */ atomicNumber?: Single< PrimitiveProperty< number > >; + /** The total count of protons and neutrons within the atomic nucleus. */ massNumber?: Single< PrimitiveProperty< number > >; + /** The specific distribution of electrons among the various atomic orbitals (e.g., "[Xe] 4f14 5d10 6s1"). */ electronConfig?: Single< PrimitiveProperty< string > >; + /** The number of electrons in the outermost shell that participate in chemical bonding. */ valenceElectrons?: Single< PrimitiveProperty< number > >; - shellModel?: Single< StructProperty< { - [ K in ShellModel ]: number; - } > >; + /** The count of electrons residing within each principal energy level (K, L, M, etc.). */ + shellModel?: Single< StructProperty< { [ K in ShellModel ]: number } > >; + /** The cumulative energy required to remove successive electrons from a neutral atom in the gas phase. */ ionizationEnergies?: Single< ArrayProperty< 'energy' > >; + /** Grouping of properties related to the physical mass of the atom or nuclide. */ mass?: Group< { + /** The actual mass of a single atom, typically expressed in unified atomic mass units (u). */ atomicMass?: Single< NumberProperty< 'mass' > >; + /** The weighted average mass of an element's isotopes relative to 1/12th the mass of carbon-12. */ standardAtomicWeight?: Single< PrimitiveProperty< number > >; + /** The ratio of the average atomic mass of a sample to the atomic mass constant. */ relativeAtomicMass?: Single< PrimitiveProperty< number > >; + /** The difference between the actual atomic mass and the mass number, expressed in energy units. */ massExcess?: Single< NumberProperty< 'energy' > >; } >; + /** Grouping of properties defining the spatial extent and radii of the atom. */ radius?: Group< { + /** The observed or experimental distance from the nucleus to the outermost electron shell. */ empiricalRadius?: Single< NumberProperty< 'length' > >; + /** The theoretically derived size of an atom based on quantum mechanical wave functions. */ calculatedRadius?: Single< NumberProperty< 'length' > >; + /** Half the distance between the nuclei of two identical atoms joined by a single covalent bond. */ covalentRadius?: Single< NumberProperty< 'length' > >; + /** The Van der Waals radius of an atom (the distance between the nuclei of two non-bonded atoms). */ vdwRadius?: Single< NumberProperty< 'length' > >; } >; + /** Grouping of properties defining the electrical state and shielding of the nucleus. */ charge?: Group< { + /** The net positive charge of the nucleus, determined by the number of protons. */ nuclearCharge: Single< PrimitiveProperty< number > >; + /** The net positive charge experienced by a valence electron after accounting for shielding by inner electrons. */ effectiveCharge: Single< PrimitiveProperty< number > >; } >; + /** Grouping of various scales for measuring an atom's tendency to attract bonding electrons. */ electronegativity?: Group< { + /** The original dimensionless scale based on bond-dissociation energies. */ pauling?: Single< PrimitiveProperty< number > >; + /** A scale based on the relative stability of atomic volumes. */ sanderson?: Single< PrimitiveProperty< number > >; + /** A scale based on the electrostatic force exerted by the nucleus on valence electrons. */ allredRochow?: Single< PrimitiveProperty< number > >; + /** The arithmetic mean of the first ionization energy and electron affinity. */ mulliken?: Single< PrimitiveProperty< number > >; + /** A scale based on the average one-electron energy of valence shell electrons. */ allen?: Single< PrimitiveProperty< number > >; + /** A modern scale incorporating shell-wise screening and orbital energy. */ ghoshGupta?: Single< NumberProperty< 'energy' > >; + /** A scale related to the polarizability and valence state of the atom. */ nagle?: Single< PrimitiveProperty< number > >; + /** A measure of chemical hardness and absolute electronegativity. */ pearson?: Single< NumberProperty< 'energy' > >; + /** A scale based on effective nuclear charge and atomic radii. */ martynov?: Single< PrimitiveProperty< number > >; + /** A scale derived from the spectroscopic properties of atoms. */ gordy?: Single< PrimitiveProperty< number > >; + /** A scale based on the average binding energy of valence electrons. */ rahm?: Single< NumberProperty< 'energy' > >; } >; } >; From 14a6c847bc8d29cf0d22def08229a75c515e53c4 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 14:53:09 +0200 Subject: [PATCH 35/53] Update chemistry.ts --- types/collection/chemistry.ts | 62 ++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/types/collection/chemistry.ts b/types/collection/chemistry.ts index 3cf05b89..be9e4a60 100644 --- a/types/collection/chemistry.ts +++ b/types/collection/chemistry.ts @@ -1,3 +1,9 @@ +/** + * @file chemistry.ts + * @description Defines macroscopic and molecular chemical properties, including thermodynamics, + * electrochemistry, solubility, and molecular geometry. + */ + import type { AcidBaseCharacter, BasicityType, BondType, Goldschmidt, HSAB, Hybridization, LewisModel, MolecularShape, OxideCharacter, SolubilityQualifier @@ -5,60 +11,108 @@ import type { import type { Collection, Group, Single } from '../abstract/collection'; import type { NumberProperty, PrimitiveProperty } from '../abstract/property'; +/** + * Registry of chemical properties describing the reactivity, structure, and energetics of substances. + */ export type ChemistryCollection = Collection< { - molarMass?: Single< NumberProperty< 'mass' > >; - molarVolume?: Single< NumberProperty< 'length' > >; + /** The mass of one mole of the substance, typically in g/mol. */ + molarMass?: Single< NumberProperty< 'molarMass' > >; + /** The volume occupied by one mole of the substance under specific conditions. */ + molarVolume?: Single< NumberProperty< 'molarVolume' > >; + /** The entropy of one mole of a pure substance at a standard state of 1 bar. */ standardMolarEntropy?: Single< NumberProperty< 'entropy' > >; - formulaMass?: Single< NumberProperty< 'mass' > >; + /** The sum of the atomic weights of all atoms in a molecule's formula (also named formula mass). */ + molecularMass?: Single< NumberProperty< 'mass' > >; + /** The ratio of the average mass of molecules of a substance to one-twelfth the mass of an atom of carbon-12. */ + relativeMolecularMass?: Single< PrimitiveProperty< number > >; + /** Grouping of properties related to the proton-donor or acceptor behavior. */ basicity?: Group< { + /** The classification of a substance's ability to accept protons. */ basicityType?: Single< PrimitiveProperty< BasicityType > >; + /** The overall nature of a substance in acid-base reactions (acidic, basic, amphoteric). */ acidBaseCharacter?: Single< PrimitiveProperty< AcidBaseCharacter > >; + /** The negative logarithm of the acid dissociation constant. */ pKa?: Single< PrimitiveProperty< number > >; + /** The negative logarithm of the base dissociation constant. */ pKb?: Single< PrimitiveProperty< number > >; + /** The measure of acidity or basicity of an aqueous solution. */ pH?: Single< PrimitiveProperty< number > >; + /** The pH at which a particular molecule carries no net electrical charge. */ isoelectricPoint?: Single< PrimitiveProperty< number > >; + /** The classification based on the ability to accept or donate electron pairs. */ lewisAcidity?: Single< PrimitiveProperty< LewisModel > >; + /** The classification based on the ability to donate electron pairs. */ lewisBasicity?: Single< PrimitiveProperty< LewisModel > >; + /** The classification of elements based on their preferred natural host phases. */ goldschmidt?: Single< PrimitiveProperty< Goldschmidt > >; + /** The Hard and Soft Acids and Bases classification of chemical species. */ hsab?: Single< PrimitiveProperty< HSAB > >; } >; + /** Grouping of properties related to the loss or gain of electrons. */ oxidation?: Group< { + /** The formal charge an atom would have if all bonds were ionic. */ oxidationStates?: Single< PrimitiveProperty< string > >; + /** The acidic or basic behavior of an element's oxide. */ oxideCharacter?: Single< PrimitiveProperty< OxideCharacter > >; } >; + /** Grouping of properties related to the relationship between electricity and chemical change. */ electrochemistry?: Group< { + /** The electromotive force of a cell under standard conditions. */ standardPotential?: Single< NumberProperty< 'electricPotential' > >; + /** The potential of a reduction half-reaction under standard conditions. */ standardReductionPotential?: Single< NumberProperty< 'electricPotential' > >; + /** The potential of an oxidation half-reaction under standard conditions. */ standardOxidationPotential?: Single< NumberProperty< 'electricPotential' > >; + /** The potential difference between a redox event's equilibrium potential and the actual applied potential. */ overpotential?: Single< NumberProperty< 'electricPotential' > >; + /** The mass of a substance altered by one ampere-second of electric current. */ electrochemicalEquivalent?: Single< NumberProperty< 'mass' > >; } >; + /** Grouping of thermodynamic energy state functions. */ thermochemistry?: Group< { + /** The maximum amount of non-expansion work that can be extracted from a closed system. */ standardGibbsEnergy?: Single< NumberProperty< 'energy' > >; + /** The energy required to break a molecule into its constituent atoms. */ bindingEnergy?: Single< NumberProperty< 'energy' > >; } >; + /** Grouping of properties describing the ability of a substance to dissolve in a solvent. */ solubility?: Group< { + /** A qualitative descriptor of a substance's capacity to dissolve. */ quantifier?: Single< PrimitiveProperty< SolubilityQualifier > >; + /** The maximum amount of the substance that will dissolve in water at equilibrium. */ waterSolubility?: Single< NumberProperty< 'concentration' > >; + /** The equilibrium constant for the dissolution of an ionic compound in water. */ solubilityProduct?: Single< PrimitiveProperty< number > >; + /** The ratio of the concentration of a gas in a solution to its partial pressure in the gas phase. */ henryConstant?: Single< PrimitiveProperty< number > >; } >; - molecularGeometry?: Group< { + /** Grouping of properties describing the three-dimensional arrangement of atoms in a molecule. */ + molecularStructure?: Group< { + /** The spatial arrangement of atoms in a molecule and the chemical bonds that hold them together. */ shape?: Single< PrimitiveProperty< MolecularShape > >; + /** The concept of mixing atomic orbitals to form new hybrid orbitals suitable for bonding. */ hybridization?: Single< PrimitiveProperty< Hybridization > >; + /** The number of atoms, groups, or lone pairs surrounding a central atom. */ stericNumber?: Single< PrimitiveProperty< number > >; + /** A pair of valence electrons that are not shared with another atom in a covalent bond. */ lonePairs?: Single< PrimitiveProperty< number > >; + /** The number of atoms or ions immediately surrounding a central atom in a complex or crystal. */ coordinationNumber?: Single< PrimitiveProperty< number > >; + /** The average distance between the nuclei of two bonded atoms. */ bondLength?: Single< NumberProperty< 'length' > >; + /** The angle formed between two adjacent bonds on the same atom. */ bondAngle?: Single< NumberProperty< 'angle' > >; + /** The angle between two planes defined by two sets of three atoms. */ torsionalAngle?: Single< NumberProperty< 'angle' > >; + /** The classification of the chemical connection between atoms (e.g., ionic, covalent). */ bondType?: Single< PrimitiveProperty< BondType > >; + /** A measure of the number of chemical bonds between a pair of atoms. */ bondOrder?: Single< PrimitiveProperty< number > >; } >; } >; From e9d3d9bada5bf8cbb8c65ea13202a0461dd526c9 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 14:57:33 +0200 Subject: [PATCH 36/53] describe safety collection with hazard and tox. data --- types/collection/safety.ts | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/types/collection/safety.ts b/types/collection/safety.ts index 2bd5012d..46c922bb 100644 --- a/types/collection/safety.ts +++ b/types/collection/safety.ts @@ -1,3 +1,9 @@ +/** + * @file safety.ts + * @description Defines properties and classifications for chemical safety, hazard identification, + * and toxicological risks based on international regulatory standards. + */ + import type { ADRClass, DOTClass, GHSClass, GHSPictogram, NFPACode, NFPANotice, SignalWord, ToxicityApplication, ToxicityType, WHMISClass @@ -7,52 +13,101 @@ import type { StructProperty } from '../abstract/property'; import type { RefId } from '../abstract/reference'; import type { RangeValue, SingleValue } from '../abstract/value'; +/** Hazard statements (H-phrases) defined by the GHS. */ export type HStatement = `H${ '2' | '3' | '4' | '5' }${ string }`; +/** Precautionary statements (P-phrases) defined by the GHS. */ export type PStatement = `P${ '1' | '2' | '3' | '4' | '5' }${ string }`; +/** Supplemental hazard information specific to the European Union (EUH-phrases). */ export type EUHStatement = `EUH${ '0' | '2' | '3' | '4' }${ string }`; +/** Kemler Code or Hazard Identification Number for dangerous goods transport. */ export type HazardIdentification = `${ 'X' | '' }${ number }`; +/** Four-digit United Nations number used to identify hazardous substances in commerce. */ export type UNNumber = `${ '0' | '1' | '2' | '3' | '8' | '9' }${ number }`; +/** + * Standard ratings for the NFPA 704 "hazard diamond" used by emergency responders. + */ export type NFPA = { + /** Health hazard rating (0-4). */ health: NFPACode; + /** Flammability rating (0-4). */ fire: NFPACode; + /** Instability/reactivity rating (0-4). */ reactivity: NFPACode; + /** Special hazards like water reactivity or oxidizing properties. */ specific?: NFPANotice; }; +/** + * Grouping of properties related to the immediate physical and health risks of a substance. + */ export type HazardGroup = Group< { + /** Collection of standardized phrases describing the nature and prevention of hazards. */ statements?: Group< { + /** Phrases describing the nature of physical, health, and environmental hazards. */ hazard?: Distinct< HStatement[] >; + /** Phrases describing mandatory measures to minimize or prevent adverse effects. */ precautionary?: Distinct< PStatement[] >; + /** Supplemental hazard statements specific to EU regulatory frameworks. */ eu?: Distinct< EUHStatement[] >; } >; + /** A word used to indicate the relative level of severity of a hazard (e.g., "danger"). */ signalWord?: Distinct< SignalWord >; + /** Graphic elements intended to convey specific information on the hazard concerned. */ pictograms?: Distinct< GHSPictogram[] >; + /** Classification of substances into categories defined by various safety frameworks. */ classes?: Group< { + /** Categories defined by the Globally Harmonized System of Classification and Labelling of Chemicals. */ ghs?: Distinct< GHSClass[] >; + /** Categories defined by the Workplace Hazardous Materials Information System. */ whmis?: Distinct< WHMISClass[] >; + /** Categories defined by the Agreement concerning the International Carriage of Dangerous Goods by Road. */ adr?: Distinct< ADRClass[] >; + /** Categories defined by the U.S. Department of Transportation. */ dot?: Distinct< DOTClass[] >; } >; + /** Transportation labels and identification numbers. */ label?: Distinct< { + /** The Hazard Identification Number. */ hazNo: HazardIdentification; + /** The UN identification number. */ unNo: UNNumber; }[] >; + /** The NFPA 704 fire diamond rating for the substance. */ nfpa?: Distinct< NFPA >; + /** Additional scientific or regulatory remarks concerning the safety profile. */ note?: Distinct< string >; + /** References to safety data sheets (SDS). */ references?: RefId[]; } >; +/** + * Quantitative toxicological metrics for exposure to a substance. + */ export type Toxicity = { + /** The specific toxicological metric being reported (e.g., LD50). */ type: Distinct< ToxicityType >; + /** The biological species upon which the toxicological effect was observed. */ organism: Distinct< string >; + /** The numerical value of the dose or concentration causing the effect. */ value: SingleValue< 'massFraction' > | RangeValue< 'massFraction' >; + /** The route by which the substance entered the body (e.g., oral, dermal). */ application?: Distinct< ToxicityApplication >; + /** The time period over which the exposure or observation occurred. */ duration?: SingleValue< 'time' > | RangeValue< 'time' >; + /** Additional scientific or regulatory remarks concerning the toxicological effect. */ + notes?: Distinct< string >; + /** References to toxicological reports. */ + references?: RefId[]; }; +/** + * Registry of properties defining the safety, transport, and toxicological profile of a substance. + */ export type SafetyCollection = Collection< { + /** Information regarding physical, health, and environmental hazards. */ hazard?: HazardGroup; + /** Detailed metrics describing the harmful effects on living organisms. */ toxicity?: Single< StructProperty< Toxicity > >; } >; From dd0a2ac70fc062bbff45448f9bf3ad1951758a05 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 14:59:21 +0200 Subject: [PATCH 37/53] Update registry.ts --- types/collection/registry.ts | 68 ++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/types/collection/registry.ts b/types/collection/registry.ts index bc9d3b3e..06615881 100644 --- a/types/collection/registry.ts +++ b/types/collection/registry.ts @@ -1,68 +1,132 @@ +/** + * @file registry.ts + * @description Defines cross-references to international chemical databases and structural + * representations used in cheminformatics. + */ + import type { Distinct, Group } from '../abstract/collection'; +/** Chemical Abstracts Service (CAS) Registry Number. */ export type CASNumber = `${number}-${number}-${number}`; +/** PubChem Compound Identification (CID). */ export type PubChemCID = `${number}`; +/** ChemSpider Database Identifier. */ export type ChemSpiderID = `${number}`; +/** Chemical Entities of Biological Interest (ChEBI) ID. */ export type ChEBIID = `CHEBI:${number}`; +/** ChEMBL bioactivity database identifier. */ export type ChEMBLID = `CHEMBL${number}`; +/** Kyoto Encyclopedia of Genes and Genomes (KEGG) identifier. */ export type KEGGID = `C${string}` | `D${string}`; +/** European Chemicals Agency (ECHA) InfoCard identifier. */ export type ECHAInfoCard = `100.${number}.${number}`; +/** European Community (EC) Number for substances in the EU. */ export type ECNumber = `${number}-${number}-${number}`; +/** Registry of Toxic Effects of Chemical Substances (RTECS) identifier. */ export type RTECSNumber = `RTECS${string}`; +/** FDA/USP Unique Ingredient Identifier. */ export type UNII = string; +/** National Cancer Institute (NCI) NSC Number. */ export type NSCNumber = `NSC${number}`; +/** DrugBank database identifier. */ export type DrugBankID = `DB${string}`; +/** Anatomical Therapeutic Chemical (ATC) classification code. */ export type ATCCode = `${string}${number}${string}${number}`; +/** Beilstein database internal number for organic compounds. */ export type BeilsteinNumber = `${number}`; +/** Gmelin database internal number for inorganic and organometallic compounds. */ export type GmelinNumber = `${number}`; +/** Protein Data Bank (PDB) structure identifier. */ export type PDBID = string; +/** Wikidata unique item identifier. */ export type WikidataID = `Q${number}`; +/** + * Registry of identifiers for cross-referencing external scientific databases. + */ export type RegistryGroup = Group< { + /** The unique numerical identifier assigned by the Chemical Abstracts Service. */ cas?: Distinct< CASNumber >; + /** The compound identifier within the PubChem database. */ cid?: Distinct< PubChemCID >; + /** The unique numerical identifier for the ChemSpider repository. */ chemspider?: Distinct< ChemSpiderID >; + /** The identifier for the Chemical Entities of Biological Interest database. */ chebi?: Distinct< ChEBIID >; + /** The identifier for the ChEMBL database of bioactive molecules. */ chembl?: Distinct< ChEMBLID >; + /** The compound or drug entry identifier in the KEGG database. */ kegg?: Distinct< KEGGID >; + /** The identifier used to access the ECHA InfoCard summary page. */ echa?: Distinct< ECHAInfoCard >; + /** The official number for substances in the European Union (EINECS, ELINCS, NLP). */ ec?: Distinct< ECNumber >; + /** Specifically the European Inventory of Existing Commercial Chemical Substances number. */ einecs?: Distinct< ECNumber >; + /** Specifically the European List of Notified Chemical Substances number. */ elincs?: Distinct< ECNumber >; + /** The identifier for the Registry of Toxic Effects of Chemical Substances. */ rtecs?: Distinct< RTECSNumber >; + /** The FDA's permanent and unambiguous unique ingredient identifier. */ unii?: Distinct< UNII >; + /** The Cancer Chemotherapy National Service Center (NSC) Number. */ nsc?: Distinct< NSCNumber >; + /** The unique identifier for the DrugBank database. */ drugbank?: Distinct< DrugBankID >; + /** The system of classification for medical drugs according to the organ or system on which they act. */ atc?: Distinct< ATCCode[] >; + /** The internal registry number for the Beilstein database. */ beilstein?: Distinct< BeilsteinNumber >; + /** The internal registry number for the Gmelin database. */ gmelin?: Distinct< GmelinNumber >; + /** The unique identifier for molecular structures in the Protein Data Bank. */ pdb?: Distinct< PDBID[] >; + /** The permanent identifier for the corresponding Wikidata item. */ wikidata?: Distinct< WikidataID >; } >; +/** IUPAC International Chemical Identifier string. */ export type InChI = `InChI=${string}`; +/** Hashed version of the InChI string for efficient database searching. */ export type InChIKey = `${string}-${string}-${string}`; +/** Simplified Molecular Input Line Entry System string for chemical topology. */ export type SMILES = string; -export type SMARTS = string; +/** The canonicalized version of a SMILES string to ensure uniqueness. */ export type CanonicalSMILES = string; +/** A SMILES string that includes stereochemical information. */ export type IsomericSMILES = string; +/** SMarts ARbitrary Target Specification string for substructure searching. */ +export type SMARTS = string; +/** Wiswesser Line Notation; a predecessor to SMILES. */ export type WLN = string; +/** The systematic chemical name according to IUPAC nomenclature rules. */ export type IUPACName = string; +/** + * Registry of machine-readable structural representations. + */ export type StructureGroup = Group< { + /** The full IUPAC International Chemical Identifier. */ inChI?: Distinct< InChI >; + /** The fixed-length condensed digital signature of the InChI identifier. */ inChIkey?: Distinct< InChIKey >; + /** The basic SMILES representation of the molecule's connectivity. */ smiles?: Distinct< SMILES >; - smarts?: Distinct< SMARTS >; + /** The uniquely defined canonical SMILES string for the molecule. */ canonicalSmiles?: Distinct< CanonicalSMILES >; + /** The SMILES string capturing chiral and geometric isomerism. */ isomericSmiles?: Distinct< IsomericSMILES >; + /** The SMARTS string for substructure pattern matching. */ + smarts?: Distinct< SMARTS >; + /** The vintage Wiswesser Line Notation for the substance. */ wln?: Distinct< WLN >; + /** The official recognized systematic name of the substance. */ iupacName?: Distinct< IUPACName >; } >; From 93ddd8fd60b898dcce87862f47dbfbba38d4eb8c Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 15:03:44 +0200 Subject: [PATCH 38/53] Update descriptive.ts --- types/collection/descriptive.ts | 62 ++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/types/collection/descriptive.ts b/types/collection/descriptive.ts index 3a0bac62..4beb9cab 100644 --- a/types/collection/descriptive.ts +++ b/types/collection/descriptive.ts @@ -1,3 +1,9 @@ +/** + * @file descriptive.ts + * @description Defines qualitative, historical, and multi-media properties that provide a human-readable + * and historical context for chemical substances. + */ + import type { D3Format, ImageFormat, LangCode } from '../../enum/util'; import type { Collection, Distinct, Group, Single } from '../abstract/collection'; import type { PrimitiveProperty } from '../abstract/property'; @@ -5,60 +11,114 @@ import type { RefId } from '../abstract/reference'; import type { LangGroup } from '../abstract/util'; import type { RegistryGroup, StructureGroup } from './registry'; +/** + * Historical metadata concerning the first identification of a substance. + */ export type DiscoveryGroup = Group< { + /** The year the substance was officially identified or discovered. */ year?: Distinct< number >; + /** The name of the individuals primarily credited with the discovery. */ discoverer?: Distinct< string | string[] >; + /** The country or region where the discovery took place. */ country?: Distinct< string | string[] >; + /** The university or organization where the research was conducted. */ institute?: Distinct< string | string[] >; + /** Additional scientific or regulatory remarks concerning the discovery. */ + notes?: Distinct< string >; + /** References to the original discovery papers or announcements. */ references?: RefId[]; } >; +/** + * Visual and spectral data representing the physical appearance of the substance. + */ export type MediaGroup = Group< { + /** Photographic or diagrammatic images of the substance. */ images?: Distinct< { + /** The absolute URL or path to the image file. */ url: string; + /** The file format of the image (e.g., PNG, JPEG). */ format?: ImageFormat; + /** Information regarding the attribution or ownership of the image. */ credits: string; + /** The legal license governing the use of the image. */ license: string; + /** The creator or photographer of the media. */ author?: string; + /** The originating website or publication. */ source?: string; + /** Physical width of the original image in pixels. */ width?: number; + /** Physical height of the original image in pixels. */ height?: number; }[] >; + /** Characteristic fingerprint data from various spectroscopic techniques. */ spectrum?: Group< { + /** Base64 encoded data for the absorption spectrum. */ absorption?: Single< PrimitiveProperty< string > >; + /** Base64 encoded data for the emission spectrum. */ emission?: Single< PrimitiveProperty< string > >; + /** Base64 encoded data for ultraviolet-visible spectroscopy data. */ uv?: Single< PrimitiveProperty< string > >; + /** Base64 encoded data for X-ray diffraction or spectroscopy. */ xray?: Single< PrimitiveProperty< string > >; } >; + /** Data files for rendering three-dimensional molecular or crystal structures. */ structure3D?: Distinct< { + /** The raw Base64 encoded structural data (e.g., CIF, XYZ, PDB). */ data: string; + /** The chemical data format used for the 3D representation. */ format: D3Format; + /** External URL for a specialized 3D viewer or repository. */ url?: string; }[] >; } >; +/** + * External links and digital pointers for further research. + */ export type WeblinksGroup = Group< { + /** A collection of relevant scientific or educational web resources. */ links?: Distinct< { + /** The destination URL of the link. */ url: string; + /** The display text for the hyperlink. */ text?: string; + /** A short summary of the content found at the link. */ description?: string; + /** Link to a permanent archive version (e.g., Wayback Machine). */ archiveUrl?: string; + /** The date the link was last verified for content. */ accessed?: string; - language?: string; + /** The language of the linked page. */ + language?: LangCode; }[] >; + /** Localized links to corresponding Wikipedia articles. */ wiki?: LangGroup; } >; +/** + * Registry of properties providing descriptive, historical, and multi-media metadata. + */ export type DescriptiveCollection = Collection< { + /** External database identifiers and regulatory registry numbers. */ registry: RegistryGroup; + /** Encoded structural strings for computational chemistry (SMILES, InChI). */ structure: StructureGroup; + /** The standardized scientific and common name(s) of the substance. */ names: LangGroup< LangCode.ENGLISH | LangCode.LATIN, string[] >; + /** A concise scientific overview of the substance's nature and significance. */ description?: LangGroup; + /** Qualitative description of the substance's physical form and color. */ appearance?: LangGroup; + /** The characteristic odor profile of the substance. */ odor?: LangGroup; + /** The historical context of the substance's discovery. */ discovery?: DiscoveryGroup; + /** Visual and spectral representations of the substance. */ media?: MediaGroup; + /** External digital resources and citations. */ weblinks?: WeblinksGroup; } >; From 27f9927bb46840970f1354452ec0651dc661e2c9 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 15:05:03 +0200 Subject: [PATCH 39/53] Update generic.ts --- types/collection/generic.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/types/collection/generic.ts b/types/collection/generic.ts index 95980dd3..5eb24b5e 100644 --- a/types/collection/generic.ts +++ b/types/collection/generic.ts @@ -1,12 +1,26 @@ +/** + * @file generic.ts + * @description Defines general-purpose properties that do not fit into specific scientific domains, + * such as economic data or cross-domain metadata. + */ + import type { Collection, Single } from '../abstract/collection'; import type { StructProperty } from '../abstract/property'; import type { NumberValue } from '../abstract/value'; +/** + * Registry of non-scientific or general properties associated with a substance. + */ export type GenericCollection = Collection< { + /** The commercial market value of the substance at a specific point in time. */ price: Single< StructProperty< { + /** The numerical amount and currency of the price. */ value: NumberValue< 'currency' >; + /** The ISO 8601 date when this specific price was recorded. */ date: string; + /** The specific stock exchange or commercial market where the price was observed. */ market?: string; + /** External URL for the price source or market documentation. */ url?: string; } > >; } >; From bceb0dca7ef44143da4cb373ed66af21475fa379 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 15:10:14 +0200 Subject: [PATCH 40/53] add comments for physical props. --- types/collection/physics.ts | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/types/collection/physics.ts b/types/collection/physics.ts index 26ce9d18..ff077f74 100644 --- a/types/collection/physics.ts +++ b/types/collection/physics.ts @@ -1,118 +1,216 @@ +/** + * @file physics.ts + * @description Defines macroscopic physical properties of substances, covering thermodynamics, mechanics, + * electromagnetism, and optical characteristics. + */ + import type { Diaphaneity, Gloss, Lustre, MagneticOrdering, Phase, Superconductivity } from '../../enum/physics'; import type { Collection, Group, Single } from '../abstract/collection'; import type { CoupledNumberProperty, NumberProperty, PrimitiveProperty } from '../abstract/property'; import type { LangGroup } from '../abstract/util'; +/** + * Registry of physical properties describing the macroscopic behavior and state of matter. + */ export type PhysicsCollection = Collection< { + /** The mass per unit volume of the substance under specific conditions. */ density?: Single< NumberProperty< 'density' > >; + /** The ratio of the density of the substance to the density of a reference material (usually water). */ relativeDensity?: Single< PrimitiveProperty< number > >; + /** The primary physical state (solid, liquid, gas, plasma) of the substance. */ phase?: Single< PrimitiveProperty< Phase > >; + /** Grouping of temperature-dependent phase transitions and thermal limits. */ temperature?: Group< { + /** The temperature at which a solid substance changes state to a liquid. */ meltingPoint?: Single< NumberProperty< 'temperature' > >; + /** The temperature at which the vapor pressure of a liquid equals the external pressure. */ boilingPoint?: Single< NumberProperty< 'temperature' > >; + /** The temperature range over which a substance remains in the liquid phase. */ liquidRange?: Single< NumberProperty< 'temperature' > >; + /** The temperature at which a structural or electronic phase transition occurs. */ transitionTemp?: Single< NumberProperty< 'temperature' > >; + /** The temperature at which a solid changes directly into a gas without passing through the liquid phase. */ sublimationPoint?: Single< NumberProperty< 'temperature' > >; + /** The lowest temperature at which vapors of a fluid will ignite when given an ignition source. */ flashPoint?: Single< NumberProperty< 'temperature' > >; + /** The temperature at which a substance spontaneously ignites in a normal atmosphere. */ autoignitionTemp?: Single< NumberProperty< 'temperature' > >; + /** The state (temperature and pressure) above which distinct liquid and gas phases do not exist. */ criticalPoint?: Single< CoupledNumberProperty< 'temperature' | 'pressure' > >; + /** The state (temperature and pressure) at which solid, liquid, and gas phases coexist in equilibrium. */ triplePoint?: Single< CoupledNumberProperty< 'temperature' | 'pressure' > >; + /** A measure of the maximum frequency of lattice vibrations in a solid. */ debyeTemp?: Single< NumberProperty< 'temperature' > >; } >; + /** Grouping of thermodynamic energy changes associated with phase or chemical transitions. */ enthalpy?: Group< { + /** The energy required to change a substance from solid to liquid without changing its temperature. */ fusionEnthalpy?: Single< NumberProperty< 'energy' > >; + /** The energy required to change a substance from liquid to gas at its boiling point. */ vaporisationEnthalpy?: Single< NumberProperty< 'energy' > >; + /** The energy required for the direct transition of a solid to a gaseous state. */ sublimationEnthalpy?: Single< NumberProperty< 'energy' > >; + /** The energy change required to separate a molecule into its constituent atoms. */ atomizationEnthalpy?: Single< NumberProperty< 'energy' > >; + /** The change in enthalpy during the formation of one mole of a substance from its constituent elements. */ formationEnthalpy?: Single< NumberProperty< 'energy' > >; + /** The energy released as heat when a substance undergoes complete combustion with oxygen. */ combustionEnthalpy?: Single< NumberProperty< 'energy' > >; } >; + /** Grouping of thermal transport and storage properties. */ heat?: Group< { + /** The amount of heat required to raise the temperature of a given amount of substance by one degree. */ heatCapacity?: Single< NumberProperty< 'heatCapacity' > >; + /** The heat capacity of one mole of the substance. */ molarHeatCapacity?: Single< NumberProperty< 'molarHeatCapacity' > >; + /** The heat capacity per unit mass of the substance. */ specificHeatCapacity?: Single< NumberProperty< 'specificHeatCapacity' > >; + /** The rate at which heat passes through a specific thickness of the material. */ thermalConductivity?: Single< NumberProperty< 'thermalConductivity' > >; + /** The tendency of matter to change its shape, area, and volume in response to a change in temperature. */ thermalExpansion?: Single< NumberProperty< 'thermalExpansion' > >; + /** The rate of temperature spread through a material. */ thermalDiffusivity?: Single< NumberProperty< 'thermalDiffusivity' > >; + /** The minimum energy needed to remove an electron from a solid to a point in the vacuum. */ workFunction?: Single< NumberProperty< 'energy' > >; + /** The ratio of the heat capacity at constant pressure to heat capacity at constant volume. */ adiabaticIndex?: Single< PrimitiveProperty< number > >; } >; + /** Grouping of mechanical resistance scales for surface deformation. */ hardness?: Group< { + /** Hardness measured by the indentation depth of a hard steel or carbide ball. */ brinellHardness?: Single< PrimitiveProperty< number > >; + /** A qualitative scale of mineral hardness based on scratch resistance. */ mohsHardness?: Single< PrimitiveProperty< number > >; + /** Hardness measured using a square-based diamond pyramid indenter. */ vickersHardness?: Single< PrimitiveProperty< number > >; + /** Hardness based on the depth of penetration of a diamond or ball indenter. */ rockwellHardness?: Single< PrimitiveProperty< number > >; + /** Microhardness test for thin or brittle materials using a rhombic diamond indenter. */ knoopHardness?: Single< PrimitiveProperty< number > >; } >; + /** Grouping of properties describing the deformation of a material under stress. */ elasticity?: Group< { + /** Resistance of a substance to uniform compression. */ bulkModulus?: Single< NumberProperty< 'pressure' > >; + /** Resistance of a material to shearing deformation. */ shearModulus?: Single< NumberProperty< 'pressure' > >; + /** A measure of the stiffness of a solid material (tensile elasticity). */ youngModulus?: Single< NumberProperty< 'pressure' > >; + /** The ratio of transverse strain to axial strain. */ poissonRatio?: Single< PrimitiveProperty< number > >; + /** The fractional volume change per unit change in pressure. */ compressibility?: Single< NumberProperty< 'compressibility' > >; + /** The maximum stress that a material can withstand while being stretched. */ tensileStrength?: Single< NumberProperty< 'pressure' > >; + /** The stress level at which a material begins to deform plastically. */ yieldStrength?: Single< NumberProperty< 'pressure' > >; + /** The maximum stress a material can withstand before failing. */ ultimateStrength?: Single< NumberProperty< 'pressure' > >; } >; + /** Grouping of properties related to the movement of charge carriers. */ electricity?: Group< { + /** A measure of a material's ability to conduct an electric current. */ conductivity?: Single< NumberProperty< 'electricConductivity' > >; + /** A measure of how strongly a material opposes the flow of electric current. */ resistivity?: Single< NumberProperty< 'electricResistivity' > >; + /** The relative change of a physical property per degree of temperature change. */ tempCoefficient?: Single< NumberProperty< 'tempCoefficient' > >; + /** The type or mechanism of zero electrical resistance behavior. */ superconductivity?: Single< PrimitiveProperty< Superconductivity > >; + /** The critical temperature below which a material becomes superconducting. */ superconductingPoint?: Single< NumberProperty< 'temperature' > >; + /** The energy range in a solid where no electron states can exist. */ bandGap?: Single< NumberProperty< 'energy' > >; + /** A measure of a material's ability to store electrical energy in an electric field. */ dielectricConstant?: Single< PrimitiveProperty< number > >; + /** The product of magnitude of charges and distance between them in a molecule. */ dipoleMoment?: Single< NumberProperty< 'dipoleMoment' > >; } >; + /** Grouping of properties describing a material's response to magnetic fields. */ magnetism?: Group< { + /** The fundamental magnetic state of the material (e.g., ferromagnetism). */ magneticOrdering?: Single< PrimitiveProperty< MagneticOrdering > >; + /** A measure of the degree to which a substance becomes magnetized in an external field. */ magneticSusceptibility?: Single< NumberProperty< 'magneticSusceptibility' > >; + /** The magnetic susceptibility per mole of the substance. */ molarMagneticSusceptibility?: Single< NumberProperty< 'molarMagneticSusceptibility' > >; + /** The magnetic susceptibility per unit mass of the substance. */ massMagneticSusceptibility?: Single< NumberProperty< 'massMagneticSusceptibility' > >; + /** The temperature above which a ferromagnetic material becomes paramagnetic. */ curiePoint?: Single< NumberProperty< 'temperature' > >; + /** The temperature above which an antiferromagnetic material becomes paramagnetic. */ neelPoint?: Single< NumberProperty< 'temperature' > >; + /** The magnetic strength and orientation of a magnet or other object that produces a magnetic field. */ magneticMoment?: Single< NumberProperty< 'magneticMoment' > >; + /** The resistance of a ferromagnetic material to changes in magnetization. */ coercivity?: Single< NumberProperty< 'magneticFieldStrength' > >; + /** The magnetization left behind after an external magnetic field is removed. */ remanence?: Single< NumberProperty< 'magneticFluxDensity' > >; + /** The ability of a material to support the formation of a magnetic field within itself. */ permeability?: Single< NumberProperty< 'magneticPermeability' > >; } >; + /** Grouping of properties describing the behavior of light within and on the surface of the material. */ optics?: Group< { + /** The ratio of the speed of light in vacuum to the speed of light in the medium. */ refractiveIndex?: Single< PrimitiveProperty< number > >; + /** The fraction of incident electromagnetic power that is reflected at an interface. */ reflectance?: Single< PrimitiveProperty< number > >; + /** The difference between the refractive indices for light with different polarizations. */ birefringence?: Single< PrimitiveProperty< number > >; + /** The angle between the optical axes in biaxial crystals. */ v2Angle?: Single< NumberProperty< 'angle' > >; + /** A measure of the rate of decrease in the intensity of electromagnetic radiation as it passes through a given substance. */ absorptionCoefficient?: Single< NumberProperty< 'absorptionCoefficient' > >; + /** The ratio of the energy radiated from a material's surface to that radiated from a blackbody. */ emissivity?: Single< PrimitiveProperty< number > >; + /** The fraction of incident light that passes through the sample. */ transmittance?: Single< PrimitiveProperty< number > >; + /** The measure of impenetrability to electromagnetic or other kinds of radiation. */ opacity?: Single< PrimitiveProperty< number > >; + /** The attribute of visual perception by which a body appears to reflect light specularly. */ gloss?: Single< PrimitiveProperty< Gloss > >; + /** The appearance of a material surface in terms of its light-reflective qualities. */ lustre?: Single< PrimitiveProperty< Lustre > >; + /** The degree to which a substance allows light to pass through it. */ diaphaneity?: Single< PrimitiveProperty< Diaphaneity > >; + /** The perceived color of the substance in its bulk form. */ color?: LangGroup; + /** The color of the powder produced when the material is dragged across an unweathered surface. */ streak?: LangGroup; } >; + /** Grouping of properties related to the transmission of mechanical waves. */ acoustics?: Group< { + /** The distance traveled per unit time by a sound wave as it propagates through a medium. */ soundSpeed?: Single< NumberProperty< 'velocity' > >; + /** The product of the density of the medium and the speed of sound in it. */ acousticImpedance?: Single< NumberProperty< 'acousticImpedance' > >; + /** The rate at which sound energy is lost as it propagates through a material. */ attenuationCoefficient?: Single< NumberProperty< 'attenuationCoefficient' > >; } >; + /** Grouping of properties describing the interface between different phases. */ surface?: Group< { + /** The elastic-like force that exists in the surface of a liquid, tending to minimize surface area. */ surfaceTension?: Single< NumberProperty< 'surfaceTension' > >; + /** The angle at which a liquid-vapor interface meets a solid surface. */ contactAngle?: Single< NumberProperty< 'angle' > >; } >; + /** Grouping of properties describing the internal friction of a fluid. */ viscosity?: Group< { + /** A measure of the resistance of a fluid to deformation under shear stress. */ dynamicViscosity?: Single< NumberProperty< 'dynamicViscosity' > >; + /** The ratio of dynamic viscosity to the density of the fluid. */ kinematicViscosity?: Single< NumberProperty< 'kinematicViscosity' > >; } >; } >; From 51c97daf952f1604e753800000a6d64970131212 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 15:14:23 +0200 Subject: [PATCH 41/53] Update crystallography.ts --- types/collection/crystallography.ts | 66 +++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/types/collection/crystallography.ts b/types/collection/crystallography.ts index 92a5ab48..a4efb371 100644 --- a/types/collection/crystallography.ts +++ b/types/collection/crystallography.ts @@ -1,3 +1,9 @@ +/** + * @file crystallography.ts + * @description Defines properties related to the internal structural arrangement of crystals, + * their symmetry groups, and physical diagnostic features like cleavage and habit. + */ + import type { CleavageQuality, CleavageType, CrystalFamily, CrystalHabit, CrystalSystem, FractureType, Tenacity, TwinningMode, TwinningType @@ -7,62 +13,122 @@ import type { Collection, Single } from '../abstract/collection'; import type { PrimitiveProperty, StructProperty } from '../abstract/property'; import type { NumberValue } from '../abstract/value'; +/** + * Representation of a crystallographic point group (crystal class). + */ export type PointGroup = { + /** The international number of the point group (1-32). */ number: number; + /** The standard name of the point group. */ name: string; + /** The Hermann-Mauguin notation (International notation) for the group. */ hermannMauguin?: string; + /** The Schönflies notation for the point group symmetry. */ schoenflies?: string; }; +/** + * Representation of a crystallographic space group. + */ export type SpaceGroup = { + /** The sequential number of the space group in the International Tables for Crystallography (1-230). */ number: number; + /** The full international symbol representing the symmetry operations and lattice type. */ symbol: string; }; +/** + * Parameters defining the geometry and size of a crystal's unit cell. + */ export type UnitCell = { + /** Lattice parameter representing the length of the 'a' axis. */ a?: NumberValue< 'length' >; + /** Lattice parameter representing the length of the 'b' axis. */ b?: NumberValue< 'length' >; + /** Lattice parameter representing the length of the 'c' axis. */ c?: NumberValue< 'length' >; + /** Interaxial angle between the 'b' and 'c' axes. */ alpha?: NumberValue< 'angle' >; + /** Interaxial angle between the 'a' and 'c' axes. */ beta?: NumberValue< 'angle' >; + /** Interaxial angle between the 'a' and 'b' axes. */ gamma?: NumberValue< 'angle' >; + /** The number of formula units contained within the volume of the unit cell. */ Z?: number; }; +/** + * Registry of coordination numbers grouped by element. + */ export type Ligancy = { + /** The number of neighboring atoms of a specific element surrounding a central atom. */ [ K in ElementSymbol ]?: number; }; +/** + * Descriptive fields for twinning phenomena in crystals. + */ export type Twinning = { + /** The categorization of the twinning mechanism (e.g., contact, penetration). */ type?: TwinningType; + /** The specific mode of formation for the twin (e.g., growth, mechanical). */ mode?: TwinningMode; + /** The specific Twin Law (e.g., "Albite Law") defining the orientation. */ law?: string; + /** The symmetry operation (reflection, rotation) that relates the twin individuals. */ operation?: string; }; +/** + * Descriptive fields for the cleavage properties of a crystalline substance. + */ export type Cleavage = { + /** The structural nature of the cleavage (e.g., octahedral, prismatic). */ type?: CleavageType; + /** The degree of ease and smoothness with which the crystal splits. */ quality?: CleavageQuality; + /** The orientation of the cleavage plane expressed as Miller indices {hkl}. */ millerIndex?: string; }; +/** + * Descriptive fields for the fracture and mechanical tenacity of a material. + */ export type Fracture = { + /** The characteristic appearance of the broken surface (e.g., conchoidal). */ type?: FractureType; + /** The resistance of the material to the propagation of cracks. */ toughness?: NumberValue< 'energy' >; + /** The behavior of the material under stress (e.g., brittle, malleable). */ tenacity?: Tenacity; }; +/** + * Registry of crystallographic and structural properties. + */ export type CrystallographyCollection = Collection< { + /** The high-level grouping of crystal systems based on shared cell dimensions. */ family?: Single< PrimitiveProperty< CrystalFamily > >; + /** The categorization of crystal symmetry into one of the seven systems (e.g., Cubic). */ system?: Single< PrimitiveProperty< CrystalSystem > >; + /** A notation used to describe crystal structures in terms of lattice type and number of atoms. */ pearsonSymbol?: Single< PrimitiveProperty< string > >; + /** The specific set of symmetry operations that leave at least one point unmoved. */ pointGroup?: Single< StructProperty< PointGroup > >; + /** The symmetry of the diffraction pattern produced by the crystal. */ laueGroup?: Single< PrimitiveProperty< string > >; + /** The full symmetry group of the crystal lattice, including translational symmetry. */ spaceGroup?: Single< StructProperty< SpaceGroup > >; + /** The geometric dimensions and angles that define the repeating lattice unit. */ unitCell?: Single< StructProperty< UnitCell > >; + /** The coordination environment of the constituent atoms. */ ligancy?: Single< StructProperty< Ligancy > >; + /** The typical outward appearance and growth form of the individual crystals. */ crystalHabit?: Single< PrimitiveProperty< CrystalHabit > >; + /** The phenomenon where two or more crystals share some lattice points in a symmetrical way. */ twinning?: Single< StructProperty< Twinning > >; + /** The tendency of the material to split along specific crystallographic planes. */ cleavage?: Single< StructProperty< Cleavage > >; + /** The pattern of breakage that occurs when a crystal is broken across non-cleavage planes. */ fracture?: Single< StructProperty< Fracture > >; } >; From c9e6bdfab62501615a34b561359e7543797b3d21 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 15:16:58 +0200 Subject: [PATCH 42/53] Update composition.ts --- types/collection/composition.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/types/collection/composition.ts b/types/collection/composition.ts index d3828ab7..bd681a61 100644 --- a/types/collection/composition.ts +++ b/types/collection/composition.ts @@ -1,19 +1,40 @@ +/** + * @file composition.ts + * @description Defines the chemical makeup of substances, including elemental components, + * stoichiometry, and various formula representations. + */ + import type { ComponentRole } from '../../enum/chemistry'; import type { ElementSymbol } from '../../enum/element'; import type { Collection, Single } from '../abstract/collection'; import type { PrimitiveProperty, StructProperty } from '../abstract/property'; +/** + * Representation of a single chemical constituent within a substance. + */ export type Component = { + /** The chemical symbol of the element (e.g., 'H', 'Fe'). */ element: ElementSymbol; + /** The stoichiometric quantity or relative amount of the element. */ quantity: number; + /** The functional role of the component within the structure (e.g., cation, ligand). */ type?: ComponentRole; + /** The formal oxidation state or ionic charge of the component. */ charge?: number; }; +/** + * Registry of properties describing the chemical identity and stoichiometric ratios. + */ export type CompositionCollection = Collection< { + /** The list of individual elements and their quantities that make up the substance. */ components: Single< StructProperty< Component > >; + /** The standard chemical representation showing the type and number of atoms (e.g., "H{2}O"). */ formula: Single< PrimitiveProperty< string > >; + /** The simplest whole-number ratio of atoms in a compound. */ empiricalFormula?: Single< PrimitiveProperty< string > >; + /** A formula showing the types and nodes of atoms without full structural detail. */ condensedFormula?: Single< PrimitiveProperty< string > >; + /** The net electrical charge of the entire chemical entity. */ charge?: Single< PrimitiveProperty< number > >; } >; From 1fe44f10889ebd4243dd6e5cd32dd6f6ace27a43 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 15:25:09 +0200 Subject: [PATCH 43/53] rework nuclear properties collection --- types/collection/nuclear.ts | 122 +++++++++++++++++++++++++++++++----- 1 file changed, 105 insertions(+), 17 deletions(-) diff --git a/types/collection/nuclear.ts b/types/collection/nuclear.ts index c05091eb..b8a121b6 100644 --- a/types/collection/nuclear.ts +++ b/types/collection/nuclear.ts @@ -1,86 +1,174 @@ +/** + * @file nuclear.ts + * @description Defines the nuclear structure and properties of radionuclides, including + * energy levels, decay modes, and nuclear magnetic resonance properties. + */ + import type { DecayMode, RadiationType, SpinParity } from '../../enum/nuclear'; import type { Collection, Single } from '../abstract/collection'; import type { StructProperty } from '../abstract/property'; import type { NumberValue, PrimitiveValue } from '../abstract/value'; +/** + * Representation of the nuclear spin state. + */ export type Spin = { + /** The symmetry of the wave function under spatial inversion. */ parity: SpinParity; + /** The spectroscopic notation/label for the spin state (e.g., "1/2-"). */ value: string; + /** The numerical value of the total angular momentum quantum number J. */ calculatedValue: number; }; +/** + * Properties related to Nuclear Magnetic Resonance (NMR) spectroscopy. + */ export type NMR = { + /** The intrinsic angular momentum of the nucleus. */ spin?: Spin; - gyromagneticRatio?: NumberValue< 'gyromagneticRatio' >; + /** The ratio of a nucleus's magnetic moment to its angular momentum. */ + gyromagneticRatio?: NumberValue< 'gyromagneticRatio' >; + /** The frequency at which the magnetic moment of a nucleus precesses around an external field. */ larmorPrecession?: NumberValue< 'frequency' >; + /** + * The relative sensitivity of the nucleus to magnetic fields compared to a reference nucleus. + * An inherent problem with NMR spectroscopy is its comparatively low sensitivity (poor signal-to-noise ratio). + */ + relativeSensitivity?: PrimitiveValue< number >; }; +/** + * Parameters for a specific radioactive decay path. + */ export type DecayChannel = { + /** The primary mechanism of the nuclear transformation (e.g., alpha, beta-minus). */ mode: DecayMode; + /** The probability fraction of the parent nucleus decaying via this specific mode. */ branchingRatio?: NumberValue< 'quantity' >; + /** The total energy released during the nuclear decay process (Q-value). */ energy?: NumberValue< 'energy' >; + /** The types of ionizing radiation emitted during the decay. */ radiation?: RadiationType[]; }; -export type GroudState = { +/** + * The state of the nucleus with the lowest possible energy. + */ +export type GroundState = { + /** The fundamental energy state (defined as zero for the ground state). */ energy?: NumberValue< 'energy' >; + /** The nuclear angular momentum (spin) of the ground state. */ angularMomentum?: Spin; + /** The time required for half of a sample of the radionuclide to decay. */ halfLife?: NumberValue< 'time' >; + /** The relative abundance of this isotope found in a natural sample of the element. */ isotopeAbundance?: NumberValue< 'massFraction' >; + /** The physical mass of the neutral atom in its ground state. */ isotopeMass?: NumberValue< 'mass' >; + /** The root-mean-square radius of the nuclear charge distribution. */ chargeRadius?: NumberValue< 'length' >; + /** The difference between the actual atomic mass and the mass number. */ massExcess?: NumberValue< 'energy' >; - dipoleMoment?: NumberValue< 'area' >; - quadrupoleMoment?: NumberValue< 'magneticMoment' >; + /** The magnetic dipole moment of the nucleus in its ground state. */ + dipoleMoment?: NumberValue< 'magneticMoment' >; + /** The measure of the non-sphericity of the nuclear charge distribution. */ + quadrupoleMoment?: NumberValue< 'area' >; + /** The quantum number related to the symmetry between protons and neutrons. */ isoSpin?: Spin; + /** The set of observed radioactive decay pathways from the ground state. */ decayChannel?: DecayChannel[]; + /** The energy required to disassemble the nucleus into its constituent nucleons. */ bindingEnergy?: NumberValue< 'energy' >; + /** The energy released during alpha particle emission. */ alphaDecayEnergy?: NumberValue< 'energy' >; + /** The energy released during beta decay. */ betaDecayEnergy?: NumberValue< 'energy' >; + /** The energy released when an atomic electron is absorbed by a proton in the nucleus. */ electronCaptureEnergy?: NumberValue< 'energy' >; + /** The energy required to remove a neutron from the nucleus. */ neutronEmissionEnergy?: NumberValue< 'energy' >; + /** The minimum energy to separate a single neutron from the nucleus. */ neutronSeparationEnergy?: NumberValue< 'energy' >; + /** The minimum energy to separate a single proton from the nucleus. */ protonSeparationEnergy?: NumberValue< 'energy' >; + /** The energy difference between the ground state and an excited nuclear level. */ excitationEnergy?: NumberValue< 'energy' >; }; +/** + * A discrete excited energy state of the atomic nucleus. + */ export type Level = { + /** The energy of the excited state relative to the ground state. */ energy?: NumberValue< 'energy' >; + /** The spin-parity of the excited nuclear level. */ angularMomentum?: Spin; + /** The rotational or vibrational band to which the level belongs. */ band?: number; + /** The mean lifetime or half-life of the excited state. */ halfLife?: NumberValue< 'time' >; + /** The relative population probability found in specific environments. */ isotopeAbundance?: NumberValue< 'massFraction' >; - dipoleMoment?: NumberValue< 'area' >; - quadrupoleMoment?: NumberValue< 'magneticMoment' >; + /** The magnetic dipole moment of the excited state. */ + dipoleMoment?: NumberValue< 'magneticMoment' >; + /** The electric quadrupole moment of the excited state. */ + quadrupoleMoment?: NumberValue< 'area' >; + /** The isospin quantum number of the excited level. */ isoSpin?: Spin; + /** The possible decay modes from this excited state. */ decayChannel?: DecayChannel[]; }; -export type Gamma = { - initial?: { - energy?: NumberValue< 'energy' >; - angularMomentum?: Spin; - }; - final?: { - energy?: NumberValue< 'energy' >; - angularMomentum?: Spin; - }; +/** + * A discrete energy state of the atomic nucleus. + */ +export type NuclearState = { + /** The energy of the excited state relative to the ground state. */ + energy?: NumberValue< 'energy' >; + /** The spin-parity of the excited nuclear level. */ + angularMomentum?: Spin; +} + +/** + * Properties of a gamma-ray transition between nuclear energy levels. + */ +export type GammaTransition = { + /** The properties of the nuclear state before the photon emission. */ + initial?: NuclearState; + /** The properties of the nuclear state after the photon emission. */ + final?: NuclearState; + /** The lifetime of the excited state before gamma emission. */ halfLife?: NumberValue< 'time' >; + /** The energy of the emitted gamma-ray photon. */ transitionEnergy?: NumberValue< 'energy' >; + /** The observed intensity of the gamma line relative to other transitions. */ relativeIntensity?: NumberValue< 'quantity' >; + /** The ratio of the different multipole components (e.g., E2/M1) in the transition. */ gRayMixingRatio?: PrimitiveValue< number >; + /** The ratio of internal conversion electrons to gamma-ray photons emitted. */ conversionCoefficient?: PrimitiveValue< number >; + /** The reduced probability for the electric part of the transition. */ reducedElectricProbability?: PrimitiveValue< number >; + /** The transition probability for the magnetic part of the electromagnetic decay. */ magneticTransitionProbability?: PrimitiveValue< number >; + /** The electromagnetic character of the transition (e.g., E1, M1, E2). */ multipolarity?: string; }; +/** + * Registry of properties defining the nuclear and isotopic characteristics of matter. + */ export type NuclearCollection = Collection< { + /** The nuclear magnetic resonance characteristics used in spectroscopy and imaging. */ nmr?: Single< StructProperty< NMR > >; - ground?: Single< StructProperty< GroudState > >; + /** The fundamental properties of the nucleus in its absolute minimum energy state. */ + ground?: Single< StructProperty< GroundState > >; + /** The collection of discrete excited energy states and their properties. */ level?: Single< StructProperty< Level > >; - gamma?: Single< StructProperty< Gamma > >; + /** The electromagnetic transitions between different nuclear states. */ + gamma?: Single< StructProperty< GammaTransition > >; } >; From e7eb2a59563d6f6f399fe91e553525967db50bf3 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:04:04 +0200 Subject: [PATCH 44/53] describe the universal schema for any chemical or physical substance --- types/entity/substance.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/types/entity/substance.ts b/types/entity/substance.ts index ed567019..b8bac5b8 100644 --- a/types/entity/substance.ts +++ b/types/entity/substance.ts @@ -1,3 +1,10 @@ +/** + * @file substance.ts + * @description Defines the universal schema for any chemical or physical substance. + * This is the primary structural unit that aggregates all scientific data collections + * including physical, chemical, and safety properties. + */ + import type { Collection } from '../abstract/collection'; import type { AbundanceCollection } from '../collection/abundance'; import type { ChemistryCollection } from '../collection/chemistry'; @@ -7,13 +14,25 @@ import type { GenericCollection } from '../collection/generic'; import type { PhysicsCollection } from '../collection/physics'; import type { SafetyCollection } from '../collection/safety'; +/** + * Universal container for a substance's scientific data. + * @template C The classification type specific to the entity (e.g., Element, Compound). + */ export type Substance< C extends Collection< unknown > > = Collection< { + /** High-level taxonomic classification and categorical identifiers. */ classification: C; + /** Qualitative and historical metadata (names, descriptions, media). */ descriptive: DescriptiveCollection; + /** Generic, non-specific data (e.g., prices, market data). */ generic?: GenericCollection; + /** Data regarding the relative presence across various environments. */ abundance?: AbundanceCollection; + /** Macroscopic physical behaviors and thermodynamic states. */ physics?: PhysicsCollection; + /** Internal lattice structure and crystallographic symmetry properties. */ crystallography?: CrystallographyCollection; + /** Reactivity, stoichiometry, and molecular geometry properties. */ chemistry?: ChemistryCollection; + /** Hazard identifications, safety ratings, and toxicological data. */ safety?: SafetyCollection; } >; From c171f3bceca0bdfb146c5dd6acd7e0f0caeacf1d Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:05:06 +0200 Subject: [PATCH 45/53] Update composite.ts --- types/entity/composite.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/entity/composite.ts b/types/entity/composite.ts index 824145f3..af63f1a3 100644 --- a/types/entity/composite.ts +++ b/types/entity/composite.ts @@ -1,8 +1,19 @@ +/** + * @file composite.ts + * @description Defines the base structure for substances composed of multiple chemical elements. + * Extends the basic substance model with detailed stoichiometric information. + */ + import type { Expand } from 'devtypes/types/util'; import type { Collection } from '../abstract/collection'; import type { CompositionCollection } from '../collection/composition'; import type { Substance } from './substance'; +/** + * A substance entity that inherently includes a multi-element composition. + * @template C The classification type specific to the composite entity. + */ export type Composite< C extends Collection< unknown > > = Expand< Substance< C > & { + /** Detailed record of the constituent elements and their stoichiometric ratios. */ composition: CompositionCollection; } >; From 54996048e4109adbf0d0d0d5e51d59feed776e8e Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:07:11 +0200 Subject: [PATCH 46/53] add comments for element entity --- types/entity/element.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/types/entity/element.ts b/types/entity/element.ts index 914a0b80..66966185 100644 --- a/types/entity/element.ts +++ b/types/entity/element.ts @@ -1,3 +1,9 @@ +/** + * @file element.ts + * @description Defines the schema for chemical elements, including their classification, + * atomic properties, and allotropic forms. + */ + import type { Expand } from 'devtypes/types/util'; import type { ElementBlock, ElementGroup, ElementProperty, ElementSet, ElementSymbol, PTColumn, PTPeriod } from '../../enum/element'; import type { Phase } from '../../enum/physics'; @@ -7,28 +13,53 @@ import type { MetaData } from '../abstract/util'; import type { AtomicsCollection } from '../collection/atomics'; import type { Substance } from './substance'; +/** + * High-level taxonomic classification for a chemical element in the periodic table. + */ export type ElementClassification = Collection< { + /** The standard IUPAC symbol (e.g., 'H', 'Fe'). */ symbol: Distinct< string >; + /** The count of protons in the nucleus defining the element. */ atomicNumber: Distinct< number >; + /** The orbital block (s, p, d, f) where the valence electrons reside. */ block: Distinct< ElementBlock >; + /** The categorical group name (e.g., Noble Gas, Alkali Metal). */ group: Distinct< ElementGroup >; + /** The vertical column number (1-18) in the standard periodic table. */ column: Distinct< PTColumn >; + /** The horizontal period number (1-7) in the periodic table. */ period: Distinct< PTPeriod >; + /** The standard physical phase at 298.15 K and 100 kPa. */ phase: Distinct< Phase >; + /** The specific geochemical or structural set (e.g., Lanthanides). */ set: Distinct< ElementSet >; + /** Indicates if all isotopes of the element are unstable. */ radioactive: Distinct< boolean >; + /** Indicates if the element occurs naturally on Earth or is only produced artificially. */ synthetic: Distinct< boolean >; + /** List of characteristic properties associated with this element. */ properties: Distinct< ElementProperty[] >; } >; +/** + * Representation of a single chemical element as a substance. + */ export type SingleElement = Expand< Substance< ElementClassification > & { + /** Fundamental atomic properties including nuclear and electronic structure. */ atomics?: AtomicsCollection; } >; +/** + * The complete elemental entity, including metadata and potential allotropes. + */ export type Element = Expand< MetaData & SingleElement & { + /** Variations of the element in the same physical state (e.g., Graphite vs. Diamond). */ forms?: FormCollection< SingleElement >; } >; +/** + * Global registry of all chemical elements indexed by their IUPAC symbol. + */ export type ElementEntity = Collection< { [ K in ElementSymbol ]: Element; } >; From 5704dc799e1faa387672bd2b001de217d966285b Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:08:53 +0200 Subject: [PATCH 47/53] Update mixture.ts --- types/entity/mixture.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/types/entity/mixture.ts b/types/entity/mixture.ts index 4ddfe5ec..1a75c053 100644 --- a/types/entity/mixture.ts +++ b/types/entity/mixture.ts @@ -1,3 +1,9 @@ +/** + * @file mixture.ts + * @description Defines the schema for chemical mixtures, focusing on their physical + * homogeneity, state of dispersion, and categorical types. + */ + import type { Brand, Expand } from 'devtypes/types/util'; import type { MixtureCategory, MixtureHomogeneity, MixtureProperty, MixtureType } from '../../enum/mixture'; import type { Phase } from '../../enum/physics'; @@ -5,24 +11,46 @@ import type { Collection, Distinct } from '../abstract/collection'; import type { MetaData } from '../abstract/util'; import type { Composite } from './composite'; +/** Opaque identifier for a chemical mixture. */ export type MixtureID = Brand< string, 'mixtureID' >; +/** + * Physical and architectural classification of multi-component substance systems. + */ export type MixtureClassification = Collection< { + /** The specific physical nature of the mixture (e.g., Solution, Colloid, Suspension). */ type: Distinct< MixtureType >; + /** The degree of uniform distribution of the components (Homogeneous or Heterogeneous). */ homogeneity: Distinct< MixtureHomogeneity >; + /** The structural or thematic category (e.g., Alloy, Aerosol). */ category: Distinct< MixtureCategory >; + /** The overall bulk physical phase of the mixture. */ phase: Distinct< Phase >; + /** The phase of the continuous substance in which the other components are dispersed. */ mediumPhase: Distinct< Phase >; + /** The phase of the particles or droplets that are distributed within the medium. */ dispersedPhase: Distinct< Phase >; + /** Indicates if any constituent of the mixture is radioactive. */ radioactive: Distinct< boolean >; + /** Indicates if the mixture is manufactured or synthetic. */ synthetic: Distinct< boolean >; + /** List of characteristic properties associated with this mixture. */ properties: Distinct< MixtureProperty[] >; } >; +/** + * Representation of a single chemical mixture as a multi-element substance. + */ export type SingleMixture = Composite< MixtureClassification >; +/** + * The complete mixture entity, including metadata. + */ export type Mixture = Expand< MetaData & SingleMixture >; +/** + * Global registry of all multi-component mixtures indexed by a unique identifier. + */ export type MixtureEntity = Collection< { [ key: MixtureID ]: Mixture; } >; From e486220ba1b7ca46efa2d7c40a2948d79feed852 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:10:48 +0200 Subject: [PATCH 48/53] Update mineral.ts --- types/entity/mineral.ts | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/types/entity/mineral.ts b/types/entity/mineral.ts index 91f490d6..a55c1f86 100644 --- a/types/entity/mineral.ts +++ b/types/entity/mineral.ts @@ -1,3 +1,9 @@ +/** + * @file mineral.ts + * @description Defines the schema for minerals, integrating geological classification + * systems such as IMA, Strunz, and Dana. + */ + import type { Brand, Expand } from 'devtypes/types/util'; import type { MineralCategory, MineralClass, MineralProperty } from '../../enum/mineral'; import type { Phase } from '../../enum/physics'; @@ -6,28 +12,53 @@ import type { FormCollection } from '../abstract/form'; import type { MetaData } from '../abstract/util'; import type { Composite } from './composite'; +/** Opaque identifier for a mineral entry. */ export type MineralID = Brand< string, 'mineralID' >; +/** + * Geological and mineralogical taxonomic data. + */ export type MineralClassification = Collection< { + /** The natural origin classification (e.g., Silicates, Carbonates). */ category: Distinct< MineralCategory >; + /** The specific mineral class within the classification hierarchy. */ class: Distinct< MineralClass >; + /** The official symbol assigned by the International Mineralogical Association. */ imaSymbol: Distinct< string >; + /** The identification number in the 8th edition of the Strunz classification. */ strunz8: Distinct< string >; + /** The identification number in the 9th edition of the Strunz classification. */ strunz9: Distinct< string >; + /** The identification number in the Dana system of mineralogy. */ dana: Distinct< string >; + /** The identifier in the Lapis system of mineral classification. */ lapis: Distinct< string >; - phase: Distinct< Phase >; + /** The physical state (always solid for minerals by definition). */ + phase: Distinct< Phase.SOLID >; + /** Indicates if the mineral contains naturally occurring radionuclides. */ radioactive: Distinct< boolean >; + /** Indicates if the specimen is a synthetic lab-grown counterpart of a natural mineral. */ synthetic: Distinct< boolean >; + /** List of characteristic properties associated with this mineral. */ properties: Distinct< MineralProperty[] >; } >; +/** + * Representation of a single mineral species as a multi-element substance. + */ export type SingleMineral = Composite< MineralClassification >; +/** + * The complete mineral entity, including metadata and potential variety forms. + */ export type Mineral = Expand< MetaData & SingleMineral & { + /** Variations or varieties of the mineral (e.g., Quartz vs. Amethyst). */ forms?: FormCollection< SingleMineral >; } >; +/** + * Global registry of all mineral species indexed by a unique identifier. + */ export type MineralEntity = Collection< { [ key: MineralID ]: Mineral; } >; From aa71e35f6b90c963809bf4df0b2a46f96a51c671 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:11:31 +0200 Subject: [PATCH 49/53] min fix --- types/entity/mineral.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/entity/mineral.ts b/types/entity/mineral.ts index a55c1f86..b8ce76b1 100644 --- a/types/entity/mineral.ts +++ b/types/entity/mineral.ts @@ -16,7 +16,7 @@ import type { Composite } from './composite'; export type MineralID = Brand< string, 'mineralID' >; /** - * Geological and mineralogical taxonomic data. + * High-level mineral classification data. */ export type MineralClassification = Collection< { /** The natural origin classification (e.g., Silicates, Carbonates). */ From be31d646f97c1fec632842e04510304b2d57eba7 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:12:22 +0200 Subject: [PATCH 50/53] add documents for compound entity --- types/entity/compound.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/types/entity/compound.ts b/types/entity/compound.ts index 80bdc6f6..bf7f2c68 100644 --- a/types/entity/compound.ts +++ b/types/entity/compound.ts @@ -1,3 +1,9 @@ +/** + * @file compound.ts + * @description Defines the schema for chemical compounds, covering their structural + * classification, bonding characteristics, and various chemical forms. + */ + import type { Brand, Expand } from 'devtypes/types/util'; import type { CompoundCategory, CompoundProperty, CompoundUnion } from '../../enum/compound'; import type { Phase } from '../../enum/physics'; @@ -6,24 +12,45 @@ import type { FormCollection } from '../abstract/form'; import type { MetaData } from '../abstract/util'; import type { Composite } from './composite'; +/** Opaque identifier for a chemical compound entry. */ export type CompoundID = Brand< string, 'compoundID' >; +/** + * High-level categorization of a chemical compound based on its bonding and origin. + */ export type CompoundClassification = Collection< { + /** The structural or thematic category (e.g., Oxide, Polymer). */ category: Distinct< CompoundCategory >; + /** The type of chemical connection (e.g., Covalent, Ionic). */ union: Distinct< CompoundUnion >; + /** Indicates if the compound is based on carbon chains (with specific exceptions). */ organic: Distinct< boolean >; + /** The physical state of the compound under standard conditions. */ phase: Distinct< Phase >; + /** Indicates if the compound contains radioactive radionuclides. */ radioactive: Distinct< boolean >; + /** Indicates if the compound is produced through industrial synthesis. */ synthetic: Distinct< boolean >; + /** List of characteristic properties associated with this compound. */ properties: Distinct< CompoundProperty[] >; } >; +/** + * Representation of a single chemical compound as a multi-element substance. + */ export type SingleCompound = Composite< CompoundClassification >; +/** + * The complete chemical compound entity, including metadata and potential isomers or hydrates. + */ export type Compound = Expand< MetaData & SingleCompound & { + /** Variations of the compound (e.g., different crystal structures or hydration levels). */ forms?: FormCollection< SingleCompound >; } >; +/** + * Global registry of all chemical compounds indexed by a unique identifier. + */ export type CompoundEntity = Collection< { [ key: CompoundID ]: Compound; } >; From a0e85e688dc1ae33a88ae7e99ca6b9cac402acba Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:19:52 +0200 Subject: [PATCH 51/53] rework nuclide entity --- types/entity/nuclide.ts | 85 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/types/entity/nuclide.ts b/types/entity/nuclide.ts index 31a0a892..168ba0f8 100644 --- a/types/entity/nuclide.ts +++ b/types/entity/nuclide.ts @@ -1,3 +1,9 @@ +/** + * @file nuclide.ts + * @description Defines the schema for nuclides (isotopes), including their classification, + * stability, and complex decay network structures. + */ + import type { Brand, Expand } from 'devtypes/types/util'; import type { ElementSymbol } from '../../enum/element'; import type { DecayMode, NuclideProperty, NuclideStability, NuclideState, SpinParity } from '../../enum/nuclear'; @@ -7,82 +13,157 @@ import type { DescriptiveCollection } from '../collection/descriptive'; import type { GenericCollection } from '../collection/generic'; import type { NuclearCollection } from '../collection/nuclear'; +/** Formal identifier for a specific isotope or nuclear isomer. */ export type NuclideIdentifier = Brand< `${number}` | `${number}m` | `${number}m${number}`, 'nuclideID' >; +/** + * Fundamental nuclear classification and identification metrics. + */ export type NuclideClassification = Collection< { + /** The chemical element to which this isotope belongs. */ element: Distinct< ElementSymbol >; + /** The number of protons (Z) in the nucleus. */ atomicNumber: Distinct< number >; + /** The number of neutrons (N) in the nucleus. */ neutronNumber: Distinct< number >; + /** The total number of nucleons (A = Z + N) in the nucleus. */ massNumber: Distinct< number >; + /** The energy state of the nucleus (e.g., ground state or meta-stable isomer). */ state: Distinct< NuclideState >; + /** The level of radioactive persistence (Stable vs. Unstable). */ stability: Distinct< NuclideStability >; + /** The symmetry properties and parity of the nuclear spin state. */ parity: Distinct< SpinParity >; + /** List of characteristic properties associated with this specific nuclide. */ properties: Distinct< NuclideProperty[] >; } >; +/** + * Representation of a single nuclide including its nuclear structure data. + */ export type SingleNuclide = Collection< { + /** Human-readable names and historical discovery context. */ descriptive: DescriptiveCollection; + /** Primary nuclear identification and taxonomic data. */ classification: NuclideClassification; + /** Generic, non-scientific data associated with the isotope. */ generic?: GenericCollection; + /** Detailed spectral and energy-level properties of the nucleus. */ nuclear?: NuclearCollection; } >; +/** + * The complete nuclide entity, including metadata. + */ export type Nuclide = Expand< MetaData & SingleNuclide >; +/** + * Global registry of nuclides grouped by element and identified by their mass number. + */ export type NuclideCollection = Collection< { + /** The set of all isotopes associated with a specific chemical element. */ [ K in ElementSymbol ]?: Collection< { [ N in NuclideIdentifier ]?: Nuclide; } >; } >; +/** + * A dense summary record for a specific nuclide used in the auto-generated nuclide index. + */ export type NuclideIndexEntry< Z extends number, N extends number > = Collection< { + /** The unique mass-number based identifier for the isotope. */ nuclide: Distinct< NuclideIdentifier >; + /** The nuclear charge (Proton count). */ z: Distinct< Z >; + /** The neutron count. */ n: Distinct< N >; - m: Distinct< number >; + /** The mass number. */ + a: Distinct< number >; + /** The associated chemical element symbol. */ element: Distinct< ElementSymbol >; + /** Nuclear data for performance optimization and visualization. */ layer: Group< { + /** The characteristic time for half of a sample to decay. */ halfLife?: Distinct< number >; + /** The primary mechanism by which the unstable nucleus transforms. */ mainDecayMode?: Distinct< DecayMode >; + /** The effective root-mean-square radius of the nucleus. */ nuclearRadius?: Distinct< number >; + /** The difference between the actual isotope mass and its mass number. */ massExcess?: Distinct< number >; + /** The physical mass of the neutral atom. */ atomicMass?: Distinct< number >; + /** The energy equivalent of the nuclear mass deficit. */ bindingEnergy?: Distinct< number >; } >; } >; +/** + * A multi-dimensional grid of all isotopes indexed by proton (Z) and neutron (N) count. + * This will be auto-generated from the nuclide collection. + */ export type NuclideIndex = Collection< { [ Z in number ]?: { [ N in number ]?: NuclideIndexEntry< Z, N >; }; } >; +/** + * A directed edge in a nuclear decay network representing a single transformation step. + */ export type NuclideDecayChainLink = Group< { + /** The child nuclide (daughter) resulting from the decay. */ nuclide: Distinct< NuclideIdentifier >; + /** The mode of the radioactive transformation. */ mode: Distinct< DecayMode >; + /** The probability fraction of the parent decaying into this specific daughter. */ probability: Distinct< number | null >; } >; +/** + * Detailed node in a radioactive decay chain, capturing parents and daughters. + */ export type NuclideDecayChainEntry< N extends NuclideIdentifier > = Collection< { + /** The current nuclide in the decay network. */ nuclide: Distinct< N >; + /** The nuclear charge (Proton count). */ z: Distinct< number >; + /** The neutron count. */ n: Distinct< number >; - m: Distinct< number >; + /** The mass number. */ + a: Distinct< number >; + /** The associated chemical element symbol. */ element: Distinct< ElementSymbol >; + /** The characteristic time for half of a sample to decay. */ halfLife: Distinct< number | null >; + /** Whether the decay chain ends at this nuclear state. */ stable: Distinct< boolean >; + /** The possible decay paths leading from this nuclide to daughters. */ daughterChains: Distinct< NuclideDecayChainLink[] >; + /** The possible parent nuclides that decay into this nuclide. */ parentChains: Distinct< NuclideDecayChainLink[] >; + /** The distance from the primordial or starting parent in the network. */ chainDepth: Distinct< number >; + /** Whether this nuclide represents the final stable endpoint. */ isTerminal: Distinct< boolean >; } >; +/** + * The complete network of all isotopic decay relationships in the database. + * This will be auto-generated from the nuclide collection. + */ export type NuclideDecayChains = Collection< { [ N in NuclideIdentifier ]?: NuclideDecayChainEntry< N >; } >; +/** + * The comprehensive entity for all nuclear and isotopic data in the repository. + */ export type NuclideEntity = { + /** Detailed scientific records for each individual nuclide. */ nuclides: NuclideCollection; + /** Auto-generated index for fast lookup by proton/neutron counts. */ index: NuclideIndex; + /** Auto-generated graph of all radioactive decay paths and parent-child relationships. */ decayChains: NuclideDecayChains; }; From 08432bfda047c284c4fb8d01a73562452fdaec05 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:22:28 +0200 Subject: [PATCH 52/53] create DB stats collection --- types/collection/stats.ts | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 types/collection/stats.ts diff --git a/types/collection/stats.ts b/types/collection/stats.ts new file mode 100644 index 00000000..f3ffe2c5 --- /dev/null +++ b/types/collection/stats.ts @@ -0,0 +1,44 @@ +/** + * @file stats.ts + * @description Defines the schema for database metrics, contributor activity, and + * entity distribution statistics. + */ + +import type { Collection, Distinct, Group } from '../abstract/collection'; + +/** + * Registry of database-wide metrics and administrative statistics. + */ +export type StatsCollection = Collection< { + /** The total storage size or relative scale of the data set. */ + size: Distinct< number >; + + /** Metrics regarding the distribution of scientific entities in the repository. */ + entities: Group< { + /** Total number of unique chemical elements documented. */ + elements: Distinct< number >; + /** Total number of unique isotopes (nuclides) and isomers documented. */ + nuclides: Distinct< number >; + /** Total number of chemical compounds in the registry. */ + compounds: Distinct< number >; + /** Total number of distinct mineral species and varieties. */ + minerals: Distinct< number >; + /** Total number of documented chemical mixtures and solutions. */ + mixtures: Distinct< number >; + } >; + + /** + * List of individuals or organizations who have provided data or structural updates. + * The command "git shortlog -snc" will generate this list. + */ + contributors: Distinct< { + /** The official name or alias of the contributor. */ + name: Distinct< string >; + /** The ISO 8601 timestamp of the contributor's most recent change. */ + lastModified: Distinct< string >; + /** The cumulative count of verified data points or structural edits made. */ + edits: Distinct< number >; + /** The primary communication channel or professional URI for the contributor. */ + contact?: Distinct< string >; + }[] >; +} >; From 7542f3d65ef536cb7c4d419ed31bd49dfad32b52 Mon Sep 17 00:00:00 2001 From: komed3 Date: Fri, 17 Apr 2026 16:23:47 +0200 Subject: [PATCH 53/53] Update index.ts --- types/index.ts | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/types/index.ts b/types/index.ts index 0e937fed..f93b963e 100644 --- a/types/index.ts +++ b/types/index.ts @@ -1,4 +1,11 @@ -import type { Collection, Distinct, Group } from './abstract/collection'; +/** + * @file index.ts + * @description The primary entry point for the chemical and physical database schema. + * This file aggregates all entities (Elements, Compounds, Minerals, Mixtures, Nuclides) + * and high-level registries into a single unified data model. + */ + +import type { Collection } from './abstract/collection'; import type { ReferenceCollection } from './abstract/reference'; import type { UnitCollection } from './abstract/unit'; import type { MetaData } from './abstract/util'; @@ -7,35 +14,36 @@ import type { ElementEntity } from './entity/element'; import type { MineralEntity } from './entity/mineral'; import type { MixtureEntity } from './entity/mixture'; import type { NuclideEntity } from './entity/nuclide'; +import type { StatsCollection } from './collection/stats'; -export type StatsCollection = Collection< { - size: Distinct< number >; - entities: Group< { - elements: Distinct< number >; - nuclides: Distinct< number >; - compounds: Distinct< number >; - minerals: Distinct< number >; - mixtures: Distinct< number >; - } >; - contributors: Distinct< { - name: Distinct< string >; - lastModified: Distinct< string >; - edits: Distinct< number >; - contact?: Distinct< string >; - }[] >; -} >; - +/** + * The high-level root of the scientific repository. + * Aggregates metadata, scientific entity data, and global registries (units, references) + * into a single structured object. + */ export type Database = Collection< { + /** Global administrative metadata including internal database statistics. */ meta: Collection< MetaData & { + /** Detailed metrics on entity distribution and contributor activity. */ stats: StatsCollection; } >; + + /** The primary scientific datasets grouped by entity domain. */ data: Collection< { + /** Comprehensive registry of chemical elements and their physical properties. */ elements: ElementEntity; + /** Extensive network of isotopes, nuclear states, and decay relationships. */ nuclides: NuclideEntity; + /** Large-scale collection of chemical compounds and their structural data. */ compounds: CompoundEntity; + /** Geological registry of mineral species and their diagnostic characteristics. */ minerals: MineralEntity; + /** Physical chemistry database for solutions, colloids, and specialized mixtures. */ mixtures: MixtureEntity; } >; + + /** The global registry of physical quantities and their supported scientific units. */ unit: UnitCollection; + /** The centralized repository of all scientific citations and verifiable data sources. */ refs: ReferenceCollection; } >;