@mark1russell7/stack-needs 0.8.0 → 0.8.2

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/README.md CHANGED
@@ -16,6 +16,8 @@ Each function is a plain function with no clock, no network and no file.
16
16
  | `CalorieChange` | A stage (for example `pregnancy-2`), a sex, and the change of the daily need at that stage, with the condition of the source. |
17
17
  | `Person` | A group of persons: a sex, an age in whole months, a count and, as options, an activity level and a stage. |
18
18
  | `HouseholdFragment` | A fragment of an endurance layer: the resources, the stores, the draws and their direct uses. It has the form of `EnduranceLayer`. |
19
+ | `CookFragment` | A fragment of an endurance layer: the resources and one cook converter for each dry resource with a read. It has the form of `EnduranceLayer`. |
20
+ | `CookLine` | The energy, the cook water, the heat to boil, the stove time and the fuel of one pot of one dry food, each a read or a no read. |
19
21
 
20
22
  ## The rules of the data
21
23
 
@@ -23,7 +25,7 @@ Each function is a plain function with no clock, no network and no file.
23
25
  2. An age with no row in the tables gives a line with no read for that person, not an error. The total of `calorieNeed` is then a lower limit, and `read` is false.
24
26
  3. The activity level is an explicit input. The package has no default level.
25
27
  4. A stage of pregnancy or lactation is an input of a person record. `calorieNeed` adds the change of the stage to the need of the row. The change comes from the table of the row. A stage that this table does not have for the sex of the record is an error, not a no read. Thus the option `leave-out` cannot remove a pregnant person from a draw. One stage holds for each day of a call. For a period that crosses stages, the planner selects the stage, for example the stage with the largest change.
26
- 5. The package has no cooking converter. No cited source gives the water and the fuel to cook 1 kg of dry food.
28
+ 5. The cook converters come from the cited cook facts of the catalog, a cited stove share and cited constants. A missing fact gives a no read, not a figure. Refer to the section on the water and the fuel of a cook.
27
29
 
28
30
  `checkCalorieTable` is the gate of a table. It gives the findings of `checkSources` of `@mark1russell7/guidebook` for the source, also for a hash that is not 64 lowercase hexadecimal digits (`bad-sha256`). The source of a table must have a publisher (`by`), a page of its terms and a hash, and HTTPS addresses (the options `require` and `https` of the gate). A missing field gives `missing-field`. For the rows, it refuses two rows of one sex with ages in common, and a need that is not above 0 in `kcal/d`. The rows of each sex have no gap between two rows (`needs-gap`). A table can start after month 0 and end at a closed row. Each change has a stage, a title, a sex of the table and a finite value in `kcal/d`. Each stage and sex has one change at most (`needs-change`).
29
31
 
@@ -119,10 +121,68 @@ A stage of lactation is a change with `milk: true`: `lactation-1` and `lactation
119
121
 
120
122
  The fragment has no converter. Thus, with this fragment alone, only `food.no-cook` feeds the draw. This is the worst case: no water and no fuel.
121
123
 
122
- A caller adds the converters for the dry food in a different fragment, with the water and the fuel of each run. Then `joinEndurance` joins the fragments. The dry food then adds days only while the water and the fuel last.
124
+ `cookFragment` gives the converters for the dry food in a different fragment, with the water and the fuel of each pot. Then `joinEndurance` joins the fragments. The dry food then adds days only while the water and the fuel last.
123
125
 
124
126
  This fragment declares the resource codes of the buy list, for example `water.stored` in `L`. A different fragment, for example the fragment of a water tank, can declare the same resource. `joinEndurance` of `@mark1russell7/stack-endurance` joins two equal records into one. A different unit is a fault of the join.
125
127
 
128
+ ## The water and the fuel of a cook
129
+
130
+ `cookFragment` turns the dry food of a buy list into converters of an endurance layer. One run of a converter is one pot. The run takes the dry food, the cook water and the fuel, and gives the food energy of the pot. Thus a dry food with no fuel or no water gives no meal.
131
+
132
+ ```ts
133
+ import { SUPPLY_CATALOG } from "@mark1russell7/market/supplies";
134
+ import { cookFragment } from "@mark1russell7/stack-needs";
135
+
136
+ const cook = cookFragment({
137
+ catalog: SUPPLY_CATALOG,
138
+ units: { "food.rice-white-1kg": 4 },
139
+ // Made-up stove and share: 227 g of propane in 90 min, and 0.5 of the higher heating value.
140
+ stove: { fuel: "fuel.propane", rate: { amount: 227, unit: "g", per: { amount: 90, unit: "min" }, fact: "example.stove" } },
141
+ share: { value: 0.5, heating: "higher", cite: "example.share" },
142
+ batch: { value: 0.5, unit: "kg" },
143
+ });
144
+ // cook.layer has the converter cook:food.grain-dry. Join it with the layer of householdFragment and a store of fuel.
145
+ ```
146
+
147
+ The model of one pot:
148
+
149
+ 1. The cook water is `cookWater` of `@mark1russell7/market` times the dry mass. It takes `water.stored`, the resource of the drinking water.
150
+ 2. The heat to boil is the mass times 4.19002 kJ/(kg.K) times the rise to the boil (100 °C). The mass is the water and the dry food. The rise starts at the start temperature. This temperature is an input with its citation. The default is 0 °C, which gives the most heat. The dry food takes the specific heat of water, which is higher than its own. This term holds the heat above the true value.
151
+ 3. The boil time is the heat divided by the stove rate times the stove share. The share is the part of the stove heat that goes into the water and the food. The heat of the pot itself is in the losses. It is a cited input with its heating value. It has no default.
152
+ 4. The stove time is the boil time plus the high end of the cook time. The cook time starts when the water boils.
153
+ 5. The fuel is a safe upper limit: the stove burns at its full rate for all of the stove time. At a high place the cook time is longer. The model does not give that time, so there the fuel is not an upper limit.
154
+ 6. A rate in a mass gives the fuel mass directly. A rate in an energy gives a mass only through the cited energy of the fuel (`fuelEnergy`), with the same heating value.
155
+ 7. The dry mass of one pot (`batch`) is a plan of the caller. It has no default. Give the smallest pot that the cook makes. Each pot takes its own cook time, so a batch above the real pot gives too little fuel.
156
+
157
+ Each value of a line is a read or a no read with its reasons. These facts give a no read:
158
+
159
+ | Missing fact | The no read |
160
+ | --- | --- |
161
+ | No cited cook water | The water, the heat and the fuel. A food with a cook time and no cited water has no fuel. |
162
+ | No cited cook time | The stove time and the fuel. |
163
+ | No cited stove rate, or a rate that is not an energy or a mass in a time | The stove time and the fuel. |
164
+ | No cited stove share | The stove time and the fuel. The water and the heat keep their reads. |
165
+ | A heating value of the share or of the rate that is not the heating value of the fuel energy | The stove time and the fuel. |
166
+ | No cited energy of the fuel, with a rate in an energy or a share on a rate in a mass | The stove time and the fuel. |
167
+ | No food energy of the product | The energy. |
168
+ | A product that gives more than one food | The energy. The catalog gives one energy for the whole product. |
169
+
170
+ A dry resource with a no read in a line has no converter. It is in `noReads`, and `read` is false. Two products of the list can give one dry resource, for example rice and oats. The converter then takes the worst case of their lines: the most water, the most fuel and the least energy.
171
+
172
+ The catalog of market gives no soak water. Thus a food that needs a soak, for example dry beans, has no soak draw. The beans of the catalog have no cited cook water, so they have no converter.
173
+
174
+ The cook water and the drinking water are one store, `water.stored`. A drinking draw at a higher level takes its water first, by the take order of `enduranceOf`. The drinking draw keeps back its days times its demand, which is all of the store. Thus, when a case cuts the water supply, the dry food adds 0 days at each amount of stored water.
175
+
176
+ The cited constants:
177
+
178
+ | Name | Value | Source |
179
+ | --- | --- | --- |
180
+ | `WATER_SPECIFIC_HEAT` | 4.19002 kJ/(kg.K) | The NIST Guide to the SI (SP 811). Appendix B.8 gives 4.190 02 J for the calorie (mean). The common definition of that calorie is the mean from 0 °C to 100 °C, and SP 811 does not state the range. Footnote 10 tells that the calorie is the energy to raise 1 g of water by 1 °C. |
181
+ | `WATER_DENSITY_MAX` | 1 kg/L | The page Water Density of the USGS Water Science School. Its table gives 1.00000 g/cm3 at 4.0 °C, its largest value. Thus the water mass is an upper limit. |
182
+ | `BOIL_CELSIUS` | 100 °C | The end of the rise. Water boils at a lower temperature at a high place, so the heat is less. But the cook time is longer there, and the model does not give it. Thus at a high place the fuel is not an upper limit. |
183
+
184
+ The two sources are works of the United States federal government (the license `us-public-domain` of guidebook).
185
+
126
186
  ## The uses, the supply parts and the join gate
127
187
 
128
188
  The package holds one record of each use and of each default supply part. `householdFragment` takes its food use from `DIRECT_USES`.
@@ -184,8 +244,28 @@ The report is all rights reserved (the license `all-rights-reserved` of guideboo
184
244
 
185
245
  The 2025-2030 edition of the guidelines was read on 2026-11-24. It has no table of calorie needs. It sends the reader to the DRI calculator of the USDA, and its daily servings start from a calorie level. Thus the table stays the table of the 2020-2025 edition.
186
246
 
247
+ ## The daily needs of the kit
248
+
249
+ `DAILY_NEEDS` gives the needs of the kit items: light, the watch of an alert receiver and warmth. Each need has a cited daily rate, or a no read with its reason. A no read is not 0, and the list keeps it.
250
+
251
+ | Code | Unit | Users | Daily rate |
252
+ | --- | --- | --- | --- |
253
+ | `alert.watch` | `h` | household | 24 `h/d` |
254
+ | `light.see` | `h` | household | no read |
255
+ | `warmth.shelter` | `kWh` | household | no read |
256
+
257
+ - `alert.watch` comes from two pages of the National Weather Service (read on 2026-11-24). Many receivers have a muted standby mode that turns on when a warning comes. Warnings also come at night. Thus a receiver stays on and listens at all hours, so 24 hours each day. One receiver for each home is a choice of this model, not of the pages. The pages are in the public domain (the license `us-public-domain`).
258
+ - `light.see` is a no read. The kit lists of Ready.gov give a flashlight and extra batteries, but no hours of use each day. The hours of dark are the same for all the persons of a home, so the users are the household. The count of lights of each person is a fact of the plan or the device.
259
+ - `warmth.shelter` is a no read. The heat that a home needs changes with the weather, the building and the persons. It is space heat only. The blankets and the sleeping bags of each person are gear, not this need.
260
+ - A user gives each no read as input data.
261
+ - The rate of a device is a fact of the device, not of the need. An example is the watts of a radio in standby.
262
+
263
+ `checkDailyNeeds` is the gate of the list. It gives the findings of `checkSources` of `@mark1russell7/guidebook`. Each source must have a publisher (`by`), a page of its terms and HTTPS addresses. `resultOf` of guidebook tells if the gate passes.
264
+
265
+ The gate refuses an empty code and two needs with one code (`daily-need-id`). It refuses a unit that `@mark1russell7/quantity` does not read (`daily-need-unit`). It also refuses a bad read or a no read with no reason (`daily-need-rate`). A bad read has no source. Or its amount is not a finite number of 0 or more in the unit of the need for each day.
266
+
187
267
  ## The entries
188
268
 
189
269
  | Entry | What it has |
190
270
  | --- | --- |
191
- | `@mark1russell7/stack-needs` | The records, the calorie tables and `CALORIE_CHAIN`, the gates, `calorieNeed`, `householdFragment`, the uses, the supply parts and `checkJoins`. |
271
+ | `@mark1russell7/stack-needs` | The records, the calorie tables and `CALORIE_CHAIN`, the gates, `calorieNeed`, `householdFragment`, `cookFragment` and its constants, the uses, the supply parts and `checkJoins`. |
package/build/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Quantity } from "@mark1russell7/quantity";
2
2
  import { Finding, FindingCode, GateOptions, Source } from "@mark1russell7/guidebook";
3
- import { BuyListEnergy, SupplyCatalog } from "@mark1russell7/market/supplies";
3
+ import { BuyListEnergy, HeatingValue, StoveFacts, SupplyCatalog } from "@mark1russell7/market/supplies";
4
4
  /** The activity levels of the table, as the source names them: sedentary, moderately active and active. */
5
5
  export declare const ACTIVITY_LEVELS: readonly ["sedentary", "moderately-active", "active"];
6
6
  /** An activity level of the table. */
@@ -476,7 +476,7 @@ export type HouseholdFragmentResult = HouseholdFragmentRead | HouseholdFragmentN
476
476
  * `food.no-cook` feeds the food draw, and `food.infant-formula-ready` feeds the formula draw.
477
477
  * - The resources are the resources of the stores and of the direct uses, with the units of the catalog.
478
478
  * - The supply part of each draw is `supply`. Its default is the part of `NEED_SUPPLIES` for the need of the draw.
479
- * - The fragment has no converter. A caller adds converters for the dry food, with the water and the fuel of each run.
479
+ * - The fragment has no converter. `cookFragment` gives the converters for the dry food, with the water and the fuel of each pot.
480
480
  *
481
481
  * A person with no row in the tables gives no layer, because a low rate gives too many days. The default tables give a row for each age.
482
482
  * The option `noRow: "leave-out"` leaves those persons out of the draw. A draw of 0 kcal gives no layer.
@@ -502,4 +502,252 @@ export type HouseholdFragmentResult = HouseholdFragmentRead | HouseholdFragmentN
502
502
  * @throws RangeError when an infant drinks only breast milk and no person of the household has a stage of lactation
503
503
  */
504
504
  export declare function householdFragment(input: HouseholdFragmentInput): HouseholdFragmentResult;
505
+ /** The source of the specific heat of water: the NIST Guide to the SI (Special Publication 811). It is a work of the United States federal government. */
506
+ export declare const NIST_SI_GUIDE_SOURCE: Source;
507
+ /** The source of the density of water: the page Water Density of the USGS Water Science School. It is a work of the United States federal government. */
508
+ export declare const USGS_WATER_DENSITY_SOURCE: Source;
509
+ /** A physical constant of the cook model, with its source and the place of the value in the source. */
510
+ export interface CookConstant {
511
+ readonly value: number;
512
+ readonly unit: string;
513
+ readonly source: Source;
514
+ readonly locator: string;
515
+ /** How the value comes from the source. */
516
+ readonly note: string;
517
+ }
518
+ /**
519
+ * The mean specific heat of liquid water from 0 °C to 100 °C: 4.19002 kJ/(kg.K).
520
+ * The NIST Guide to the SI gives 4.190 02 J for the calorie (mean). The common definition of that calorie is the mean over this range.
521
+ * SP 811 does not state the range. Its footnote 10 tells that the calorie is the energy to raise 1 g of water
522
+ * by 1 kelvin. For the default start (0 °C), the value is the mean of the rise. For a warmer start, the mean of the
523
+ * rise can be a little higher. The model also heats the dry food with this value, above the specific heat of a dry food.
524
+ * That term holds the heat of the pot above the true value.
525
+ */
526
+ export declare const WATER_SPECIFIC_HEAT: CookConstant;
527
+ /**
528
+ * The largest density of liquid water: 1 kg/L. The USGS table gives 1.00000 g/cm3 at 4.0 °C, its largest value.
529
+ * Thus 1 L of cook water is 1 kg or less.
530
+ */
531
+ export declare const WATER_DENSITY_MAX: CookConstant;
532
+ /**
533
+ * The temperature at the end of the heat to boil, in °C.
534
+ * Water boils at a lower temperature at a high place. Then the heat is less.
535
+ * But the cook time is longer there, and the model does not give that time. Thus at a high place the fuel is not an upper limit.
536
+ */
537
+ export declare const BOIL_CELSIUS = 100;
538
+ /**
539
+ * The default start temperature of the cook water, in °C: 0, the freezing point. Liquid water at the pressure of the sea is
540
+ * not colder. Thus the default gives the most heat. A caller gives a warmer start with its citation.
541
+ */
542
+ export declare const COLD_START_CELSIUS = 0;
543
+ /** The start temperature of the cook water, with the citation of the caller, for example a read of the stored water. */
544
+ export interface CookStart {
545
+ /** The temperature in °C, from 0 up to less than `BOIL_CELSIUS`. */
546
+ readonly celsius: number;
547
+ /** The citation of the value: the `id` of a fact or a source of the caller. */
548
+ readonly cite: string;
549
+ }
550
+ /**
551
+ * The stove share is the part of the heat of the fuel that goes into the water and the food of the pot.
552
+ * Its value is from more than 0 to 1, with its citation. The heat of the pot itself is in the losses. `heating` tells the heating value of the fuel energy that the share applies to.
553
+ */
554
+ export interface StoveShare {
555
+ readonly value: number;
556
+ readonly heating: HeatingValue;
557
+ /** The citation of the value: the `id` of a fact or a source of the caller. */
558
+ readonly cite: string;
559
+ }
560
+ /** The inputs of the cook fragment. */
561
+ export interface CookFragmentInput {
562
+ /** The catalog of supplies of `@mark1russell7/market`. */
563
+ readonly catalog: SupplyCatalog;
564
+ /** The count of units of each product of the buy list, by the `id` of the product. */
565
+ readonly units: Readonly<Record<string, number>>;
566
+ /** The stove: the `id` of a product of the catalog with stove facts, or the cited stove facts of the caller. */
567
+ readonly stove: string | StoveFacts;
568
+ /**
569
+ * The dry mass of the food of one pot, for example `{ "value": 0.5, "unit": "kg" }`. It is a plan of the caller. It has no default.
570
+ * Give the smallest pot that the cook makes. A batch above the real pot gives too little fuel, because each pot takes its own cook time.
571
+ */
572
+ readonly batch: Quantity;
573
+ /** The stove share. Without it, the fuel of the boil is a no read, so each fuel is a no read. It has no default. */
574
+ readonly share?: StoveShare | undefined;
575
+ /** The start temperature of the cook water. The default is `COLD_START_CELSIUS`. */
576
+ readonly start?: CookStart | undefined;
577
+ /** The `id` of the stove in the stack. The converters stop when the stove stops. */
578
+ readonly device?: string | undefined;
579
+ /** The start of the `id` of each converter. The default is `cook`. */
580
+ readonly prefix?: string | undefined;
581
+ }
582
+ /** A value of the cook model with a read, in its unit, or no read with the reasons. A no read is not 0. */
583
+ export type CookRead = {
584
+ readonly read: true;
585
+ readonly value: number;
586
+ readonly unit: string;
587
+ } | {
588
+ readonly read: false;
589
+ readonly why: string;
590
+ };
591
+ /** The cook values of one dry food of the buy list, for one pot. */
592
+ export interface CookLine {
593
+ readonly product: string;
594
+ /** The dry resource of the product, for example `food.grain-dry`. */
595
+ readonly resource: string;
596
+ /** The food energy of the dry food, in `kcal/kg`. */
597
+ readonly energy: CookRead;
598
+ /** The cook water, in `L/kg` of dry food, from `cookWater` of market. */
599
+ readonly water: CookRead;
600
+ /** The heat to boil the cook water of one pot, in `kJ`. */
601
+ readonly heat: CookRead;
602
+ /** The time of the stove for one pot: the boil time and the high end of the cook time, in `min`. */
603
+ readonly minutes: CookRead;
604
+ /** The fuel of one pot, in `kg`. */
605
+ readonly fuel: CookRead;
606
+ }
607
+ /** A converter of the cook fragment, with the form of `Converter` of `@mark1russell7/stack-endurance`. */
608
+ export interface FragmentConverter {
609
+ readonly id: string;
610
+ readonly device?: string | undefined;
611
+ readonly takes: readonly {
612
+ readonly resource: string;
613
+ readonly amount: number;
614
+ }[];
615
+ readonly gives: {
616
+ readonly need: string;
617
+ readonly amount: number;
618
+ };
619
+ }
620
+ /** The cook fragment of an endurance layer: the resources and one converter for each dry resource with a read. It has no store and no draw. */
621
+ export interface CookFragment {
622
+ /** The format of an endurance layer, `endurance/1`. */
623
+ readonly schema: "endurance/1";
624
+ readonly levels: readonly string[];
625
+ readonly resources: readonly {
626
+ readonly code: string;
627
+ readonly unit: string;
628
+ }[];
629
+ readonly stores: readonly never[];
630
+ readonly draws: readonly never[];
631
+ readonly converters: readonly FragmentConverter[];
632
+ }
633
+ /** A dry resource of the buy list with no converter, and the reasons. */
634
+ export interface CookNoRead {
635
+ readonly resource: string;
636
+ readonly why: string;
637
+ }
638
+ /** The cook fragment, the line of each dry food and the dry resources with no converter. */
639
+ export interface CookFragmentResult {
640
+ readonly layer: CookFragment;
641
+ /** The line of each dry food of the buy list, in the order of the list. */
642
+ readonly lines: readonly CookLine[];
643
+ /** The dry resources with no converter. Their dry food gives no meal in the layer. */
644
+ readonly noReads: readonly CookNoRead[];
645
+ /** True when each dry resource of the buy list has a converter. When it is false, the cooked days are a lower limit. */
646
+ readonly read: boolean;
647
+ }
648
+ /**
649
+ * This function gives the converters that cook the dry food of a buy list, with the water and the fuel of each pot.
650
+ *
651
+ * - One run of a converter is one pot of `batch`. It takes the dry food, the cook water from `water.stored` and the fuel of the stove.
652
+ * It gives the food energy of the pot to the need `food.energy`. Thus a dry food with no fuel or no water gives no meal.
653
+ * - The cook water is `cookWater` of market times the dry mass. It is the resource of the drinking water.
654
+ * - The heat to boil is the mass of the water and the dry food times `WATER_SPECIFIC_HEAT` times the rise from the start to `BOIL_CELSIUS`.
655
+ * The water mass takes `WATER_DENSITY_MAX`. The dry food takes the specific heat of water, which is higher than its own.
656
+ * - The boil time is the heat divided by the stove rate times the share. The time of the stove is the boil time plus the high end of the cook time.
657
+ * - The fuel is a safe upper limit: the stove burns at its full rate for all of that time. At a high place the cook time is longer.
658
+ * The model does not give that time, so there the fuel is not an upper limit.
659
+ * - A rate in a mass gives the fuel directly. A rate in an energy gives a mass only through the cited energy of the fuel, with the same heating value.
660
+ *
661
+ * A dry food is a gift of a food resource in a unit of mass. Each missing fact gives a line with no read and its reasons, not a figure.
662
+ * Two products of the list can give one dry resource, for example rice and oats. The converter then takes the worst case of their lines:
663
+ * the most water, the most fuel and the least food energy. When a line of the resource has no read, the resource has no converter.
664
+ * A store of the resource from a different fragment gets the converter of this list.
665
+ *
666
+ * The catalog of market gives no soak water. A food that needs a soak, for example dry beans, has a second water draw that this function does not give.
667
+ * A product that gives more than one food has no energy for each food, so its energy is a no read.
668
+ *
669
+ * The cook water is `water.stored`, the store of the drinking water. A drinking draw at a higher level of the same store takes
670
+ * its water first, by the take order of `enduranceOf`. The drinking draw keeps back its days times its demand, which is all of the store.
671
+ * Thus, when a case cuts the water supply, the dry food adds 0 days at each amount of stored water.
672
+ *
673
+ * The function is pure.
674
+ *
675
+ * @param input - The catalog and the buy list, the stove, the dry mass of one pot, the share and the start temperature
676
+ * @returns The fragment, the line of each dry food and the dry resources with no converter
677
+ * @throws RangeError when the batch is not a mass above 0, or when the share is not above 0 and up to 1
678
+ * @throws RangeError when the start is not from 0 up to less than 100 °C
679
+ * @throws RangeError when the stove is a product with no stove facts
680
+ * @throws RangeError when the catalog has no product of an `id` of the buy list
681
+ * @throws RangeError when the catalog has no resource of the fuel in a unit of mass
682
+ * @throws RangeError when a converter has a read and the catalog has no resource `water.stored` in a unit of volume
683
+ * @throws RangeError for the errors of `giftsOf`
684
+ */
685
+ export declare function cookFragment(input: CookFragmentInput): CookFragmentResult;
686
+ /** The code of the need of light to see in the dark in a home, in hours. */
687
+ export declare const LIGHT_NEED = "light.see";
688
+ /** The code of the need of an alert receiver that is on, in hours. */
689
+ export declare const ALERT_WATCH_NEED = "alert.watch";
690
+ /** The code of the need of the space heat of a home, in `kWh`. The blankets and the sleeping bags of each person are gear, not this need. */
691
+ export declare const WARMTH_NEED = "warmth.shelter";
692
+ /** The users of a daily rate: each person, or each household. */
693
+ export type DailyNeedUsers = "person" | "household";
694
+ /** A daily rate with a read: an amount for each day, its sources and what the sources tell. */
695
+ export interface DailyRateRead {
696
+ readonly read: true;
697
+ /** The amount for each user each day, in the unit of the need for each day, for example `h/d`. */
698
+ readonly perDay: Quantity;
699
+ readonly sources: readonly Source[];
700
+ /** This text tells how the sources give the amount. */
701
+ readonly note: string;
702
+ }
703
+ /** A daily rate with no read, and the reason. A no read is not 0. */
704
+ export interface DailyRateNoRead {
705
+ readonly read: false;
706
+ readonly why: string;
707
+ }
708
+ /** A need of the kit, its unit, its users and its daily rate. */
709
+ export interface DailyNeed {
710
+ /** The code of the need, in the form `<area>.<what>`. */
711
+ readonly code: string;
712
+ /** The unit of the need, in the grammar of `@mark1russell7/quantity`. */
713
+ readonly unit: string;
714
+ readonly users: DailyNeedUsers;
715
+ readonly rate: DailyRateRead | DailyRateNoRead;
716
+ }
717
+ /** The page of the National Weather Service on the receivers of NOAA Weather Radio. It is a work of the United States federal government. */
718
+ export declare const NWS_RECEIVERS_SOURCE: Source;
719
+ /** The page of the National Weather Service on the alarms of NOAA Weather Radio. It is a work of the United States federal government. */
720
+ export declare const NWS_ALARMS_SOURCE: Source;
721
+ /**
722
+ * The daily needs of the kit, with a cited rate or a no read.
723
+ *
724
+ * - `alert.watch`: 24 hours each day for each household. The sources give a standby mode that turns on at an alert, and warnings at night.
725
+ * Thus a receiver stays on at all hours to get a warning. One receiver for each home is a choice of this model.
726
+ * - `light.see`: no read, for each household. The kit lists of official sources give a flashlight and extra batteries, but no hours of use.
727
+ * The count of lights of each person is a fact of the plan or the device.
728
+ * - `warmth.shelter`: no read. The heat of a home changes with the weather, the building and the persons. It is space heat only.
729
+ */
730
+ export declare const DAILY_NEEDS: readonly DailyNeed[];
731
+ /**
732
+ * These are the codes of the gate of the daily needs. Each code is an error. The gate of the sources of `@mark1russell7/guidebook` gives its own codes.
733
+ *
734
+ * - `daily-need-id`: a need has an empty code, or a different need has its code.
735
+ * - `daily-need-unit`: the unit of a need is not a unit of `@mark1russell7/quantity`.
736
+ * - `daily-need-rate`: a read has no source. Or its amount is not a finite number of 0 or more in the unit of the need for each day.
737
+ * Or a no read has no reason.
738
+ */
739
+ export declare const DAILY_NEED_CODES: readonly ["daily-need-id", "daily-need-unit", "daily-need-rate"];
740
+ /** A code of the gate of the daily needs. */
741
+ export type DailyNeedCode = (typeof DAILY_NEED_CODES)[number];
742
+ /** A finding of the gate of the daily needs: a finding of the gate of the sources, or a finding of a need. */
743
+ export type DailyNeedFinding = Finding<DailyNeedCode | FindingCode, "source" | "unit" | "need">;
744
+ /**
745
+ * This function gives each finding of a list of daily needs. `resultOf` of `@mark1russell7/guidebook` tells if the gate passes.
746
+ *
747
+ * Each source must have a publisher (`by`) and a page of its terms, with HTTPS addresses. The findings are in the order of the list. The function is pure.
748
+ *
749
+ * @param needs - The daily needs, for example `DAILY_NEEDS`
750
+ * @param options - The options of the gate of the sources, for example the date of the gate
751
+ */
752
+ export declare function checkDailyNeeds(needs: readonly DailyNeed[], options?: GateOptions): DailyNeedFinding[];
505
753
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/calorie.ts","../src/data.ts","../src/check.ts","../src/uses.ts","../src/household.ts"],"mappings":";;;;qBAQa;;YAGD,wBAAwB;;qBAGvB;;YAGD,qBAAqB;;;;;YAMrB;WAAyB,QAAQ,SAAS,OAAO,eAAe;WAAqB;;WAA4B,MAAM;WAAmB;;;iBAGrI;WACN,KAAK;;WAEL;;WAEA;;WAEA;WACA,MAAM;;;;;;iBAOA;;WAEN;;WAEA;;WAEA,KAAK;;WAEL,QAAQ;;WAER;;WAEA;;;iBAIM;;WAEN;WACA;WACA,QAAQ;;WAER;;WAEA,eAAe;;WAEf,mBAAmB;;;;;;YAOlB,gBAAgB,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ACT,eAAe,qBACf,UAAU,SAAS,yBACnB,YAAY,iBACX;;iBC9Hc;WACN;WACA;;;iBAIM;WACN;WACA;WACA;;;iBAIM;WACN;WACA;;WAEA;;WAEA;WACA;;;iBAIM;;WAEN;WACA;WACA,oBAAoB;WACpB,iBAAiB;WACjB,gBAAgB;WAChB,iBAAiB;;;qBAIf;;;;;qBAMA;;;;;qBAMA;;YAGD;;iBAGK;;WAEN,kBAAkB;;WAElB,UAAU;;WAEV,SAAS;;WAET,OAAO,SAAS;;WAEhB;;WAEA,gBAAgB;;WAEhB;;WAEA;;WAEA,QAAQ;;WAER;;;;;WAKA,QAAQ;;;iBAIF;WACN;WACA;WACA;;;iBAIM;;WAEN,QAAQ;;WAER,kBAAkB;;WAElB;;;iBAIM,8BAA8B;WACpC,OAAO;;;;;;WAMP,MAAM;;WAEN;;;;;WAKA,kBAAkB;;;;;WAKlB,kBAAkB;;;;;WAKlB,qBAAqB;;;iBAIf,gCAAgC;WACtC;;WAEA,MAAM;WACN;;WAEA,gBAAgB;;WAEhB,kBAAkB;;WAElB,qBAAqB;;WAErB;;;YAIC,0BAA0B,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoE9C,kBAAkB,OAAO,yBAAyB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/calorie.ts","../src/data.ts","../src/check.ts","../src/uses.ts","../src/household.ts","../src/cook.ts","../src/daily.ts"],"mappings":";;;;qBAQa;;YAGD,wBAAwB;;qBAGvB;;YAGD,qBAAqB;;;;;YAMrB;WAAyB,QAAQ,SAAS,OAAO,eAAe;WAAqB;;WAA4B,MAAM;WAAmB;;;iBAGrI;WACN,KAAK;;WAEL;;WAEA;;WAEA;WACA,MAAM;;;;;;iBAOA;;WAEN;;WAEA;;WAEA,KAAK;;WAEL,QAAQ;;WAER;;WAEA;;;iBAIM;;WAEN;WACA;WACA,QAAQ;;WAER;;WAEA,eAAe;;WAEf,mBAAmB;;;;;;YAOlB,gB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