-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
61 lines (54 loc) · 1.71 KB
/
main.ts
File metadata and controls
61 lines (54 loc) · 1.71 KB
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
/// <reference lib="dom" />
import type { AppContext, DataContext, CacheType, Schema } from "../../Shared/types.ts";
import { TableComponent } from "../../Components/TableComponent.ts";
import { KvCache } from "../../DataProviders/KvProvider/mod.ts";
// required to register custom web components
export * from "../../Components/FootComponent.ts"
export * from "../../Components/TableComponent.ts"
/**
* A unique schema object
* Note that the data-provider and the UI both use
* this object for auto-configuration.
*
* In the schema-sample, a boolean value will produce a checkbox,
* and a string array will be auto-configured as a select element.
* A number set to -1 will create an uneditable cell
* A string set to "readonly" will also create an uneditable cell
*/
const thisSchema: Schema = {
dbKey: "BP",
keyColumnName:"What",
sampleRecord: {
What: "Z",
When: "",
How: ["Amex", "Checking", "Debit"],
Auto: true,
How_Often: ["Monthly", "Quarterly", "Annual"],
Amount: "",
Paid: "",
Date_Paid: "",
Remarks: ""
}
}
/**
* Our shared app context -> dependency injected below
*/
const appContext: AppContext = {
DEV: false,
PIN: "",
FocusedKey: "",
}
/**
* Our shared data context -> dependency injected below
*/
const dataContext: DataContext = {
LOCAL_DB: false,
LocalDbURL: "http://localhost:9099/",
RemoteDbURL: "https://dt-kv-rpc.deno.dev/",
RpcURL: "SSERPC/kvRegistration",
}
// We build cache first
const cache: CacheType = new KvCache(thisSchema, dataContext, appContext)
/** get a reference to our table-component */
const table = document.getElementById("table-component") as TableComponent
table!.init(thisSchema, appContext, cache)