diff --git a/src/data/stages.derived.ts b/src/data/stages.derived.ts index 26c4f38..589e451 100644 --- a/src/data/stages.derived.ts +++ b/src/data/stages.derived.ts @@ -2,8 +2,9 @@ // It contains mainly the support types and values that are derived from // the manually entered values. +import { NeverForEmpty } from "../types/NeverForEmpty"; import { TuplifyUnionAnyOrder } from "../types/unionToTuple"; -import { bridgedChainIds, stages } from "./stages"; +import { bridgedChains, stages } from "./stages"; export type Stages = typeof stages; @@ -11,6 +12,8 @@ export type StageId = keyof Stages; export type StageIdsOrder = TuplifyUnionAnyOrder; -export type BridgedChainId = (typeof bridgedChainIds)[number]; +export type BridgedChains = typeof bridgedChains; + +export type BridgedChainId = NeverForEmpty; export type BridgedChainIdsOrder = TuplifyUnionAnyOrder; diff --git a/src/data/stages.internal.ts b/src/data/stages.internal.ts index 5af928a..c00d02c 100644 --- a/src/data/stages.internal.ts +++ b/src/data/stages.internal.ts @@ -4,10 +4,10 @@ // definitions of the data. import { BridgedChainId } from "./stages.derived"; -import { Stage } from "./stages.types"; +import { GeneralBridgedChainInfo, Stage } from "./stages.types"; // Any stages, but each must have same bridged chains. export type StagesShape = Record>; -// Any shape of a list of bridged chain ids. -export type BridgedChainIdsShape = string[]; +// Any shape of a list of global bridged chain info. +export type BridgedChainsShape = Record; diff --git a/src/data/stages.ts b/src/data/stages.ts index c051d79..d059d69 100644 --- a/src/data/stages.ts +++ b/src/data/stages.ts @@ -1,8 +1,8 @@ import { BridgedChainIdsOrder, StageIdsOrder } from "./stages.derived"; -import { BridgedChainIdsShape, StagesShape } from "./stages.internal"; +import { BridgedChainsShape, StagesShape } from "./stages.internal"; // Wait for announcements! -export const bridgedChainIds = [] as const satisfies BridgedChainIdsShape; +export const bridgedChains = {} as const satisfies BridgedChainsShape; export const stages = { mainnet: { diff --git a/src/data/stages.types.ts b/src/data/stages.types.ts index 9d9be4c..4134330 100644 --- a/src/data/stages.types.ts +++ b/src/data/stages.types.ts @@ -20,3 +20,7 @@ export type Stage = { humanode: HumanodeChainInfo; bridged: Record; }; + +export type GeneralBridgedChainInfo = { + generalDisplayName: string; +}; diff --git a/src/types/NeverForEmpty.ts b/src/types/NeverForEmpty.ts new file mode 100644 index 0000000..a9ec5b2 --- /dev/null +++ b/src/types/NeverForEmpty.ts @@ -0,0 +1 @@ +export type NeverForEmpty = T extends object ? never : T;