gps-global-types 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.tsx +4 -0
- package/mst.types.tsx +3 -24
- package/package.json +5 -1
- package/pie.types.tsx +5 -5
- package/tsconfig.json +44 -0
package/index.tsx
CHANGED
package/mst.types.tsx
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { armordAccessionNumber, Color, mrsnId, ObjectId, RegexMatchedString } from "./global.types";
|
|
1
|
+
import type { armordAccessionNumber, Color, mrsnId, ObjectId, RegexMatchedString } from "./global.types.js";
|
|
2
|
+
import type { EdgeType } from "./link.types.js";
|
|
3
|
+
import type { NodeType } from "./pie.types.js";
|
|
2
4
|
|
|
3
5
|
export interface mstGlobalTypes {
|
|
4
6
|
//form values
|
|
@@ -29,29 +31,6 @@ export type labelKey = typeof labelFields[number];
|
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
interface ColorType {
|
|
33
|
-
color:Color, //unique hex of parameter
|
|
34
|
-
value:number //count of how many times value will be represented in the pie
|
|
35
|
-
}
|
|
36
|
-
type LabelType = RegexMatchedString<'(\w&)*'> // if many, seperated by '&' qhich are interpreted as newlines in front-end. var names ends with 'LBL'.
|
|
37
|
-
type DateType = string | Date // must be able to be interpreted as date type by Date js object
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
interface ExtraNodeTypeFields {
|
|
41
|
-
id:ObjectId,//unique identifier referenced by Graph.links and d3 Force. String but it's a string of a mongo id
|
|
42
|
-
beforeAndAfter?:ColorType[] //[=[{color:'#fff',value:1}]] so it doesnt break on recalculation
|
|
43
|
-
dateArr:DateType[], // array of armordCultureDates used for beforeAndAfter coloring
|
|
44
|
-
hover?:String, // [=""] //unique fieldfields \/ \/ list seperated by ', ' (only tier1 alleles for now)
|
|
45
|
-
mrsnIds: String[] // for selection logic between table and node=
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type NodeType = ExtraNodeTypeFields | Record<colorKey|dateKey, ColorType[]> | Record<labelKey, LabelType[]>;
|
|
49
|
-
|
|
50
|
-
interface EdgeType {
|
|
51
|
-
source:string, //node _id edge to
|
|
52
|
-
target:string, //node _id edge from
|
|
53
|
-
value:number //distance between source and target
|
|
54
|
-
}
|
|
55
34
|
|
|
56
35
|
type CustomDictEntry = Record<colorKey|dateKey,Color> | Record<labelKey,string>;
|
|
57
36
|
type CustomDict = Record<ObjectId,CustomDictEntry>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gps-global-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "types shared between front-end and back-end",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,5 +12,9 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"d3": "^7.9.0",
|
|
14
14
|
"react": "^19.1.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/d3": "^7.4.3",
|
|
18
|
+
"typescript": "^5.9.2"
|
|
15
19
|
}
|
|
16
20
|
}
|
package/pie.types.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseType, Selection, SimulationNodeDatum } from "d3"
|
|
2
|
-
import { ObjectId, Color, RegexMatchedString } from "./global.types"
|
|
3
|
-
import { colorKey, dateKey, labelKey } from "./mst.types"
|
|
1
|
+
import type { BaseType, Selection, SimulationNodeDatum } from "d3";
|
|
2
|
+
import type { ObjectId, Color, RegexMatchedString } from "./global.types.tsx"
|
|
3
|
+
import type { colorKey, dateKey, labelKey } from "./mst.types.tsx"
|
|
4
4
|
|
|
5
5
|
export interface ColorField {//TYPES OF GRAPH FIELDS ColorField datefields become colorFields but require additional processing
|
|
6
6
|
color: string, // unique hex or rgb of parameter
|
|
@@ -8,13 +8,13 @@ export interface ColorField {//TYPES OF GRAPH FIELDS ColorField datefields becom
|
|
|
8
8
|
latest?: string // most recent node designation; diff coloring logic for 'latest' nodes
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export type LabelField = string //if n>1, seperated by '&' which are interpreted as newlines in front-end. var names ends with 'LBL'.
|
|
11
|
+
export type LabelField = string; //if n>1, seperated by '&' which are interpreted as newlines in front-end. var names ends with 'LBL'.
|
|
12
12
|
export interface ColorType {
|
|
13
13
|
color: Color, //unique hex of parameter
|
|
14
14
|
value: number //count of how many times value will be represented in the pie
|
|
15
15
|
}
|
|
16
16
|
type LabelType = RegexMatchedString<'(\w&)*'> // if many, seperated by '&' qhich are interpreted as newlines in front-end. var names ends with 'LBL'.
|
|
17
|
-
type DateType = string | Date // must be able to be interpreted as date type by Date js object
|
|
17
|
+
type DateType = string | Date; // must be able to be interpreted as date type by Date js object
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
interface ExtraNodeTypeFields extends SimulationNodeDatum {
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// File Layout
|
|
5
|
+
// "rootDir": "./src",
|
|
6
|
+
// "outDir": "./dist",
|
|
7
|
+
|
|
8
|
+
// Environment Settings
|
|
9
|
+
// See also https://aka.ms/tsconfig/module
|
|
10
|
+
"module": "nodenext",
|
|
11
|
+
"target": "esnext",
|
|
12
|
+
"types": [],
|
|
13
|
+
// For nodejs:
|
|
14
|
+
// "lib": ["esnext"],
|
|
15
|
+
// "types": ["node"],
|
|
16
|
+
// and npm install -D @types/node
|
|
17
|
+
|
|
18
|
+
// Other Outputs
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"declarationMap": true,
|
|
22
|
+
|
|
23
|
+
// Stricter Typechecking Options
|
|
24
|
+
"noUncheckedIndexedAccess": true,
|
|
25
|
+
"exactOptionalPropertyTypes": true,
|
|
26
|
+
|
|
27
|
+
// Style Options
|
|
28
|
+
// "noImplicitReturns": true,
|
|
29
|
+
// "noImplicitOverride": true,
|
|
30
|
+
// "noUnusedLocals": true,
|
|
31
|
+
// "noUnusedParameters": true,
|
|
32
|
+
// "noFallthroughCasesInSwitch": true,
|
|
33
|
+
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
+
|
|
35
|
+
// Recommended Options
|
|
36
|
+
"strict": true,
|
|
37
|
+
"jsx": "react-jsx",
|
|
38
|
+
"verbatimModuleSyntax": true,
|
|
39
|
+
"isolatedModules": true,
|
|
40
|
+
"noUncheckedSideEffectImports": true,
|
|
41
|
+
"moduleDetection": "force",
|
|
42
|
+
"skipLibCheck": true,
|
|
43
|
+
}
|
|
44
|
+
}
|