|
| 1 | + |
| 2 | +/** |
| 3 | + * A loki persistence adapter which persists to web browser's local storage object |
| 4 | + * @constructor LocalStorageAdapter |
| 5 | + */ |
| 6 | +export class LegacyLoader { |
| 7 | + |
| 8 | +} |
| 9 | + // export namespace LokiJS { |
| 10 | + // |
| 11 | + // let r: Loki = { |
| 12 | + // "filename": "test", |
| 13 | + // "collections": [{ |
| 14 | + // "name": "abc", |
| 15 | + // "data": [{"meta": {"revision": 0, "created": 1523392965746, "version": 0}, "$loki": 1}, { |
| 16 | + // "meta": {"revision": 0, "created": 1523392965747, "version": 0}, |
| 17 | + // "$loki": 2 |
| 18 | + // }], |
| 19 | + // "idIndex": [1, 2], |
| 20 | + // "binaryIndices": {"a": {"name": "a", "dirty": false, "values": [0, 1]}}, |
| 21 | + // // "constraints": null, |
| 22 | + // "uniqueNames": ["b"], |
| 23 | + // "transforms": {"abc": [{"type": "find", "value": {"owner": "odin"}}]}, |
| 24 | + // "objType": "abc", |
| 25 | + // "dirty": true, |
| 26 | + // // "cachedIndex": null, |
| 27 | + // // "cachedBinaryIndex": null, |
| 28 | + // // "cachedData": null, |
| 29 | + // "adaptiveBinaryIndices": true, |
| 30 | + // "transactional": false, |
| 31 | + // "cloneObjects": false, |
| 32 | + // "cloneMethod": "parse-stringify", |
| 33 | + // // "asyncListeners": false, |
| 34 | + // "disableMeta": false, |
| 35 | + // "disableChangesApi": true, |
| 36 | + // "disableDeltaChangesApi": true, |
| 37 | + // "autoupdate": false, |
| 38 | + // "serializableIndices": true, |
| 39 | + // // "ttl": null, |
| 40 | + // "maxId": 2, |
| 41 | + // "DynamicViews": [{ |
| 42 | + // // "collection": null, |
| 43 | + // "name": "test3", |
| 44 | + // "rebuildPending": false, |
| 45 | + // "options": {"persistent": true, "sortPriority": "passive", "minRebuildInterval": 1}, |
| 46 | + // "resultset": {/*"collection": null, */"filteredrows": [], "filterInitialized": true}, |
| 47 | + // // "resultdata": [], |
| 48 | + // // "resultsdirty": true, |
| 49 | + // // "cachedresultset": null, |
| 50 | + // "filterPipeline": [{"type": "find", "val": {"age": {"$gt": 24}}}], |
| 51 | + // // "sortFunction": null, |
| 52 | + // "sortCriteria": null, |
| 53 | + // "sortCriteriaSimple": {"propname": "age", "options": false}, |
| 54 | + // "sortDirty": true, |
| 55 | + // // "events": {"rebuild": []} |
| 56 | + // }], |
| 57 | + // "events": { |
| 58 | + // "insert": [null], |
| 59 | + // "update": [null], |
| 60 | + // "pre-insert": [], |
| 61 | + // "pre-update": [], |
| 62 | + // "close": [], |
| 63 | + // "flushbuffer": [], |
| 64 | + // "error": [], |
| 65 | + // "delete": [null], |
| 66 | + // "warning": [null] |
| 67 | + // }, |
| 68 | + // "changes": [] |
| 69 | + // }], |
| 70 | + // "databaseVersion": 1.5, |
| 71 | + // "engineVersion": 1.5, |
| 72 | + // // "autosave": false, |
| 73 | + // // "autosaveInterval": 5000, |
| 74 | + // // "autosaveHandle": null, |
| 75 | + // "throttledSaves": true, |
| 76 | + // // "options": {"serializationMethod": "normal", "destructureDelimiter": "$<\n"}, |
| 77 | + // // "persistenceMethod": "fs", |
| 78 | + // // "persistenceAdapter": null, |
| 79 | + // // "verbose": false, |
| 80 | + // // "events": {"init": [null], "loaded": [], "flushChanges": [], "close": [], "changes": [], "warning": []}, |
| 81 | + // "ENV": "NODEJS" |
| 82 | + // } |
| 83 | + // console.log(r); |
| 84 | + // |
| 85 | + // |
| 86 | + // |
| 87 | + // |
| 88 | + // |
| 89 | + // |
| 90 | + // export interface Loki { |
| 91 | + // filename: string; |
| 92 | + // collections: Collection[]; |
| 93 | + // databaseVersion: 1.5; |
| 94 | + // engineVersion: 1.5; |
| 95 | + // throttledSaves: boolean; |
| 96 | + // ENV: "NODEJS" | "NATIVESCRIPT" | "CORDOVA" | "BROWSER"; |
| 97 | + // } |
| 98 | + // |
| 99 | + // export interface BinaryIndex { |
| 100 | + // name: string; |
| 101 | + // dirty: boolean; |
| 102 | + // values: number[]; |
| 103 | + // } |
| 104 | + // |
| 105 | + // export interface Transform { |
| 106 | + // |
| 107 | + // } |
| 108 | + // |
| 109 | + // |
| 110 | + // export interface Collection { |
| 111 | + // name: string; |
| 112 | + // data: Data[]; |
| 113 | + // idIndex: number[]; |
| 114 | + // binaryIndices: { |
| 115 | + // [key: string]: BinaryIndex |
| 116 | + // }; |
| 117 | + // uniqueNames: string[]; |
| 118 | + // transforms: { |
| 119 | + // [key: string]: Transform; |
| 120 | + // }; |
| 121 | + // objType: string; // ?? |
| 122 | + // dirty: boolean; // ?? |
| 123 | + // adaptiveBinaryIndices: boolean; |
| 124 | + // transactional: boolean; |
| 125 | + // cloneObjects: boolean; |
| 126 | + // cloneMethod: "parse-stringify" | "??"; |
| 127 | + // |
| 128 | + // disableMeta: boolean; |
| 129 | + // disableChangesApi: boolean; |
| 130 | + // disableDeltaChangesApi: boolean; |
| 131 | + // autoupdate: boolean; |
| 132 | + // serializableIndices: boolean; |
| 133 | + // maxId: number; |
| 134 | + // DynamicViews: DynamicView[]; |
| 135 | + // events: {}; |
| 136 | + // changes: any[]; |
| 137 | + // } |
| 138 | + // |
| 139 | + // export interface SimplesortOptions { |
| 140 | + // desc?: boolean; |
| 141 | + // disableIndexIntersect?: boolean; |
| 142 | + // forceIndexIntersect?: boolean; |
| 143 | + // useJavascriptSorting?: boolean; |
| 144 | + // } |
| 145 | + // |
| 146 | + // export interface DynamicView { |
| 147 | + // name: string; |
| 148 | + // rebuildPending: boolean; |
| 149 | + // options: { |
| 150 | + // persistent: true, |
| 151 | + // sortPriority: "passive" | "active", |
| 152 | + // minRebuildInterval: number; |
| 153 | + // }; |
| 154 | + // resultset: ResultSet; |
| 155 | + // filterPipeline: { |
| 156 | + // type: "find", |
| 157 | + // val: any; |
| 158 | + // } | { |
| 159 | + // type: "where" |
| 160 | + // }; |
| 161 | + // sortCriteria: (string | [string, boolean])[]; |
| 162 | + // sortCriteriaSimple: { |
| 163 | + // propname: string; |
| 164 | + // options: boolean | SimplesortOptions; |
| 165 | + // }; |
| 166 | + // sortDirty: boolean; |
| 167 | + // } |
| 168 | + // |
| 169 | + // export interface ResultSet { |
| 170 | + // filteredrows: number[]; |
| 171 | + // filterInitialized: boolean; |
| 172 | + // } |
| 173 | + // |
| 174 | + // export interface Data { |
| 175 | + // $loki: number; |
| 176 | + // meta: { |
| 177 | + // revision: number; |
| 178 | + // created: number; |
| 179 | + // version: number; |
| 180 | + // updated?: number; |
| 181 | + // }; |
| 182 | + // } |
| 183 | + // |
| 184 | + // export interface Serialization { |
| 185 | + // |
| 186 | + // } |
| 187 | + // } |
| 188 | + // |
0 commit comments