@dra2020/baseclient 1.0.13 → 1.0.16
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.
- package/LICENSE +21 -0
- package/README.md +26 -0
- package/dist/all/all.d.ts +20 -0
- package/dist/baseclient.js +10121 -0
- package/dist/baseclient.js.map +1 -0
- package/dist/context/all.d.ts +1 -0
- package/dist/context/context.d.ts +13 -0
- package/dist/filterexpr/all.d.ts +1 -0
- package/dist/filterexpr/filterexpr.d.ts +67 -0
- package/dist/fsm/all.d.ts +1 -0
- package/dist/fsm/fsm.d.ts +119 -0
- package/dist/geo/all.d.ts +2 -0
- package/dist/geo/geo.d.ts +67 -0
- package/dist/geo/vfeature.d.ts +4 -0
- package/dist/logabstract/all.d.ts +1 -0
- package/dist/logabstract/log.d.ts +26 -0
- package/dist/logclient/all.d.ts +1 -0
- package/dist/logclient/log.d.ts +6 -0
- package/dist/ot-editutil/all.d.ts +2 -0
- package/dist/ot-editutil/oteditutil.d.ts +14 -0
- package/dist/ot-editutil/otmaputil.d.ts +21 -0
- package/dist/ot-js/all.d.ts +9 -0
- package/dist/ot-js/otarray.d.ts +111 -0
- package/dist/ot-js/otclientengine.d.ts +38 -0
- package/dist/ot-js/otcomposite.d.ts +37 -0
- package/dist/ot-js/otcounter.d.ts +17 -0
- package/dist/ot-js/otengine.d.ts +22 -0
- package/dist/ot-js/otmap.d.ts +19 -0
- package/dist/ot-js/otserverengine.d.ts +38 -0
- package/dist/ot-js/otsession.d.ts +114 -0
- package/dist/ot-js/ottypes.d.ts +29 -0
- package/dist/poly/all.d.ts +15 -0
- package/dist/poly/blend.d.ts +1 -0
- package/dist/poly/boundbox.d.ts +16 -0
- package/dist/poly/cartesian.d.ts +5 -0
- package/dist/poly/graham-scan.d.ts +8 -0
- package/dist/poly/hash.d.ts +1 -0
- package/dist/poly/matrix.d.ts +24 -0
- package/dist/poly/minbound.d.ts +1 -0
- package/dist/poly/poly.d.ts +52 -0
- package/dist/poly/polybin.d.ts +5 -0
- package/dist/poly/polylabel.d.ts +7 -0
- package/dist/poly/polypack.d.ts +30 -0
- package/dist/poly/polyround.d.ts +1 -0
- package/dist/poly/polysimplify.d.ts +1 -0
- package/dist/poly/quad.d.ts +48 -0
- package/dist/poly/selfintersect.d.ts +1 -0
- package/dist/poly/shamos.d.ts +1 -0
- package/dist/poly/simplify.d.ts +2 -0
- package/dist/poly/topo.d.ts +46 -0
- package/dist/poly/union.d.ts +49 -0
- package/dist/util/all.d.ts +5 -0
- package/dist/util/bintrie.d.ts +93 -0
- package/dist/util/countedhash.d.ts +19 -0
- package/dist/util/gradient.d.ts +15 -0
- package/dist/util/indexedarray.d.ts +15 -0
- package/dist/util/util.d.ts +68 -0
- package/docs/context.md +2 -0
- package/docs/filterexpr.md +22 -0
- package/docs/fsm.md +243 -0
- package/docs/logabstract.md +2 -0
- package/docs/logclient.md +2 -0
- package/docs/ot-editutil.md +2 -0
- package/docs/ot-js.md +95 -0
- package/docs/poly.md +103 -0
- package/docs/util.md +2 -0
- package/lib/all/all.ts +21 -0
- package/lib/context/all.ts +1 -0
- package/lib/context/context.ts +82 -0
- package/lib/filterexpr/all.ts +1 -0
- package/lib/filterexpr/filterexpr.ts +699 -0
- package/lib/fsm/all.ts +1 -0
- package/lib/fsm/fsm.ts +559 -0
- package/lib/geo/all.ts +2 -0
- package/lib/geo/geo.ts +452 -0
- package/lib/geo/vfeature.ts +34 -0
- package/lib/logabstract/all.ts +1 -0
- package/lib/logabstract/log.ts +55 -0
- package/lib/logclient/all.ts +1 -0
- package/lib/logclient/log.ts +105 -0
- package/lib/ot-editutil/all.ts +2 -0
- package/lib/ot-editutil/oteditutil.ts +180 -0
- package/lib/ot-editutil/otmaputil.ts +209 -0
- package/lib/ot-js/all.ts +9 -0
- package/lib/ot-js/otarray.ts +1168 -0
- package/lib/ot-js/otclientengine.ts +327 -0
- package/lib/ot-js/otcomposite.ts +247 -0
- package/lib/ot-js/otcounter.ts +145 -0
- package/lib/ot-js/otengine.ts +71 -0
- package/lib/ot-js/otmap.ts +144 -0
- package/lib/ot-js/otserverengine.ts +329 -0
- package/lib/ot-js/otsession.ts +202 -0
- package/lib/ot-js/ottypes.ts +98 -0
- package/lib/poly/all.ts +15 -0
- package/lib/poly/blend.ts +27 -0
- package/lib/poly/boundbox.ts +102 -0
- package/lib/poly/cartesian.ts +130 -0
- package/lib/poly/graham-scan.ts +401 -0
- package/lib/poly/hash.ts +15 -0
- package/lib/poly/matrix.ts +309 -0
- package/lib/poly/minbound.ts +211 -0
- package/lib/poly/poly.ts +767 -0
- package/lib/poly/polybin.ts +218 -0
- package/lib/poly/polylabel.ts +204 -0
- package/lib/poly/polypack.ts +468 -0
- package/lib/poly/polyround.ts +30 -0
- package/lib/poly/polysimplify.ts +24 -0
- package/lib/poly/quad.ts +272 -0
- package/lib/poly/selfintersect.ts +87 -0
- package/lib/poly/shamos.ts +297 -0
- package/lib/poly/simplify.ts +119 -0
- package/lib/poly/topo.ts +510 -0
- package/lib/poly/union.ts +388 -0
- package/lib/util/all.ts +5 -0
- package/lib/util/bintrie.ts +603 -0
- package/lib/util/countedhash.ts +83 -0
- package/lib/util/gradient.ts +108 -0
- package/lib/util/indexedarray.ts +80 -0
- package/lib/util/util.ts +695 -0
- package/package.json +15 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare type ContextValues = {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
};
|
|
4
|
+
export interface IContext {
|
|
5
|
+
setDefaults: (o: ContextValues) => void;
|
|
6
|
+
setValues: (o: ContextValues) => void;
|
|
7
|
+
xvalue: (prop: string) => any;
|
|
8
|
+
xset: (prop: string) => boolean;
|
|
9
|
+
xflag: (prop: string) => boolean;
|
|
10
|
+
xnumber: (prop: string) => number;
|
|
11
|
+
xstring: (prop: string) => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function create(): IContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './filterexpr';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
declare enum TokType {
|
|
3
|
+
Text = 0,
|
|
4
|
+
OpenParen = 1,
|
|
5
|
+
CloseParen = 2,
|
|
6
|
+
Not = 3,
|
|
7
|
+
And = 4,
|
|
8
|
+
Or = 5,
|
|
9
|
+
Colon = 6,
|
|
10
|
+
GreaterThan = 7,
|
|
11
|
+
GreaterThanEqual = 8,
|
|
12
|
+
Equal = 9,
|
|
13
|
+
LessThan = 10,
|
|
14
|
+
LessThanEqual = 11,
|
|
15
|
+
NotEqual = 12
|
|
16
|
+
}
|
|
17
|
+
interface Token {
|
|
18
|
+
tt: TokType;
|
|
19
|
+
text?: string;
|
|
20
|
+
}
|
|
21
|
+
interface Clause {
|
|
22
|
+
op: Token;
|
|
23
|
+
operand1?: Clause;
|
|
24
|
+
operand2?: Clause;
|
|
25
|
+
}
|
|
26
|
+
declare class Lexer {
|
|
27
|
+
coder: Util.Coder;
|
|
28
|
+
tokens: Token[];
|
|
29
|
+
buf: Uint8Array;
|
|
30
|
+
tok: Uint8Array;
|
|
31
|
+
toklen: number;
|
|
32
|
+
n: number;
|
|
33
|
+
constructor(coder: Util.Coder, expr?: string);
|
|
34
|
+
set(expr: string): void;
|
|
35
|
+
pushString(s: string): void;
|
|
36
|
+
pushText(bForce?: boolean): void;
|
|
37
|
+
pushSpecial(tt: TokType): void;
|
|
38
|
+
lex(): void;
|
|
39
|
+
}
|
|
40
|
+
declare class Parser {
|
|
41
|
+
clauses: Clause[];
|
|
42
|
+
constructor();
|
|
43
|
+
get clause(): Clause;
|
|
44
|
+
initFromTokens(tokens: Token[]): void;
|
|
45
|
+
initFromClauses(clauses: Clause[]): void;
|
|
46
|
+
convertOpToText(): void;
|
|
47
|
+
combineParenthetical(): void;
|
|
48
|
+
combineUnary(): void;
|
|
49
|
+
combineColon(): void;
|
|
50
|
+
combineBinary(tt: TokType): void;
|
|
51
|
+
combineImplicitAnd(): void;
|
|
52
|
+
clausesFromTokens(tokens: Token[]): void;
|
|
53
|
+
}
|
|
54
|
+
export declare class FilterExpr {
|
|
55
|
+
lexer: Lexer;
|
|
56
|
+
parser: Parser;
|
|
57
|
+
constructor(coder: Util.Coder, expr?: string);
|
|
58
|
+
set(expr: string): void;
|
|
59
|
+
test(o: any, types?: any): boolean;
|
|
60
|
+
asString(): string;
|
|
61
|
+
containsClause(expr: string): boolean;
|
|
62
|
+
addClause(expr: string): void;
|
|
63
|
+
removeClause(expr: string): void;
|
|
64
|
+
asStringClause(clause: Clause): string;
|
|
65
|
+
testClause(o: any, types: any, clause: Clause, prop?: string, relation?: TokType): boolean;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fsm';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
export declare const FSM_STARTING: number;
|
|
3
|
+
export declare const FSM_PENDING: number;
|
|
4
|
+
export declare const FSM_DONE: number;
|
|
5
|
+
export declare const FSM_ERROR: number;
|
|
6
|
+
export declare const FSM_RELEASED: number;
|
|
7
|
+
export declare const FSM_CUSTOM1: number;
|
|
8
|
+
export declare const FSM_CUSTOM2: number;
|
|
9
|
+
export declare const FSM_CUSTOM3: number;
|
|
10
|
+
export declare const FSM_CUSTOM4: number;
|
|
11
|
+
export declare const FSM_CUSTOM5: number;
|
|
12
|
+
export declare const FSM_CUSTOM6: number;
|
|
13
|
+
export declare const FSM_CUSTOM7: number;
|
|
14
|
+
export declare const FSM_CUSTOM8: number;
|
|
15
|
+
export declare const FSM_CUSTOM9: number;
|
|
16
|
+
export declare type FsmIndex = {
|
|
17
|
+
[key: number]: Fsm;
|
|
18
|
+
};
|
|
19
|
+
export declare class FsmManager {
|
|
20
|
+
theId: number;
|
|
21
|
+
theEpoch: number;
|
|
22
|
+
bTickSet: boolean;
|
|
23
|
+
theTickList: FsmIndex;
|
|
24
|
+
theBusyLoopCount: number;
|
|
25
|
+
constructor();
|
|
26
|
+
forceTick(fsm: Fsm): void;
|
|
27
|
+
doTick(): void;
|
|
28
|
+
}
|
|
29
|
+
export interface FsmEnvironment {
|
|
30
|
+
fsmManager: FsmManager;
|
|
31
|
+
}
|
|
32
|
+
export declare class Fsm {
|
|
33
|
+
id: number;
|
|
34
|
+
state: number;
|
|
35
|
+
dependentError: boolean;
|
|
36
|
+
epochDone: number;
|
|
37
|
+
_env: FsmEnvironment;
|
|
38
|
+
_waitOn: FsmIndex;
|
|
39
|
+
_waitedOn: FsmIndex;
|
|
40
|
+
constructor(env: FsmEnvironment);
|
|
41
|
+
get env(): FsmEnvironment;
|
|
42
|
+
get manager(): FsmManager;
|
|
43
|
+
get done(): boolean;
|
|
44
|
+
get ready(): boolean;
|
|
45
|
+
get iserror(): boolean;
|
|
46
|
+
get isDependentError(): boolean;
|
|
47
|
+
setDependentError(): void;
|
|
48
|
+
clearDependentError(): void;
|
|
49
|
+
get ticked(): boolean;
|
|
50
|
+
get nWaitOn(): number;
|
|
51
|
+
get nWaitedOn(): number;
|
|
52
|
+
waitOn(fsm: Fsm | Fsm[]): Fsm;
|
|
53
|
+
setState(state: number): void;
|
|
54
|
+
end(state?: number): void;
|
|
55
|
+
preTick(): void;
|
|
56
|
+
tick(): void;
|
|
57
|
+
}
|
|
58
|
+
export declare class FsmOnDone extends Fsm {
|
|
59
|
+
cb: any;
|
|
60
|
+
fsm: Fsm | Fsm[];
|
|
61
|
+
constructor(env: FsmEnvironment, fsm: Fsm | Fsm[], cb: any);
|
|
62
|
+
tick(): void;
|
|
63
|
+
}
|
|
64
|
+
export declare class FsmSleep extends Fsm {
|
|
65
|
+
delay: number;
|
|
66
|
+
timeoutHandle: any;
|
|
67
|
+
constructor(env: FsmEnvironment, delay: number);
|
|
68
|
+
tick(): void;
|
|
69
|
+
}
|
|
70
|
+
export declare type SerializerIndex = {
|
|
71
|
+
[key: string]: Fsm;
|
|
72
|
+
};
|
|
73
|
+
export declare class FsmSerializer extends Fsm {
|
|
74
|
+
index: SerializerIndex;
|
|
75
|
+
constructor(env: FsmEnvironment);
|
|
76
|
+
serialize(id: string, fsm?: Fsm): Fsm;
|
|
77
|
+
tick(): void;
|
|
78
|
+
}
|
|
79
|
+
declare type FsmArrayMap = {
|
|
80
|
+
[key: string]: Fsm[];
|
|
81
|
+
};
|
|
82
|
+
export declare class FsmTracker {
|
|
83
|
+
env: FsmEnvironment;
|
|
84
|
+
map: FsmArrayMap;
|
|
85
|
+
constructor(env: FsmEnvironment);
|
|
86
|
+
_track(uid: string, fsm: Fsm): void;
|
|
87
|
+
_untrack(uid: string, fsm: Fsm): void;
|
|
88
|
+
track(uid: string, fsm: Fsm): Fsm;
|
|
89
|
+
maybeWait(uid: string, fsm: Fsm): void;
|
|
90
|
+
}
|
|
91
|
+
export interface LoopOptions {
|
|
92
|
+
minRepeatInterval?: number;
|
|
93
|
+
exitOnError?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare const DefaultLoopOptions: {
|
|
96
|
+
minRepeatInterval: number;
|
|
97
|
+
exitOnError: boolean;
|
|
98
|
+
};
|
|
99
|
+
export declare class FsmLoop extends Fsm {
|
|
100
|
+
fsm: Fsm;
|
|
101
|
+
options: LoopOptions;
|
|
102
|
+
elapsed: Util.Elapsed;
|
|
103
|
+
constructor(env: FsmEnvironment, fsm: Fsm, options?: LoopOptions);
|
|
104
|
+
tick(): void;
|
|
105
|
+
}
|
|
106
|
+
export interface ISet {
|
|
107
|
+
test: (o: any) => boolean;
|
|
108
|
+
reset: () => void;
|
|
109
|
+
}
|
|
110
|
+
export declare class FsmArray extends Fsm {
|
|
111
|
+
a: any[];
|
|
112
|
+
iset: ISet;
|
|
113
|
+
constructor(env: FsmEnvironment, iset?: ISet);
|
|
114
|
+
push(o: any): void;
|
|
115
|
+
concat(a: any[]): void;
|
|
116
|
+
splice(i?: number, n?: number): void;
|
|
117
|
+
reset(): void;
|
|
118
|
+
}
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as geojson from 'geojson';
|
|
2
|
+
import * as Poly from '../poly/all';
|
|
3
|
+
export declare type GeoProperties = geojson.GeoJsonProperties;
|
|
4
|
+
export declare type GeoFeature = geojson.Feature;
|
|
5
|
+
export declare type GeoFeatureArray = GeoFeature[];
|
|
6
|
+
export declare type GeoFeatureCollection = geojson.FeatureCollection;
|
|
7
|
+
export declare function geoCollectionToMap(col: GeoFeatureCollection): GeoFeatureMap;
|
|
8
|
+
export declare function geoMapToCollection(map: GeoFeatureMap): GeoFeatureCollection;
|
|
9
|
+
export declare function geoCollectionToTopo(col: GeoFeatureCollection): Poly.Topo;
|
|
10
|
+
export declare function geoTopoToCollection(topo: Poly.Topo): GeoFeatureCollection;
|
|
11
|
+
export interface GeoFeatureMap {
|
|
12
|
+
[id: string]: GeoFeature;
|
|
13
|
+
}
|
|
14
|
+
export declare type FeatureFunc = (f: GeoFeature) => void;
|
|
15
|
+
interface GeoEntry {
|
|
16
|
+
tag: string;
|
|
17
|
+
col?: GeoFeatureCollection;
|
|
18
|
+
map?: GeoFeatureMap;
|
|
19
|
+
topo?: Poly.Topo;
|
|
20
|
+
}
|
|
21
|
+
declare type GeoEntryMap = {
|
|
22
|
+
[tag: string]: GeoEntry;
|
|
23
|
+
};
|
|
24
|
+
export declare function geoEqual(m1: GeoMultiCollection, m2: GeoMultiCollection): boolean;
|
|
25
|
+
export declare function geoMapEqual(m1: GeoFeatureMap, m2: GeoFeatureMap): boolean;
|
|
26
|
+
export declare class GeoMultiCollection {
|
|
27
|
+
entries: GeoEntryMap;
|
|
28
|
+
all: GeoEntry;
|
|
29
|
+
hidden: any;
|
|
30
|
+
stamp: number;
|
|
31
|
+
constructor(tag?: string, topo?: Poly.Topo, col?: GeoFeatureCollection, map?: GeoFeatureMap);
|
|
32
|
+
empty(): void;
|
|
33
|
+
get nEntries(): number;
|
|
34
|
+
nthEntry(n: number): GeoEntry;
|
|
35
|
+
add(tag: string, topo: Poly.Topo, col: GeoFeatureCollection, map: GeoFeatureMap): void;
|
|
36
|
+
addMulti(multi: GeoMultiCollection): void;
|
|
37
|
+
remove(tag: string): void;
|
|
38
|
+
_onChange(): void;
|
|
39
|
+
_col(e: GeoEntry): GeoFeatureCollection;
|
|
40
|
+
_map(e: GeoEntry): GeoFeatureMap;
|
|
41
|
+
_topo(e: GeoEntry): Poly.Topo;
|
|
42
|
+
colOf(tag: string): GeoFeatureCollection;
|
|
43
|
+
mapOf(tag: string): GeoFeatureMap;
|
|
44
|
+
topoOf(tag: string): Poly.Topo;
|
|
45
|
+
forEachEntry(cb: (e: GeoEntry) => void): void;
|
|
46
|
+
allCol(): GeoFeatureCollection;
|
|
47
|
+
allMap(): GeoFeatureMap;
|
|
48
|
+
allTopo(): Poly.Topo;
|
|
49
|
+
hide(id: any): void;
|
|
50
|
+
show(id: any): void;
|
|
51
|
+
showAll(): void;
|
|
52
|
+
get length(): number;
|
|
53
|
+
nthFeature(n: number): GeoFeature;
|
|
54
|
+
nthFilteredFeature(n: number, cb: (f: GeoFeature) => boolean): GeoFeature;
|
|
55
|
+
forEach(cb: FeatureFunc): void;
|
|
56
|
+
map(cb: (f: GeoFeature) => GeoFeature): GeoFeature[];
|
|
57
|
+
isHidden(id: string): boolean;
|
|
58
|
+
find(id: string): GeoFeature;
|
|
59
|
+
filter(test: (f: GeoFeature) => boolean): GeoMultiCollection;
|
|
60
|
+
}
|
|
61
|
+
export declare enum geoIntersectOptions {
|
|
62
|
+
Intersects = 0,
|
|
63
|
+
Bounds = 1,
|
|
64
|
+
BoundsCenter = 2
|
|
65
|
+
}
|
|
66
|
+
export declare function geoIntersect(multi: GeoMultiCollection, bbox: Poly.BoundBox, opt: geoIntersectOptions): GeoMultiCollection;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './log';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as Util from '../util/all';
|
|
2
|
+
import * as FSM from '../fsm/all';
|
|
3
|
+
export interface ILog {
|
|
4
|
+
dump: () => FSM.Fsm;
|
|
5
|
+
stamp: (o: any) => void;
|
|
6
|
+
log: (o: any, verbosity?: number) => void;
|
|
7
|
+
event: (o: any, verbosity?: number) => void;
|
|
8
|
+
error: (o: any) => void;
|
|
9
|
+
value: (o: any, verbosity?: number) => void;
|
|
10
|
+
chatter: (s: string) => void;
|
|
11
|
+
chatters: () => string[];
|
|
12
|
+
}
|
|
13
|
+
export declare class Timer {
|
|
14
|
+
ilog: ILog;
|
|
15
|
+
o: any;
|
|
16
|
+
verbosity: number;
|
|
17
|
+
elapsed: Util.Elapsed;
|
|
18
|
+
constructor(ilog: ILog, kind: string, o: any, verbosity?: number);
|
|
19
|
+
log(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class AsyncTimer extends Timer {
|
|
22
|
+
constructor(ilog: ILog, o: any, verbosity?: number);
|
|
23
|
+
}
|
|
24
|
+
export declare class SyncTimer extends Timer {
|
|
25
|
+
constructor(ilog: ILog, o: any, verbosity?: number);
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './log';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as LogAbstract from '../logabstract/all';
|
|
2
|
+
import * as OT from '../ot-js/all';
|
|
3
|
+
export declare class OTEditUtil {
|
|
4
|
+
ilog: LogAbstract.ILog;
|
|
5
|
+
resourceID: string;
|
|
6
|
+
resourceName: string;
|
|
7
|
+
clientID: string;
|
|
8
|
+
constructor(ilog: LogAbstract.ILog, rid: string, cid: string, name: string);
|
|
9
|
+
insertAtStart(s: any, nCurrentLen: number): OT.OTCompositeResource;
|
|
10
|
+
insertAtEnd(s: any, nCurrentLen: number): OT.OTCompositeResource;
|
|
11
|
+
injectCursor(edit: OT.OTCompositeResource, start: number, end?: number): void;
|
|
12
|
+
extractCursor(edit: OT.OTCompositeResource): any;
|
|
13
|
+
computeEdit(sOld: string, sNew: string): OT.OTCompositeResource;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as OT from '../ot-js/all';
|
|
2
|
+
export declare const MERGE: number;
|
|
3
|
+
export declare const REPLACE: number;
|
|
4
|
+
export declare class Editor {
|
|
5
|
+
private engine;
|
|
6
|
+
private root;
|
|
7
|
+
private stamps;
|
|
8
|
+
constructor(engine: OT.OTEngine);
|
|
9
|
+
startLocalEdit(): void;
|
|
10
|
+
stamp(rid: string, prop: string): void;
|
|
11
|
+
set(rid: string, p: string, v: any): Editor;
|
|
12
|
+
del(rid: string, p: string): Editor;
|
|
13
|
+
rawObject(rid: string): OT.OTMapResource;
|
|
14
|
+
rawArray(rid: string): OT.OTArrayResource;
|
|
15
|
+
editCounter(rid: string, oNew: any, mode?: number): void;
|
|
16
|
+
editObject(rid: string, oNew: any, mode?: number): void;
|
|
17
|
+
editArray(rid: string, aNew: any[]): void;
|
|
18
|
+
edit(oNew: any): boolean;
|
|
19
|
+
get length(): number;
|
|
20
|
+
commit(): boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./otarray";
|
|
2
|
+
export * from "./otengine";
|
|
3
|
+
export * from "./otclientengine";
|
|
4
|
+
export * from "./otcomposite";
|
|
5
|
+
export * from "./otmap";
|
|
6
|
+
export * from "./otcounter";
|
|
7
|
+
export * from "./otserverengine";
|
|
8
|
+
export * from "./ottypes";
|
|
9
|
+
export * from "./otsession";
|
|
@@ -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
|
+
}
|