2022-07-25 14:34:33 +00:00
|
|
|
module ProjectItem = ReducerProject_ProjectItem
|
|
|
|
module ExpressionT = Reducer_Expression_T
|
|
|
|
|
2022-08-22 06:50:59 +00:00
|
|
|
@genType.opaque
|
2022-09-11 15:22:07 +00:00
|
|
|
type project = {
|
|
|
|
items: Belt.MutableMap.String.t<ProjectItem.t>,
|
2022-09-16 20:30:44 +00:00
|
|
|
mutable stdLib: Reducer_Namespace.t,
|
2022-09-11 15:22:07 +00:00
|
|
|
mutable environment: ExpressionT.environment,
|
|
|
|
mutable previousRunOrder: array<string>,
|
|
|
|
}
|
2022-07-25 14:34:33 +00:00
|
|
|
type t = project
|
|
|
|
|
2022-09-11 15:22:07 +00:00
|
|
|
// these functions are used in ReducerProject_Topology, so they are defined here to avoid circular dependencies
|
|
|
|
let getSourceIds = (project: t): array<string> => Belt.MutableMap.String.keysToArray(project.items)
|
2022-08-14 14:14:14 +00:00
|
|
|
|
2022-09-11 15:22:07 +00:00
|
|
|
let getItem = (project: t, sourceId: string) =>
|
|
|
|
Belt.MutableMap.String.getWithDefault(project.items, sourceId, ProjectItem.emptyItem)
|