-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
90 lines (82 loc) · 2.38 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
export interface Intake {
/** Column Code. */
code: string,
/** WHO Recommended Dietary Allowance. */
whorda: number,
/** US Estimated Average Requirement. */
usear: number,
/** US Recommended Dietary Allowance (Male). */
usrdam: number,
/** US Recommended Dietary Allowance (Female). */
usrdaf: number,
/** EU Population Reference Intake (Male). */
euprim: number,
/** EU Population Reference Intake (Female). */
euprif: number,
/** Tolerable intake Upper Level (US). */
ulus: number,
/** Tolerable intake Upper Level (EU). */
uleu: number,
/** Tolerable intake Upper Level (Japan). */
uljapan: number
}
/**
* Loads corpus to enable queries.
* [📦](https://www.npmjs.com/package/@ifct2017/intakes)
* @returns corpus {code ⇒ {code, whorda, usear, usrdam, usrdaf, euprim, euprif, ulus, uleu, uljapan}}
*/
export function load(): Map<string, Intake>;
/**
* Generates PostgreSQL statements for creating table w/ data.
* [📦](https://www.npmjs.com/package/@ifct2017/intakes)
* @returns CREATE TABLE, INSERT, CREATE VIEW, CREATE INDEX statements
*/
export function sql(tab: string='intakes', opt: object={}): string;
/**
* Gives path of CSV data file.
* [📦](https://www.npmjs.com/package/@ifct2017/intakes)
* @returns .../index.csv
*/
export function csv(): string;
/**
* Finds matching intakes of an column:code/name/tags query.
* [📦](https://www.npmjs.com/package/@ifct2017/intakes)
* @param txt column:code/name/tags query
* @returns matches [{code, whorda, usear, usrdam, usrdaf, euprim, euprif, ulus, uleu, uljapan}]
* @example
* ```javascript
* intakes('his');
* intakes('Histidine');
* // [{ code: 'his',
* // whorda: -0.01,
* // usear: NaN,
* // usrdam: -0.014,
* // usrdaf: NaN,
* // euprim: NaN,
* // euprif: NaN,
* // ulus: NaN,
* // uleu: NaN,
* // uljapan: NaN }]
*
* intakes('intake of total fibre?');
* intakes('what is rda of total fiber?');
* // [{ code: 'fibtg',
* // whorda: NaN,
* // usear: NaN,
* // usrdam: 38,
* // usrdaf: 25,
* // euprim: NaN,
* // euprif: NaN,
* // ulus: NaN,
* // uleu: NaN,
* // uljapan: NaN }]
*
*
* // Note:
* // +ve value indicates amount in grams.
* // -ve value indicates amount in grams per kg of body weight.
* // NaN indicates no recommentation given.
* ```
*/
function intakes(txt: string): [Intake];
export = intakes;