cheminfo-types
Advanced tools
Comparing version 1.7.1 to 1.7.2
export interface ICPDilution { | ||
factor?: number; | ||
solvent?: string; | ||
} | ||
export interface ICPResult { | ||
element: string; | ||
wavelength?: Value; | ||
experimentalConcentration?: Value; | ||
dilution?: ICPDilution; | ||
sampleConcentration?: Value; | ||
} | ||
/** | ||
@@ -55,2 +42,30 @@ * Describe a variable that can only contains as data an array of number | ||
export interface MeasurementXY<DataType extends DoubleArray = DoubleArray> { | ||
/** | ||
* A unique identifier for the measurement, preferably a UUID. | ||
*/ | ||
id?: string; | ||
/** | ||
* Variables containing the data of the measurement. | ||
* It must contain at least the variable `x` and `y` | ||
*/ | ||
variables: MeasurementXYVariables<DataType>; | ||
/** | ||
* Title of the experiment. Often contains the sample code | ||
*/ | ||
title?: string; | ||
/** | ||
* May contain the type of data. This is practical when you have a bunch of data | ||
* of different types | ||
*/ | ||
dataType?: string; | ||
settings?: { | ||
instrument?: Instrument; | ||
[key: string]: any; | ||
}; | ||
meta?: Record<string, any>; | ||
derived?: Record<string, any>; | ||
} | ||
export interface MeasurementXYVariables< | ||
@@ -86,49 +101,2 @@ DataType extends DoubleArray = DoubleArray, | ||
} | ||
export interface MeasurementXY<DataType extends DoubleArray = DoubleArray> { | ||
/** | ||
* A unique identifier for the measurement, preferably a UUID. | ||
*/ | ||
id?: string; | ||
/** | ||
* Variables containing the data of the measurement. | ||
* It must contain at least the variable `x` and `y` | ||
*/ | ||
variables: MeasurementXYVariables<DataType>; | ||
/** | ||
* Title of the experiment. Often contains the sample code | ||
*/ | ||
title?: string; | ||
/** | ||
* May contain the type of data. This is practical when you have a bunch of data | ||
* of different types | ||
*/ | ||
dataType?: string; | ||
settings?: { | ||
instrument?: Instrument; | ||
[key: string]: any; | ||
}; | ||
meta?: Record<string, any>; | ||
derived?: Record<string, any>; | ||
} | ||
/**Describes the location of some object. */ | ||
export interface Location { | ||
/** Name of the institution | ||
* @TJS-examples ["EPFL", "Heriot-Watt University"] | ||
*/ | ||
entity: string; | ||
/** Name or code of the building | ||
* @TJS-examples ["I17", "Main building"] | ||
*/ | ||
building?: string; | ||
/**Name or code of the room in which the object is localized | ||
* @TJS-examples ["1 B3", "Lab 1"] | ||
*/ | ||
room?: string; | ||
/** Internal code that is used to identify the location | ||
* @TJS-examples ["I17 1 B3"] | ||
*/ | ||
code: string; | ||
} | ||
/** | ||
@@ -147,86 +115,11 @@ * Quantity that is defined as range, e.g., melting point | ||
} | ||
/** | ||
* Defines 2 limits as numbers | ||
*/ | ||
export interface FromTo { | ||
from: number; | ||
to: number; | ||
export interface OCLMolecule { | ||
idCode: string; | ||
coordinates?: string; | ||
index?: number[]; // should be 16 numbers in fact | ||
} | ||
/** | ||
* Many libraries use a logger interface to log information about the processing | ||
* This logger is expected to be compatible with the one from the `pino` library | ||
*/ | ||
export interface Logger { | ||
child(bindings?: Record<string, any>): Logger; | ||
trace(obj: Record<string, unknown>, message: string): void; | ||
trace(message: string): void; | ||
trace(error: Error): void; | ||
trace(value: unknown, message?: string): void; | ||
debug(obj: Record<string, unknown>, message: string): void; | ||
debug(message: string): void; | ||
debug(error: Error): void; | ||
debug(value: unknown, message?: string): void; | ||
info(obj: Record<string, unknown>, message: string): void; | ||
info(message: string): void; | ||
info(error: Error): void; | ||
info(value: unknown, message?: string): void; | ||
warn(obj: Record<string, unknown>, message: string): void; | ||
warn(message: string): void; | ||
warn(error: Error): void; | ||
warn(value: unknown, message?: string): void; | ||
error(obj: Record<string, unknown>, message: string): void; | ||
error(message: string): void; | ||
error(error: Error): void; | ||
error(value: unknown, message?: string): void; | ||
fatal(obj: Record<string, unknown>, message: string): void; | ||
fatal(message: string): void; | ||
fatal(error: Error): void; | ||
fatal(value: unknown, message?: string): void; | ||
} | ||
export interface PointXY { | ||
a?: number; | ||
b?: number; | ||
c?: number; | ||
d?: number; | ||
e?: number; | ||
f?: number; | ||
g?: number; | ||
h?: number; | ||
i?: number; | ||
j?: number; | ||
k?: number; | ||
l?: number; | ||
m?: number; | ||
n?: number; | ||
o?: number; | ||
p?: number; | ||
q?: number; | ||
r?: number; | ||
s?: number; | ||
t?: number; | ||
u?: number; | ||
v?: number; | ||
w?: number; | ||
x: number; | ||
y: number; | ||
z?: number; | ||
} | ||
/** | ||
* In order to store an array of numbers we prefer to either use native javascript | ||
* arrays or to use Float64Array | ||
*/ | ||
export type DoubleArray = number[] | Float64Array; | ||
/** | ||
* A type that allows one uppercase or lowercase letter | ||
*/ | ||
export type OneLowerCase = | ||
export type OneLetter = | ||
| 'a' | ||
@@ -257,7 +150,3 @@ | 'b' | ||
| 'y' | ||
| 'z'; | ||
/** | ||
* A type that allows one uppercase or lowercase letter | ||
*/ | ||
export type OneUpperCase = | ||
| 'z' | ||
| 'A' | ||
@@ -289,71 +178,6 @@ | 'B' | ||
| 'Z'; | ||
/** The instrument with which a spectrum was measured. | ||
* CHMO: 0000998 | ||
*/ | ||
export interface Instrument { | ||
/** The name of the instrument. | ||
* @TJS-examples ["BELSORP MAX II"] | ||
*/ | ||
model: string; | ||
/** The name of the instrument manufacturer | ||
* @TJS-examples ["Microtrac Retsch GmbH", "Bruker"] | ||
*/ | ||
manufacturer: string; | ||
/** The INTERNAL serial number of the instrument, e.g., the inventory number of the instrument in a university | ||
* @TJS-examples ["B105863"] | ||
*/ | ||
serialNumber?: string; | ||
/** Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers. | ||
* @TJS-examples ["345"] | ||
*/ | ||
sku?: string; | ||
/** The name of the software and the version number | ||
* @TJS-examples ["BELMaster™ 7"] | ||
*/ | ||
software?: Software; | ||
location?: Location; | ||
} | ||
export interface DataXY<DataType extends DoubleArray = DoubleArray> { | ||
/** | ||
* Array of numbers on x axis | ||
*/ | ||
x: DataType; | ||
/** | ||
* Array of numbers on y axis | ||
*/ | ||
y: DataType; | ||
} | ||
/** Value with units as https://schema.org/Value */ | ||
export interface Value { | ||
/** The value of the quantitative value or property value node. | ||
* @TJS-examples [0, 1000, 1345.24456, -10, -100] | ||
*/ | ||
value: number; | ||
/** */ | ||
precision?: number; | ||
/**A string or text indicating the unit of measurement. The unit could be validated in the input form based on the UN/CEFACT Common Code list */ | ||
units?: string; | ||
} | ||
export type NumberArray = | ||
| number[] | ||
| Int8Array | ||
| Uint8Array | ||
| Uint8ClampedArray | ||
| Int16Array | ||
| Uint16Array | ||
| Int32Array | ||
| Uint32Array | ||
| Float32Array | ||
| Float64Array; | ||
export interface OCLMolecule { | ||
idCode: string; | ||
coordinates?: string; | ||
index?: number[]; // should be 16 numbers in fact | ||
} | ||
/** | ||
* A type that allows one uppercase or lowercase letter | ||
*/ | ||
export type OneLetter = | ||
export type OneLowerCase = | ||
| 'a' | ||
@@ -384,3 +208,101 @@ | 'b' | ||
| 'y' | ||
| 'z' | ||
| 'z'; | ||
export interface Software { | ||
/** Version of the software instance. | ||
* @TJS-examples ['v0.0.1', 'rev111'] | ||
*/ | ||
version?: string; | ||
/** The name of the item. | ||
* @TJS-examples ['tga-analysis', 'ChemDraw'] | ||
*/ | ||
name: string; | ||
/** A description of the item. */ | ||
description?: string; | ||
/** If the file can be downloaded, URL to download the binary | ||
* @TJS-examples ['https://github.com/cheminfo/tga-spectrum/releases/tag/v0.16.0'] | ||
*/ | ||
url?: string; | ||
} | ||
/** | ||
* In order to store an array of numbers we prefer to either use native javascript | ||
* arrays or to use Float64Array | ||
*/ | ||
export type DoubleArray = number[] | Float64Array; | ||
export type NumberArray = | ||
| number[] | ||
| Int8Array | ||
| Uint8Array | ||
| Uint8ClampedArray | ||
| Int16Array | ||
| Uint16Array | ||
| Int32Array | ||
| Uint32Array | ||
| Float32Array | ||
| Float64Array; | ||
export interface PointXY { | ||
a?: number; | ||
b?: number; | ||
c?: number; | ||
d?: number; | ||
e?: number; | ||
f?: number; | ||
g?: number; | ||
h?: number; | ||
i?: number; | ||
j?: number; | ||
k?: number; | ||
l?: number; | ||
m?: number; | ||
n?: number; | ||
o?: number; | ||
p?: number; | ||
q?: number; | ||
r?: number; | ||
s?: number; | ||
t?: number; | ||
u?: number; | ||
v?: number; | ||
w?: number; | ||
x: number; | ||
y: number; | ||
z?: number; | ||
} | ||
export interface PeakXYWidth { | ||
x: number; | ||
y: number; | ||
width: number; | ||
} | ||
/** | ||
* Defines 2 limits as numbers | ||
*/ | ||
export interface FromToXY { | ||
from: PointXY; | ||
to: PointXY; | ||
} | ||
/**Describes the location of some object. */ | ||
export interface Location { | ||
/** Name of the institution | ||
* @TJS-examples ["EPFL", "Heriot-Watt University"] | ||
*/ | ||
entity: string; | ||
/** Name or code of the building | ||
* @TJS-examples ["I17", "Main building"] | ||
*/ | ||
building?: string; | ||
/**Name or code of the room in which the object is localized | ||
* @TJS-examples ["1 B3", "Lab 1"] | ||
*/ | ||
room?: string; | ||
/** Internal code that is used to identify the location | ||
* @TJS-examples ["I17 1 B3"] | ||
*/ | ||
code: string; | ||
} | ||
export type BinaryData = ArrayBuffer | Uint8Array; | ||
/** | ||
* A type that allows one uppercase or lowercase letter | ||
*/ | ||
export type OneUpperCase = | ||
| 'A' | ||
@@ -412,26 +334,29 @@ | 'B' | ||
| 'Z'; | ||
export interface Software { | ||
/** Version of the software instance. | ||
* @TJS-examples ['v0.0.1', 'rev111'] | ||
/** The instrument with which a spectrum was measured. | ||
* CHMO: 0000998 | ||
*/ | ||
export interface Instrument { | ||
/** The name of the instrument. | ||
* @TJS-examples ["BELSORP MAX II"] | ||
*/ | ||
version?: string; | ||
/** The name of the item. | ||
* @TJS-examples ['tga-analysis', 'ChemDraw'] | ||
model: string; | ||
/** The name of the instrument manufacturer | ||
* @TJS-examples ["Microtrac Retsch GmbH", "Bruker"] | ||
*/ | ||
name: string; | ||
/** A description of the item. */ | ||
description?: string; | ||
/** If the file can be downloaded, URL to download the binary | ||
* @TJS-examples ['https://github.com/cheminfo/tga-spectrum/releases/tag/v0.16.0'] | ||
manufacturer: string; | ||
/** The INTERNAL serial number of the instrument, e.g., the inventory number of the instrument in a university | ||
* @TJS-examples ["B105863"] | ||
*/ | ||
url?: string; | ||
serialNumber?: string; | ||
/** Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers. | ||
* @TJS-examples ["345"] | ||
*/ | ||
sku?: string; | ||
/** The name of the software and the version number | ||
* @TJS-examples ["BELMaster™ 7"] | ||
*/ | ||
software?: Software; | ||
location?: Location; | ||
} | ||
/** | ||
* Defines 2 limits as numbers | ||
*/ | ||
export interface FromToXY { | ||
from: PointXY; | ||
to: PointXY; | ||
} | ||
export type NumberMatrix = | ||
@@ -448,9 +373,71 @@ | number[][] | ||
| Float64Array[]; | ||
export type BinaryData = ArrayBuffer | Uint8Array; | ||
export interface PeakXYWidth { | ||
x: number; | ||
y: number; | ||
width: number; | ||
/** Value with units as https://schema.org/Value */ | ||
export interface Value { | ||
/** The value of the quantitative value or property value node. | ||
* @TJS-examples [0, 1000, 1345.24456, -10, -100] | ||
*/ | ||
value: number; | ||
/** */ | ||
precision?: number; | ||
/**A string or text indicating the unit of measurement. The unit could be validated in the input form based on the UN/CEFACT Common Code list */ | ||
units?: string; | ||
} | ||
/** | ||
* Defines 2 limits as numbers | ||
*/ | ||
export interface FromTo { | ||
from: number; | ||
to: number; | ||
} | ||
/** | ||
* Many libraries use a logger interface to log information about the processing | ||
* This logger is expected to be compatible with the one from the `pino` library | ||
*/ | ||
export interface Logger { | ||
child(bindings?: Record<string, any>): Logger; | ||
trace(obj: Record<string, unknown>, message: string): void; | ||
trace(message: string): void; | ||
trace(error: Error): void; | ||
trace(value: unknown, message?: string): void; | ||
debug(obj: Record<string, unknown>, message: string): void; | ||
debug(message: string): void; | ||
debug(error: Error): void; | ||
debug(value: unknown, message?: string): void; | ||
info(obj: Record<string, unknown>, message: string): void; | ||
info(message: string): void; | ||
info(error: Error): void; | ||
info(value: unknown, message?: string): void; | ||
warn(obj: Record<string, unknown>, message: string): void; | ||
warn(message: string): void; | ||
warn(error: Error): void; | ||
warn(value: unknown, message?: string): void; | ||
error(obj: Record<string, unknown>, message: string): void; | ||
error(message: string): void; | ||
error(error: Error): void; | ||
error(value: unknown, message?: string): void; | ||
fatal(obj: Record<string, unknown>, message: string): void; | ||
fatal(message: string): void; | ||
fatal(error: Error): void; | ||
fatal(value: unknown, message?: string): void; | ||
} | ||
export interface DataXY<DataType extends DoubleArray = DoubleArray> { | ||
/** | ||
* Array of numbers on x axis | ||
*/ | ||
x: DataType; | ||
/** | ||
* Array of numbers on y axis | ||
*/ | ||
y: DataType; | ||
} | ||
/** | ||
* case we may have a text, ArrayBuffer or Uint8Array | ||
@@ -463,3 +450,21 @@ * This type is used by the package `ensure-string` to ensure that the data | ||
export type TextData = string | BinaryData; | ||
export interface MinMaxContent { | ||
export interface ICPDilution { | ||
factor?: number; | ||
solvent?: string; | ||
} | ||
export interface ICPResult { | ||
element: string; | ||
wavelength?: Value; | ||
experimentalConcentration?: Value; | ||
dilution?: ICPDilution; | ||
sampleConcentration?: Value; | ||
} | ||
export interface NmrData1D { | ||
x: Float64Array; | ||
re: Float64Array; | ||
im?: Float64Array; | ||
} | ||
export interface NmrData2DContent { | ||
z: Float64Array[]; | ||
@@ -474,14 +479,14 @@ minZ: number; | ||
export type Data2D = Data2DFid | Data2DFt; | ||
export type NmrData2D = NmrData2DFid | NmrData2DFt; | ||
export interface Data2DFid { | ||
re: MinMaxContent; | ||
im?: MinMaxContent; | ||
export interface NmrData2DFid { | ||
re: NmrData2DContent; | ||
im?: NmrData2DContent; | ||
} | ||
export interface Data2DFt { | ||
rr: MinMaxContent; | ||
ri?: MinMaxContent; | ||
ir?: MinMaxContent; | ||
ii?: MinMaxContent; | ||
export interface NmrData2DFt { | ||
rr: NmrData2DContent; | ||
ri?: NmrData2DContent; | ||
ir?: NmrData2DContent; | ||
ii?: NmrData2DContent; | ||
} |
{ | ||
"name": "cheminfo-types", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Types for cheminfo packages and cheminfo data schema ", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14302
459