@dra2020/baseclient 1.0.13 → 1.0.14

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.
Files changed (185) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/dist/all/all.d.ts +36 -0
  4. package/dist/all/allclient.d.ts +18 -0
  5. package/dist/base.js +33010 -0
  6. package/dist/base.js.map +1 -0
  7. package/dist/baseclient.js +8991 -0
  8. package/dist/baseclient.js.map +1 -0
  9. package/dist/context/all.d.ts +1 -0
  10. package/dist/context/context.d.ts +13 -0
  11. package/dist/dbabstract/all.d.ts +1 -0
  12. package/dist/dbabstract/db.d.ts +83 -0
  13. package/dist/dbdynamo/all.d.ts +1 -0
  14. package/dist/dbdynamo/dbdynamo.d.ts +190 -0
  15. package/dist/filterexpr/all.d.ts +1 -0
  16. package/dist/filterexpr/filterexpr.d.ts +64 -0
  17. package/dist/fsm/all.d.ts +1 -0
  18. package/dist/fsm/fsm.d.ts +118 -0
  19. package/dist/fsmfile/all.d.ts +1 -0
  20. package/dist/fsmfile/fsmfile.d.ts +47 -0
  21. package/dist/jsonstream/all.d.ts +1 -0
  22. package/dist/jsonstream/jsonstream.d.ts +130 -0
  23. package/dist/lambda/all.d.ts +1 -0
  24. package/dist/lambda/env.d.ts +10 -0
  25. package/dist/lambda/lambda.d.ts +18 -0
  26. package/dist/logabstract/all.d.ts +1 -0
  27. package/dist/logabstract/log.d.ts +26 -0
  28. package/dist/logclient/all.d.ts +1 -0
  29. package/dist/logclient/log.d.ts +6 -0
  30. package/dist/logserver/all.d.ts +5 -0
  31. package/dist/logserver/log.d.ts +11 -0
  32. package/dist/logserver/logaccum.d.ts +154 -0
  33. package/dist/logserver/logblob.d.ts +24 -0
  34. package/dist/logserver/logconcat.d.ts +55 -0
  35. package/dist/logserver/logkey.d.ts +28 -0
  36. package/dist/memsqs/all.d.ts +4 -0
  37. package/dist/memsqs/client.d.ts +13 -0
  38. package/dist/memsqs/loopback.d.ts +11 -0
  39. package/dist/memsqs/orderedlist.d.ts +19 -0
  40. package/dist/memsqs/queue.d.ts +84 -0
  41. package/dist/memsqs/server.d.ts +37 -0
  42. package/dist/ot-editutil/all.d.ts +2 -0
  43. package/dist/ot-editutil/oteditutil.d.ts +14 -0
  44. package/dist/ot-editutil/otmaputil.d.ts +21 -0
  45. package/dist/ot-js/all.d.ts +9 -0
  46. package/dist/ot-js/otarray.d.ts +111 -0
  47. package/dist/ot-js/otclientengine.d.ts +38 -0
  48. package/dist/ot-js/otcomposite.d.ts +37 -0
  49. package/dist/ot-js/otcounter.d.ts +17 -0
  50. package/dist/ot-js/otengine.d.ts +22 -0
  51. package/dist/ot-js/otmap.d.ts +19 -0
  52. package/dist/ot-js/otserverengine.d.ts +38 -0
  53. package/dist/ot-js/otsession.d.ts +111 -0
  54. package/dist/ot-js/ottypes.d.ts +29 -0
  55. package/dist/poly/all.d.ts +15 -0
  56. package/dist/poly/blend.d.ts +1 -0
  57. package/dist/poly/boundbox.d.ts +16 -0
  58. package/dist/poly/cartesian.d.ts +5 -0
  59. package/dist/poly/graham-scan.d.ts +8 -0
  60. package/dist/poly/hash.d.ts +1 -0
  61. package/dist/poly/matrix.d.ts +24 -0
  62. package/dist/poly/minbound.d.ts +1 -0
  63. package/dist/poly/poly.d.ts +52 -0
  64. package/dist/poly/polybin.d.ts +5 -0
  65. package/dist/poly/polylabel.d.ts +7 -0
  66. package/dist/poly/polypack.d.ts +30 -0
  67. package/dist/poly/polyround.d.ts +1 -0
  68. package/dist/poly/polysimplify.d.ts +1 -0
  69. package/dist/poly/quad.d.ts +48 -0
  70. package/dist/poly/selfintersect.d.ts +1 -0
  71. package/dist/poly/shamos.d.ts +1 -0
  72. package/dist/poly/simplify.d.ts +2 -0
  73. package/dist/poly/topo.d.ts +46 -0
  74. package/dist/poly/union.d.ts +48 -0
  75. package/dist/storage/all.d.ts +4 -0
  76. package/dist/storage/datablob.d.ts +9 -0
  77. package/dist/storage/env.d.ts +10 -0
  78. package/dist/storage/splitsblob.d.ts +13 -0
  79. package/dist/storage/storage.d.ts +166 -0
  80. package/dist/storages3/all.d.ts +1 -0
  81. package/dist/storages3/s3.d.ts +62 -0
  82. package/dist/util/all.d.ts +5 -0
  83. package/dist/util/bintrie.d.ts +93 -0
  84. package/dist/util/countedhash.d.ts +19 -0
  85. package/dist/util/gradient.d.ts +15 -0
  86. package/dist/util/indexedarray.d.ts +15 -0
  87. package/dist/util/util.d.ts +68 -0
  88. package/docs/context.md +2 -0
  89. package/docs/dbabstract.md +2 -0
  90. package/docs/dbdynamo.md +2 -0
  91. package/docs/fsm.md +243 -0
  92. package/docs/fsmfile.md +2 -0
  93. package/docs/jsonstream.md +44 -0
  94. package/docs/lambda.md +2 -0
  95. package/docs/logabstract.md +2 -0
  96. package/docs/logclient.md +2 -0
  97. package/docs/logserver.md +2 -0
  98. package/docs/ot-editutil.md +2 -0
  99. package/docs/ot-js.md +95 -0
  100. package/docs/poly.md +103 -0
  101. package/docs/storage.md +2 -0
  102. package/docs/storages3.md +2 -0
  103. package/docs/util.md +2 -0
  104. package/lib/all/all.ts +41 -0
  105. package/lib/all/allclient.ts +19 -0
  106. package/lib/context/all.ts +1 -0
  107. package/lib/context/context.ts +82 -0
  108. package/lib/dbabstract/all.ts +1 -0
  109. package/lib/dbabstract/db.ts +246 -0
  110. package/lib/dbdynamo/all.ts +1 -0
  111. package/lib/dbdynamo/dbdynamo.ts +1551 -0
  112. package/lib/filterexpr/all.ts +1 -0
  113. package/lib/filterexpr/filterexpr.ts +625 -0
  114. package/lib/fsm/all.ts +1 -0
  115. package/lib/fsm/fsm.ts +549 -0
  116. package/lib/fsmfile/all.ts +1 -0
  117. package/lib/fsmfile/fsmfile.ts +236 -0
  118. package/lib/jsonstream/all.ts +1 -0
  119. package/lib/jsonstream/jsonstream.ts +940 -0
  120. package/lib/lambda/all.ts +1 -0
  121. package/lib/lambda/env.ts +13 -0
  122. package/lib/lambda/lambda.ts +120 -0
  123. package/lib/logabstract/all.ts +1 -0
  124. package/lib/logabstract/log.ts +55 -0
  125. package/lib/logclient/all.ts +1 -0
  126. package/lib/logclient/log.ts +105 -0
  127. package/lib/logserver/all.ts +5 -0
  128. package/lib/logserver/log.ts +565 -0
  129. package/lib/logserver/logaccum.ts +1445 -0
  130. package/lib/logserver/logblob.ts +84 -0
  131. package/lib/logserver/logconcat.ts +313 -0
  132. package/lib/logserver/logkey.ts +125 -0
  133. package/lib/memsqs/all.ts +4 -0
  134. package/lib/memsqs/client.ts +268 -0
  135. package/lib/memsqs/loopback.ts +64 -0
  136. package/lib/memsqs/orderedlist.ts +74 -0
  137. package/lib/memsqs/queue.ts +395 -0
  138. package/lib/memsqs/server.ts +262 -0
  139. package/lib/ot-editutil/all.ts +2 -0
  140. package/lib/ot-editutil/oteditutil.ts +180 -0
  141. package/lib/ot-editutil/otmaputil.ts +209 -0
  142. package/lib/ot-js/all.ts +9 -0
  143. package/lib/ot-js/otarray.ts +1168 -0
  144. package/lib/ot-js/otclientengine.ts +327 -0
  145. package/lib/ot-js/otcomposite.ts +247 -0
  146. package/lib/ot-js/otcounter.ts +145 -0
  147. package/lib/ot-js/otengine.ts +71 -0
  148. package/lib/ot-js/otmap.ts +144 -0
  149. package/lib/ot-js/otserverengine.ts +329 -0
  150. package/lib/ot-js/otsession.ts +199 -0
  151. package/lib/ot-js/ottypes.ts +98 -0
  152. package/lib/poly/all.ts +15 -0
  153. package/lib/poly/blend.ts +27 -0
  154. package/lib/poly/boundbox.ts +102 -0
  155. package/lib/poly/cartesian.ts +130 -0
  156. package/lib/poly/graham-scan.ts +401 -0
  157. package/lib/poly/hash.ts +15 -0
  158. package/lib/poly/matrix.ts +309 -0
  159. package/lib/poly/minbound.ts +211 -0
  160. package/lib/poly/poly.ts +767 -0
  161. package/lib/poly/polybin.ts +218 -0
  162. package/lib/poly/polylabel.ts +204 -0
  163. package/lib/poly/polypack.ts +458 -0
  164. package/lib/poly/polyround.ts +30 -0
  165. package/lib/poly/polysimplify.ts +24 -0
  166. package/lib/poly/quad.ts +272 -0
  167. package/lib/poly/selfintersect.ts +87 -0
  168. package/lib/poly/shamos.ts +297 -0
  169. package/lib/poly/simplify.ts +119 -0
  170. package/lib/poly/topo.ts +525 -0
  171. package/lib/poly/union.ts +371 -0
  172. package/lib/storage/all.ts +4 -0
  173. package/lib/storage/datablob.ts +36 -0
  174. package/lib/storage/env.ts +14 -0
  175. package/lib/storage/splitsblob.ts +63 -0
  176. package/lib/storage/storage.ts +604 -0
  177. package/lib/storages3/all.ts +1 -0
  178. package/lib/storages3/s3.ts +576 -0
  179. package/lib/util/all.ts +5 -0
  180. package/lib/util/bintrie.ts +603 -0
  181. package/lib/util/countedhash.ts +83 -0
  182. package/lib/util/gradient.ts +108 -0
  183. package/lib/util/indexedarray.ts +80 -0
  184. package/lib/util/util.ts +695 -0
  185. package/package.json +8 -8
@@ -0,0 +1,111 @@
1
+ import * as OT from "./ottypes";
2
+ export declare const OpInsert: number;
3
+ export declare const OpDelete: number;
4
+ export declare const OpRetain: number;
5
+ export declare const OpCursor: number;
6
+ export declare const OpSet: number;
7
+ export declare const OpTmpRetain: number;
8
+ export declare type OTSingleArrayEdit = [number, number, any];
9
+ export declare type OTEdits = OTSingleArrayEdit[];
10
+ declare enum OTalignEdgesType {
11
+ AlignForCompose = 0,
12
+ AlignForTransform = 1
13
+ }
14
+ export interface IOTArrayLikeOperations {
15
+ underlyingTypeName(): string;
16
+ empty(): any;
17
+ insert(t: any, pos: number, tInsert: any): any;
18
+ delete(t: any, pos: number, len: number): any;
19
+ set(t: any, pos: number, tSet: any): any;
20
+ append(t: any, tAppend: any): any;
21
+ substr(t: any, pos: number, len: number): any;
22
+ substrOf(t: any, pos: number, len: number, tsub: any): any;
23
+ constructN(n: number): any;
24
+ equal(t1: any, t2: any): boolean;
25
+ copy(t: any): any;
26
+ length(t: any): number;
27
+ }
28
+ export declare class OTSingleArrayEditor {
29
+ raw: IOTArrayLikeOperations;
30
+ constructor(raw: IOTArrayLikeOperations);
31
+ copy(a: OTSingleArrayEdit): OTSingleArrayEdit;
32
+ isDelete(a: OTSingleArrayEdit): boolean;
33
+ isNotDelete(a: OTSingleArrayEdit): boolean;
34
+ isCursor(a: OTSingleArrayEdit): boolean;
35
+ isNotCursor(a: OTSingleArrayEdit): boolean;
36
+ isTmpRetain(a: OTSingleArrayEdit): boolean;
37
+ isNotTmpRetainOrDelete(a: OTSingleArrayEdit): boolean;
38
+ isTmpRetainOrDelete(a: OTSingleArrayEdit): boolean;
39
+ isIgnore(a: OTSingleArrayEdit): boolean;
40
+ isNoOp(a: OTSingleArrayEdit): boolean;
41
+ isEqual(a1: OTSingleArrayEdit, a2: OTSingleArrayEdit): boolean;
42
+ appendValue(a: OTSingleArrayEdit, s: any): void;
43
+ empty(a: OTSingleArrayEdit): void;
44
+ setIgnore(a: OTSingleArrayEdit): void;
45
+ substr(aIn: OTSingleArrayEdit, pos: number, len: number): void;
46
+ substrFromRaw(aIn: OTSingleArrayEdit, pos: number, len: number, s: any): void;
47
+ copyWithSubstr(aIn: OTSingleArrayEdit, pos: number, len: number): OTSingleArrayEdit;
48
+ }
49
+ export declare class OTStringOperations implements IOTArrayLikeOperations {
50
+ underlyingTypeName(): string;
51
+ empty(): any;
52
+ insert(a: any, pos: number, aInsert: any): any;
53
+ delete(a: any, pos: number, len: number): any;
54
+ set(a: any, pos: number, aSet: any): any;
55
+ append(a: any, aAppend: any): any;
56
+ substr(a: any, pos: number, len: number): any;
57
+ substrOf(a: any, pos: number, len: number, aSub: any): any;
58
+ constructN(n: number): any;
59
+ equal(a1: any, a2: any): boolean;
60
+ copy(a: any): any;
61
+ length(a: any): number;
62
+ }
63
+ export declare class OTArrayOperations implements IOTArrayLikeOperations {
64
+ underlyingTypeName(): string;
65
+ empty(): any;
66
+ insert(a: any, pos: number, aInsert: any): any;
67
+ delete(a: any, pos: number, len: number): any;
68
+ set(a: any, pos: number, aSet: any): any;
69
+ append(a: any, aAppend: any): any;
70
+ substr(a: any, pos: number, len: number): any;
71
+ substrOf(a: any, pos: number, len: number, aSub: any): any;
72
+ constructN(n: number): any;
73
+ equal(a1: any, a2: any): boolean;
74
+ copy(a: any): any;
75
+ length(a: any): number;
76
+ }
77
+ export declare class OTArrayLikeResource extends OT.OTResourceBase {
78
+ editor: OTSingleArrayEditor;
79
+ constructor(ed: OTSingleArrayEditor, rname: string);
80
+ copy(): OTArrayLikeResource;
81
+ moveEdits(newA: OTEdits, iStart: number, iEnd?: number, pred?: (a: OTSingleArrayEdit) => boolean): void;
82
+ equal(rhs: OTArrayLikeResource): boolean;
83
+ effectivelyEqual(rhs: OTArrayLikeResource): boolean;
84
+ basesConsistent(rhs: OTArrayLikeResource): void;
85
+ originalLength(): number;
86
+ finalLength(): number;
87
+ apply(aValue: any): any;
88
+ coalesce(bDeleteCursor?: boolean): void;
89
+ fullyCoalesce(): void;
90
+ invert(sInput: any): void;
91
+ alignEdges(rhs: OTArrayLikeResource, st: OTalignEdgesType): void;
92
+ getCursorCache(): any;
93
+ compose(rhs: OTArrayLikeResource): void;
94
+ performTransformReorder(bForceRetainBeforeInsert: boolean, newA: OTEdits, iBegin: number, iEnd: number): void;
95
+ normalizeNewRetainsAfterTransform(bForceRetainBeforeInsert: boolean): void;
96
+ transform(prior: OTArrayLikeResource, bPriorIsService: boolean): void;
97
+ generateRandom(nInitial: number, clientID: string): void;
98
+ }
99
+ export declare class OTStringResource extends OTArrayLikeResource {
100
+ static _editor: OTSingleArrayEditor;
101
+ constructor(rname: string);
102
+ static factory(rname: string): OTStringResource;
103
+ copy(): OTStringResource;
104
+ }
105
+ export declare class OTArrayResource extends OTArrayLikeResource {
106
+ static _editor: OTSingleArrayEditor;
107
+ constructor(rname: string);
108
+ static factory(rname: string): OTArrayResource;
109
+ copy(): OTArrayResource;
110
+ }
111
+ export {};
@@ -0,0 +1,38 @@
1
+ import * as LogAbstract from "../logabstract/all";
2
+ import * as OTC from "./otcomposite";
3
+ import * as OTE from "./otengine";
4
+ export declare class OTClientEngine extends OTE.OTEngine {
5
+ clientID: string;
6
+ resourceID: string;
7
+ isNeedAck: boolean;
8
+ isNeedResend: boolean;
9
+ bReadOnly: boolean;
10
+ clientSequenceNo: number;
11
+ stateServer: OTC.OTCompositeResource;
12
+ stateLocal: OTC.OTCompositeResource;
13
+ valCache: any;
14
+ prefailCache: any;
15
+ actionAllClient: OTC.OTCompositeResource;
16
+ actionAllPendingClient: OTC.OTCompositeResource;
17
+ actionSentClient: OTC.OTCompositeResource;
18
+ actionSentClientOriginal: OTC.OTCompositeResource;
19
+ actionServerInterposedSentClient: OTC.OTCompositeResource;
20
+ constructor(ilog: LogAbstract.ILog, rid: string, cid: string);
21
+ initialize(): void;
22
+ serverClock(): number;
23
+ rid(): string;
24
+ cid(): string;
25
+ toPartialValue(resourceName: string): any;
26
+ toValue(): any;
27
+ toPrefailValue(): any;
28
+ clearPrefail(): void;
29
+ setReadOnly(b: boolean): void;
30
+ startLocalEdit(): OTC.OTCompositeResource;
31
+ isPending(): boolean;
32
+ getPending(): OTC.OTCompositeResource;
33
+ resetPending(): void;
34
+ failbackToInitialState(): void;
35
+ failbackToServerState(): void;
36
+ addRemote(orig: OTC.OTCompositeResource): void;
37
+ addLocalEdit(orig: OTC.OTCompositeResource): void;
38
+ }
@@ -0,0 +1,37 @@
1
+ import * as OT from "./ottypes";
2
+ import * as OTA from "./otarray";
3
+ import * as OTM from "./otmap";
4
+ import * as OTC from "./otcounter";
5
+ export declare const clockInitialValue: number;
6
+ export declare const clockTerminateValue: number;
7
+ export declare const clockRandomizeValue: number;
8
+ export declare const clockFailureValue: number;
9
+ export declare const clockInitializeValue: number;
10
+ export declare const clockUndoValue: number;
11
+ export declare const clockSeenValue: number;
12
+ export declare class OTCompositeResource extends OT.OTResourceBase {
13
+ resourceID: string;
14
+ clientID: string;
15
+ clock: number;
16
+ clientSequenceNo: number;
17
+ static typeRegistry: any;
18
+ constructor(rid: string, cid: string);
19
+ static registerType(underlyingType: string, factory: (resourceName: string) => OT.OTResourceBase): void;
20
+ findResource(rname: string, utype?: string, bConstruct?: boolean): OT.IOTResource;
21
+ map(rid: string): OTM.OTMapResource;
22
+ array(rid: string): OTA.OTArrayResource;
23
+ counter(rid: string): OTC.OTCounterResource;
24
+ garbageCollect(map: any): boolean;
25
+ isEmpty(): boolean;
26
+ copy(): OTCompositeResource;
27
+ effectivelyEqual(rhs: OTCompositeResource): boolean;
28
+ transform(rhs: OTCompositeResource, bPriorIsService: boolean): void;
29
+ compose(rhs: OTCompositeResource): void;
30
+ apply(runningValue: any): any;
31
+ toPartialValue(resourceName: string): any;
32
+ toValue(): any;
33
+ minimize(): void;
34
+ static constructResource(rname: string, utype: string): OT.IOTResource;
35
+ static constructFromObject(o: any): OTCompositeResource;
36
+ toJSON(): any;
37
+ }
@@ -0,0 +1,17 @@
1
+ import * as OT from "./ottypes";
2
+ export declare const OpCounterAdd = 1;
3
+ export declare const OpCounterDel = 2;
4
+ export declare type CounterEdit = [number, string, any];
5
+ export declare class OTCounterResource extends OT.OTResourceBase {
6
+ constructor(rid: string);
7
+ static factory(rid: string): OTCounterResource;
8
+ copy(): OTCounterResource;
9
+ effectivelyEqual(rhs: OTCounterResource): boolean;
10
+ transform(prior: OTCounterResource, bPriorIsService: boolean): void;
11
+ compose(rhs: OTCounterResource): void;
12
+ apply(startValue: any): any;
13
+ minimize(): any;
14
+ loadObject(o: any): any;
15
+ toObject(): any;
16
+ fromObject(o: any): void;
17
+ }
@@ -0,0 +1,22 @@
1
+ import * as LogAbstract from "../logabstract/all";
2
+ import * as OTC from "./otcomposite";
3
+ export interface IOTEngine {
4
+ cid(): string;
5
+ rid(): string;
6
+ toPartialValue(resourceName: string): any;
7
+ startLocalEdit(): OTC.OTCompositeResource;
8
+ addLocalEdit(e: OTC.OTCompositeResource): void;
9
+ }
10
+ export declare class OTEngine implements IOTEngine {
11
+ ilog: LogAbstract.ILog;
12
+ onList: any;
13
+ constructor(ilog: LogAbstract.ILog);
14
+ on(eventName: string, cb: any): void;
15
+ off(eventName: string, cb: any): void;
16
+ emit(eventName: string): void;
17
+ cid(): string;
18
+ rid(): string;
19
+ toPartialValue(resourceName: string): any;
20
+ startLocalEdit(): OTC.OTCompositeResource;
21
+ addLocalEdit(e: OTC.OTCompositeResource): void;
22
+ }
@@ -0,0 +1,19 @@
1
+ import * as OT from './ottypes';
2
+ export declare const OpMapSet = 1;
3
+ export declare const OpMapDel = 2;
4
+ export declare type MapEdit = [number, string, any];
5
+ export declare class OTMapResource extends OT.OTResourceBase {
6
+ constructor(rid: string);
7
+ static factory(rid: string): OTMapResource;
8
+ set(p: string, a: any): OTMapResource;
9
+ del(p: string): OTMapResource;
10
+ copy(): OTMapResource;
11
+ effectivelyEqual(rhs: OTMapResource): boolean;
12
+ transform(prior: OTMapResource, bPriorIsService: boolean): void;
13
+ compose(rhs: OTMapResource): void;
14
+ apply(startValue: any): any;
15
+ minimize(): any;
16
+ loadObject(o: any): any;
17
+ toObject(): any;
18
+ fromObject(o: any): void;
19
+ }
@@ -0,0 +1,38 @@
1
+ import * as LogAbstract from '../logabstract/all';
2
+ import * as OTC from "./otcomposite";
3
+ import * as OTE from "./otengine";
4
+ export declare const ClientIDForServer: string;
5
+ export declare class OTServerEngine extends OTE.OTEngine {
6
+ stateServer: OTC.OTCompositeResource;
7
+ logServer: OTC.OTCompositeResource[];
8
+ valCache: any;
9
+ fullCache: any;
10
+ highSequence: any;
11
+ clientSequenceNo: number;
12
+ constructor(ilog: LogAbstract.ILog, rid: string);
13
+ serverClock(): number;
14
+ rid(): string;
15
+ cid(): string;
16
+ startLocalEdit(): OTC.OTCompositeResource;
17
+ resetCaches(): void;
18
+ toPartialValue(resourceName: string): any;
19
+ toValue(): any;
20
+ getProp(s: string): any;
21
+ getName(): string;
22
+ getType(): string;
23
+ getDescription(): string;
24
+ getCreatedBy(): string;
25
+ getCreateTime(): string;
26
+ getCreatedByName(): string;
27
+ hasSeenEvent(orig: OTC.OTCompositeResource): boolean;
28
+ isNextEvent(orig: OTC.OTCompositeResource): boolean;
29
+ rememberSeenEvent(orig: OTC.OTCompositeResource): void;
30
+ forgetEvents(orig: OTC.OTCompositeResource): void;
31
+ clientHighSequence(cid: string): number;
32
+ garbageCollect(): void;
33
+ addServer(orig: OTC.OTCompositeResource): number;
34
+ addLocalEdit(orig: OTC.OTCompositeResource): void;
35
+ toJSON(): any;
36
+ validateLog(): void;
37
+ loadFromObject(o: any): void;
38
+ }
@@ -0,0 +1,111 @@
1
+ export declare const ESuccess: number;
2
+ export declare const EFail: number;
3
+ export declare const EFull: number;
4
+ export declare const ERetry: number;
5
+ export declare const ENoSession: number;
6
+ export declare const EClockSeen: number;
7
+ export declare const EClockFailure: number;
8
+ export declare const EClockReset: number;
9
+ export declare const ENoUser: number;
10
+ export declare const EBadRequest: number;
11
+ export declare const ELoadFailed: number;
12
+ export declare const ENoPerm: number;
13
+ export declare const ENoAccess: number;
14
+ export declare const EMaintenance: number;
15
+ export declare const EClockAnomaly: number;
16
+ export declare const FilterMyMaps: number;
17
+ export declare const FilterSharedWithMe: number;
18
+ export declare const FilterMyPublic: number;
19
+ export declare const FilterRecent: number;
20
+ export declare const FilterTrash: number;
21
+ export declare const FilterPublic: number;
22
+ export declare const FilterOfficial: number;
23
+ export declare const FilterCount: number;
24
+ export declare type Filter = number;
25
+ export declare const PermNone: number;
26
+ export declare const PermRead: number;
27
+ export declare const PermWrite: number;
28
+ export declare const PermOwner: number;
29
+ export declare const PermAdmin: number;
30
+ export declare const PermEdit: number;
31
+ export declare const PermAll: number;
32
+ export declare type Permission = number;
33
+ export declare const ServerStateRunning: number;
34
+ export declare const ServerStateMaintenance: number;
35
+ export declare type ServerState = number;
36
+ export interface AccessSessionMap {
37
+ [key: string]: string;
38
+ }
39
+ export interface AccessMap {
40
+ [key: string]: Access;
41
+ }
42
+ export interface Access {
43
+ userIDs: string[];
44
+ perm: Permission;
45
+ }
46
+ export interface Revision {
47
+ id: string;
48
+ modifyTime: any;
49
+ label?: string;
50
+ }
51
+ export declare type RevisionList = Revision[];
52
+ export interface SessionUser {
53
+ id: string;
54
+ name: string;
55
+ }
56
+ export interface ActiveUser {
57
+ id: string;
58
+ name: string;
59
+ active: number;
60
+ }
61
+ export interface SessionUserIndex {
62
+ [key: string]: SessionUser;
63
+ }
64
+ export interface SessionUserList {
65
+ [key: string]: number;
66
+ }
67
+ export interface SessionProps {
68
+ id: string;
69
+ name: string;
70
+ type: string;
71
+ description: string;
72
+ labels: string[];
73
+ createdBy: string;
74
+ lastActive: any;
75
+ createTime: any;
76
+ modifyTime: any;
77
+ clientCount: number;
78
+ maxClients: number;
79
+ requestCount: number;
80
+ deleted: boolean;
81
+ published?: string;
82
+ official: boolean;
83
+ loadFailed: boolean;
84
+ accessMap: AccessMap;
85
+ revisions: RevisionList;
86
+ xprops?: {
87
+ [prop: string]: string;
88
+ };
89
+ }
90
+ export declare type LabelUpdate = {
91
+ [name: string]: boolean | null;
92
+ };
93
+ export interface SessionUpdateProps {
94
+ id: string;
95
+ deleted?: boolean;
96
+ published?: boolean;
97
+ official?: boolean;
98
+ name?: string;
99
+ description?: string;
100
+ labelupdate?: LabelUpdate;
101
+ access?: Access;
102
+ accessUpdate?: AccessMap;
103
+ restore?: string;
104
+ revision?: Revision;
105
+ }
106
+ export interface SessionsIndex {
107
+ [key: string]: SessionProps;
108
+ }
109
+ export declare function accessFindUser(a: Access, uid: string): Permission;
110
+ export declare function accessMapFindUser(accessMap: AccessMap, uid: string, aid?: string): Permission;
111
+ export declare function SessionFilterFunction(p: SessionProps, uid: string, f: number): boolean;
@@ -0,0 +1,29 @@
1
+ export interface IOTResource {
2
+ resourceName: string;
3
+ underlyingType: string;
4
+ edits: any[];
5
+ length: number;
6
+ empty(): void;
7
+ isEmpty(): boolean;
8
+ copy(): IOTResource;
9
+ effectivelyEqual(rhs: IOTResource): boolean;
10
+ transform(rhs: IOTResource, bPriorIsService: boolean): void;
11
+ compose(rhs: IOTResource): void;
12
+ apply(startValue: any): any;
13
+ minimize(): void;
14
+ }
15
+ export declare class OTResourceBase implements IOTResource {
16
+ resourceName: string;
17
+ underlyingType: string;
18
+ edits: any[];
19
+ constructor(rname: string, utype: string);
20
+ get length(): number;
21
+ empty(): void;
22
+ isEmpty(): boolean;
23
+ copy(): OTResourceBase;
24
+ effectivelyEqual(rhs: OTResourceBase): boolean;
25
+ transform(rhs: OTResourceBase, bPriorIsService: boolean): void;
26
+ compose(rhs: OTResourceBase): void;
27
+ apply(startValue: any): any;
28
+ minimize(): void;
29
+ }
@@ -0,0 +1,15 @@
1
+ export * from './poly';
2
+ export * from './union';
3
+ export * from './quad';
4
+ export * from './polylabel';
5
+ export * from './polysimplify';
6
+ export * from './polypack';
7
+ export * from './polybin';
8
+ export * from './boundbox';
9
+ export * from './blend';
10
+ export * from './cartesian';
11
+ export * from './minbound';
12
+ export * from './polyround';
13
+ export * from './topo';
14
+ export * from './selfintersect';
15
+ export * from './shamos';
@@ -0,0 +1 @@
1
+ export declare function blend(polys: any[]): any;
@@ -0,0 +1,16 @@
1
+ export interface BoundBox {
2
+ left?: number;
3
+ top?: number;
4
+ right?: number;
5
+ bottom?: number;
6
+ }
7
+ export declare function boundboxWidth(bb: BoundBox): number;
8
+ export declare function boundboxHeight(bb: BoundBox): number;
9
+ export declare function boundboxCX(bb: BoundBox): number;
10
+ export declare function boundboxCY(bb: BoundBox): number;
11
+ export declare function clipLon(lon: number): number;
12
+ export declare function boundboxExtend(bbox: BoundBox, x: number, y: number): void;
13
+ export declare function boundbox(poly: any, bbox?: BoundBox): BoundBox;
14
+ export declare function boundboxPoly(bb: BoundBox): any;
15
+ export declare function boundboxArea(poly: any): number;
16
+ export declare function boundboxIntersects(bb1: BoundBox, bb2: BoundBox): boolean;
@@ -0,0 +1,5 @@
1
+ import * as GeoJSON from 'geojson';
2
+ export declare function polyParts(poly: any): GeoJSON.FeatureCollection;
3
+ export declare function polyAreaFlat(poly: any): number;
4
+ export declare function polyPerimeterFlat(poly: any): number;
5
+ export declare function polyDiameterFlat(poly: any): number;
@@ -0,0 +1,8 @@
1
+ import { PolyOptions } from './poly';
2
+ export declare function makeConvexHullGrahamScan(poly: any, options?: PolyOptions): any;
3
+ /**
4
+ * Graham's Scan Convex Hull Algorithm
5
+ * @desc An implementation of the Graham's Scan Convex Hull algorithm in JavaScript.
6
+ * @author Brian Barnett, brian@3kb.co.uk, http://brianbar.net/ || http://3kb.co.uk/
7
+ * @version 1.0.5
8
+ */
@@ -0,0 +1 @@
1
+ export declare function qhash(o: any, keys?: any): any;
@@ -0,0 +1,24 @@
1
+ export declare type Matrix = number[][];
2
+ export declare type Vector = number[];
3
+ export declare type Range = number[];
4
+ export declare type Index = number[][];
5
+ export declare type applyCB = (v: Vector) => number;
6
+ export declare const enum Dim {
7
+ Rows = 0,
8
+ Columns = 1
9
+ }
10
+ export declare function matrix(a: Matrix): Matrix;
11
+ export declare function multiply(a: Matrix, b: Matrix): Matrix;
12
+ export declare function transpose(a: Matrix): Matrix;
13
+ export declare function apply(a: Matrix, over: Dim, cb: applyCB): Vector;
14
+ export declare function min(v: Vector): number;
15
+ export declare function max(v: Vector): number;
16
+ export declare function concat(a: Matrix, b: Matrix, by: Dim): Matrix;
17
+ export declare function row(a: Matrix, i: number): Vector;
18
+ export declare function column(a: Matrix, j: number): Vector;
19
+ export declare function subtract(a: Vector, b: Vector): Vector;
20
+ export declare function dotMultiply(a: Vector, b: Vector): Vector;
21
+ export declare function index(a: Range, b: Range): Index;
22
+ export declare function range(start: number, end: number, includeEnd?: boolean): Vector;
23
+ export declare function subset(a: Matrix, select: Index): Matrix;
24
+ export declare function dotProduct(a: Vector, b: Vector): number;
@@ -0,0 +1 @@
1
+ export declare function minimumBoundingRectangle(poly: any): any;
@@ -0,0 +1,52 @@
1
+ import * as PP from './polypack';
2
+ export interface TickOptions {
3
+ maxLeafCount?: number;
4
+ maxDepth?: number;
5
+ tickStep?: number;
6
+ }
7
+ export declare const DefaultTickOptions: {
8
+ maxLeafCount: number;
9
+ maxDepth: number;
10
+ tickStep: number;
11
+ };
12
+ export declare const EARTH_RADIUS = 6371000;
13
+ export interface PolyOptions {
14
+ noLatitudeCorrection?: boolean;
15
+ }
16
+ export declare const DefaultOptions: PolyOptions;
17
+ export declare function polySimpleArea(b: Float64Array, iOffset: number, n: number): number;
18
+ export declare function polyNormalize(poly: any): PP.PolyPack;
19
+ export declare function polyNull(poly: any): boolean;
20
+ export declare function polyArea(poly: any): number;
21
+ export declare function polyDiameter(poly: any, options?: PolyOptions): number;
22
+ export declare function polyPerimeter(poly: any, options?: PolyOptions): number;
23
+ export declare class Circle {
24
+ x: number;
25
+ y: number;
26
+ r: number;
27
+ constructor(x: number, y: number, r: number);
28
+ }
29
+ export declare function polyToCircle(poly: any): Circle | null;
30
+ export declare function polyToPolsbyPopperCircle(poly: any, options?: PolyOptions): Circle | null;
31
+ export declare function polyFromCircle(c: Circle, nSegments?: number): any;
32
+ export declare function polyToExteriorPoints(poly: any): any;
33
+ export declare function polyConvexHull(poly: any, altAlgorithm?: any): any;
34
+ export declare function makeConvexHullMonotoneChain2D(poly: any): any;
35
+ export interface CompactnessDescription {
36
+ value: number;
37
+ reock: number;
38
+ polsby_popper: number;
39
+ convex_hull: number;
40
+ schwartzberg: number;
41
+ }
42
+ export declare function polyCompactness(poly: any, options?: PolyOptions): CompactnessDescription;
43
+ export interface PolyDescription {
44
+ npoly: number;
45
+ nhole: number;
46
+ npoint: number;
47
+ }
48
+ export declare function polyDescribe(poly: any): PolyDescription;
49
+ export declare function npoints(poly: any): number;
50
+ export declare function polyTransform(poly: any, transformFn: any): any;
51
+ export declare function featureRewind(poly: any): any;
52
+ export declare function polyRewindRings(pp: any, bLog?: boolean): any;
@@ -0,0 +1,5 @@
1
+ import * as Util from '../util/all';
2
+ export declare function packCollection(coder: Util.Coder, col: any): ArrayBuffer;
3
+ export declare function unpackCollection(coder: Util.Coder, ab: ArrayBuffer): any;
4
+ export declare function topoToBuffer(coder: Util.Coder, topo: any): ArrayBuffer;
5
+ export declare function topoFromBuffer(coder: Util.Coder, ab: ArrayBuffer): any;
@@ -0,0 +1,7 @@
1
+ interface PolyLabelResult {
2
+ x: number;
3
+ y: number;
4
+ d: number;
5
+ }
6
+ export declare function polyLabel(poly: any, precision?: number, debug?: boolean): PolyLabelResult;
7
+ export {};
@@ -0,0 +1,30 @@
1
+ export interface PolyPack {
2
+ offset: number;
3
+ length: number;
4
+ buffer: any;
5
+ }
6
+ export declare function polyPackSize(coords: any): number;
7
+ declare type EachRingCB = (buffer: Float64Array, iPoly: number, iRing: number, iOffset: number, nPoints: number) => void;
8
+ declare type EachPointCB = (buffer: Float64Array, iPoly: number, iRing: number, iOffset: number) => void;
9
+ export declare function polyPackEachRing(pack: PolyPack, cb: EachRingCB): void;
10
+ export declare function polyPackEachPoint(pack: PolyPack, cb: EachPointCB): void;
11
+ export declare function polyPackCountPoints(pack: PolyPack): number;
12
+ export declare function polyPacked(f: any): boolean;
13
+ export declare function normalizeArcs(arcs: any): any;
14
+ export declare function countArcPolygons(arcs: any): number;
15
+ export declare function countArcRings(arcs: any, iPoly?: number): number;
16
+ export declare function countOneArcPoints(topo: any, ring: any): number;
17
+ export declare function countArcPoints(topo: any, arcs: any, iPoly?: number): number;
18
+ export declare function polyPackTopoArcs(topo: any, arcs: any, iPoly?: number): PolyPack;
19
+ export declare function polyPack(coords: any, prepack?: PolyPack): PolyPack;
20
+ export declare function polyPackCopy(coords: any): PolyPack;
21
+ export declare function polyUnpack(prepack: any): any;
22
+ export declare function featurePackSize(f: any): number;
23
+ export declare function featurePack(f: any, prepack?: PolyPack): any;
24
+ export declare function featureUnpack(f: any): any;
25
+ export declare type SavePack = WeakMap<any, any>;
26
+ export declare function featureUnpackTemporarily(f: any, save?: SavePack): SavePack;
27
+ export declare function featureRepack(f: any, save: SavePack): any;
28
+ export declare function featurePackString(f: any): string;
29
+ export declare function featureUnpackString(s: string): any;
30
+ export {};
@@ -0,0 +1 @@
1
+ export declare function polyRound(o: any): any;
@@ -0,0 +1 @@
1
+ export declare function polySimplify(poly: any, tolerance?: number): void;
@@ -0,0 +1,48 @@
1
+ import * as FSM from '../fsm/all';
2
+ import * as Poly from './poly';
3
+ import * as BB from './boundbox';
4
+ export interface WrappedPoly {
5
+ box: BB.BoundBox;
6
+ p: any;
7
+ }
8
+ export interface WorkDone {
9
+ nUnion: number;
10
+ nDifference: number;
11
+ ms: number;
12
+ }
13
+ export declare function unionPolys(polys: any[]): any;
14
+ export interface QuadOptions {
15
+ maxLeafCount?: number;
16
+ maxDepth?: number;
17
+ tickStep?: number;
18
+ }
19
+ export declare const DefaultQuadOptions: QuadOptions;
20
+ export interface TickCounter {
21
+ ticks: number;
22
+ }
23
+ declare class QuadLevel {
24
+ options: QuadOptions;
25
+ level: number;
26
+ children: QuadLevel[];
27
+ features: any[];
28
+ box: BB.BoundBox;
29
+ asyncUnion: any;
30
+ constructor(options: QuadOptions, level: number, box: BB.BoundBox, features: WrappedPoly[]);
31
+ private featureInBox;
32
+ union(): any;
33
+ get isempty(): boolean;
34
+ tickUnion(tickCounter: TickCounter): void;
35
+ }
36
+ export declare class FsmQuadTree extends FSM.Fsm {
37
+ quad: QuadLevel;
38
+ asyncUnion: any;
39
+ isempty: boolean;
40
+ options: Poly.TickOptions;
41
+ work: WorkDone;
42
+ constructor(env: FSM.FsmEnvironment, options?: Poly.TickOptions, col?: any);
43
+ initialize(col: any): void;
44
+ cancel(): any;
45
+ get result(): any;
46
+ tick(): void;
47
+ }
48
+ export {};
@@ -0,0 +1 @@
1
+ export declare function selfIntersect(poly: any): boolean;