-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
54 lines (46 loc) · 1.63 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
export interface FrequencyDistribution {
/** No. of Districts. */
districts: string,
/** No. of States/UTs. */
states: number,
/** No. of districts to be selected from each State/UT. */
selected: number,
/** Total No. of districts to be sampled. */
sampled: number
}
/**
* Loads corpus to enable queries.
* [📦](https://www.npmjs.com/package/@ifct2017/frequencydistribution)
* @returns corpus {districts (start) ⇒ {districts, states, selected, sampled}}
*/
export function load() : Map<string, FrequencyDistribution>;
/**
* Generates PostgreSQL statements for creating table w/ data.
* [📦](https://www.npmjs.com/package/@ifct2017/frequencydistribution)
* @returns CREATE TABLE, INSERT, CREATE VIEW, CREATE INDEX statements
*/
export function sql(tab: string='frequencydistribution', opt: object={}) : string;
/**
* Gives path of CSV data file.
* [📦](https://www.npmjs.com/package/@ifct2017/frequencydistribution)
* @returns .../index.csv
*/
export function csv() : string;
/**
* Finds matching frequency distribution for a given no. of districts.
* [📦](https://www.npmjs.com/package/@ifct2017/frequencydistribution)
* @param dis no. of districts
* @returns found ⇒ {districts, states, selected, sampled}, else ⇒ null
* @example
* ```javascript
* frequencyDistribution(2);
* frequencyDistribution(5);
* // { districts: '1-5', states: 9, selected: 1, sampled: 9 }
*
* frequencyDistribution(32);
* frequencyDistribution(37);
* // { districts: '31-40', states: 4, selected: 5, sampled: 20 }
* ```
*/
function frequencyDistribution(dis: number): FrequencyDistribution | null;
export = frequencyDistribution;