@graffy/common 0.15.8-alpha.3 → 0.15.8-alpha.4
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/package.json +4 -4
- package/types/coding/alphabet.d.ts +2 -0
- package/types/coding/args.d.ts +5 -0
- package/types/coding/base64.d.ts +2 -0
- package/types/coding/decodeTree.d.ts +2 -0
- package/types/coding/decorate.d.ts +1 -0
- package/types/coding/encodeTree.d.ts +2 -0
- package/types/coding/id.d.ts +2 -0
- package/types/coding/index.d.ts +9 -0
- package/types/coding/number.d.ts +2 -0
- package/types/coding/path.d.ts +3 -0
- package/types/coding/serialize.d.ts +2 -0
- package/types/coding/string.d.ts +2 -0
- package/types/coding/struct.d.ts +10 -0
- package/types/coding/url.d.ts +2 -0
- package/types/index.d.ts +6 -0
- package/types/node/find.d.ts +2 -0
- package/types/node/index.d.ts +2 -0
- package/types/node/types.d.ts +7 -0
- package/types/object.d.ts +4 -0
- package/types/ops/add.d.ts +1 -0
- package/types/ops/finalize.d.ts +5 -0
- package/types/ops/getKnown.d.ts +4 -0
- package/types/ops/index.d.ts +9 -0
- package/types/ops/merge.d.ts +3 -0
- package/types/ops/path.d.ts +6 -0
- package/types/ops/setVersion.d.ts +1 -0
- package/types/ops/sieve.d.ts +3 -0
- package/types/ops/slice.d.ts +13 -0
- package/types/ops/step.d.ts +6 -0
- package/types/stream/index.d.ts +2 -0
- package/types/stream/makeWatcher.d.ts +4 -0
- package/types/stream/mergeStreams.d.ts +1 -0
- package/types/util.d.ts +9 -0
- package/index.d.ts +0 -200
package/package.json
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"name": "@graffy/common",
|
|
3
3
|
"description": "Common libraries that used by various Graffy modules.",
|
|
4
4
|
"author": "aravind (https://github.com/aravindet)",
|
|
5
|
-
"version": "0.15.8-alpha.
|
|
5
|
+
"version": "0.15.8-alpha.4",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./index.mjs",
|
|
9
9
|
"require": "./index.cjs"
|
|
10
10
|
},
|
|
11
11
|
"module": "./index.mjs",
|
|
12
|
-
"types": "./index.d.ts",
|
|
12
|
+
"types": "./types/index.d.ts",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/usegraffy/graffy.git"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"text-encoder-lite": "^2.0.0",
|
|
20
20
|
"global": "^4.4.0",
|
|
21
21
|
"nanoid": "^3.1.25",
|
|
22
|
-
"@graffy/testing": "0.15.8-alpha.
|
|
22
|
+
"@graffy/testing": "0.15.8-alpha.4",
|
|
23
23
|
"merge-async-iterators": "^0.2.1",
|
|
24
|
-
"@graffy/stream": "0.15.8-alpha.
|
|
24
|
+
"@graffy/stream": "0.15.8-alpha.4",
|
|
25
25
|
"lodash": "^4.17.19"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function decorate(rootGraph: any, rootQuery: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as makeId } from "./id.js";
|
|
2
|
+
export { default as decorate } from "./decorate.js";
|
|
3
|
+
export * from "./serialize.js";
|
|
4
|
+
export * from "./encodeTree.js";
|
|
5
|
+
export * from "./decodeTree.js";
|
|
6
|
+
export { encode as encodeUrl, decode as decodeUrl } from "./url.js";
|
|
7
|
+
export { encode as encodeValue, decode as decodeValue } from "./struct.js";
|
|
8
|
+
export { encode as encodeArgs, decode as decodeArgs, splitArgs } from "./args.js";
|
|
9
|
+
export { encode as encodePath, decode as decodePath, splitRef } from "./path.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function encode(value: any): string;
|
|
2
|
+
export function decode(key: any): any;
|
|
3
|
+
export const END: 0;
|
|
4
|
+
export const NULL: 1;
|
|
5
|
+
export const FALSE: 2;
|
|
6
|
+
export const TRUE: 3;
|
|
7
|
+
export const NUM: 4;
|
|
8
|
+
export const STR: 5;
|
|
9
|
+
export const ARR: 6;
|
|
10
|
+
export const OBJ: 7;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function isRange(node: any): boolean;
|
|
2
|
+
export function isBranch(node: any): boolean;
|
|
3
|
+
export function isPrefix(node: any): any;
|
|
4
|
+
export function isLink(node: any): boolean;
|
|
5
|
+
export function isEncoded(node: any): boolean;
|
|
6
|
+
export function isOlder(node: any, version: any): boolean;
|
|
7
|
+
export function isNewer(node: any, version: any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function add(base: any, diff: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as add } from "./add.js";
|
|
2
|
+
export { default as merge } from "./merge.js";
|
|
3
|
+
export { default as slice } from "./slice.js";
|
|
4
|
+
export { default as sieve } from "./sieve.js";
|
|
5
|
+
export { default as setVersion } from "./setVersion.js";
|
|
6
|
+
export { default as getKnown } from "./getKnown.js";
|
|
7
|
+
export { default as finalize } from "./finalize.js";
|
|
8
|
+
export * from "./step.js";
|
|
9
|
+
export * from "./path.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function wrapValue(value: any, path: any, version?: number): any;
|
|
2
|
+
export function wrap(children: any, path: any, version?: number, prefix?: boolean): any;
|
|
3
|
+
export function unwrap(children: any, path: any): any;
|
|
4
|
+
export function getNodeValue(node: any): any;
|
|
5
|
+
export function remove(children: any, path: any): any;
|
|
6
|
+
export const IS_VAL: unique symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function setVersion(graph: any, version: any): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function slice(graph: any, query: any, root: any): Result;
|
|
2
|
+
export function sliceRange(graph: any, query: any, result: any): void;
|
|
3
|
+
declare class Result {
|
|
4
|
+
constructor(root: any);
|
|
5
|
+
root: any;
|
|
6
|
+
addKnown(node: any): void;
|
|
7
|
+
known: any;
|
|
8
|
+
addUnknown(node: any): void;
|
|
9
|
+
unknown: any;
|
|
10
|
+
addLinked(children: any): any;
|
|
11
|
+
linked: any;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function mergeStreams(...streams: any[]): AsyncGenerator<any, void, any>;
|
package/types/util.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function err(message: any, { cause, ...args }?: {
|
|
2
|
+
cause: any;
|
|
3
|
+
}): void;
|
|
4
|
+
export function errIf(message: any, condition: any, args: any): void;
|
|
5
|
+
export function isEmpty(object: any): boolean;
|
|
6
|
+
export function isDef(value: any): boolean;
|
|
7
|
+
export function isPlainObject(arg: any): boolean;
|
|
8
|
+
export function isEncodedKey(str: any): boolean;
|
|
9
|
+
export function find(items: any, compare: any, first?: number, last?: any): number;
|
package/index.d.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
declare module "coding/url" {
|
|
2
|
-
export function encode(query: any): string;
|
|
3
|
-
export function decode(fields: any): any;
|
|
4
|
-
}
|
|
5
|
-
declare module "coding/string" {
|
|
6
|
-
export function encode(string: any): any;
|
|
7
|
-
export function decode(u8Arr: any): any;
|
|
8
|
-
}
|
|
9
|
-
declare module "coding/number" {
|
|
10
|
-
export function encode(number: any): Uint8Array;
|
|
11
|
-
export function decode(u8Arr: any): number;
|
|
12
|
-
}
|
|
13
|
-
declare module "coding/alphabet" {
|
|
14
|
-
var _default: "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
15
|
-
export default _default;
|
|
16
|
-
}
|
|
17
|
-
declare module "coding/base64" {
|
|
18
|
-
export function encode(u8Arr: any): string;
|
|
19
|
-
export function decode(string: any, start?: number): Uint8Array;
|
|
20
|
-
}
|
|
21
|
-
declare module "coding/struct" {
|
|
22
|
-
export function encode(value: any): string;
|
|
23
|
-
export function decode(key: any): any;
|
|
24
|
-
export const END: 0;
|
|
25
|
-
export const NULL: 1;
|
|
26
|
-
export const FALSE: 2;
|
|
27
|
-
export const TRUE: 3;
|
|
28
|
-
export const NUM: 4;
|
|
29
|
-
export const STR: 5;
|
|
30
|
-
export const ARR: 6;
|
|
31
|
-
export const OBJ: 7;
|
|
32
|
-
}
|
|
33
|
-
declare module "ops/step" {
|
|
34
|
-
export function keyStep(key: any): {
|
|
35
|
-
key: any;
|
|
36
|
-
step: number;
|
|
37
|
-
};
|
|
38
|
-
export function keyBefore(key: any): any;
|
|
39
|
-
export function keyAfter(key: any): any;
|
|
40
|
-
}
|
|
41
|
-
declare module "util" {
|
|
42
|
-
export function err(message: any, { cause, ...args }?: {
|
|
43
|
-
cause: any;
|
|
44
|
-
}): void;
|
|
45
|
-
export function errIf(message: any, condition: any, args: any): void;
|
|
46
|
-
export function isEmpty(object: any): boolean;
|
|
47
|
-
export function isDef(value: any): boolean;
|
|
48
|
-
export function isPlainObject(arg: any): boolean;
|
|
49
|
-
export function isEncodedKey(str: any): boolean;
|
|
50
|
-
export function find(items: any, compare: any, first?: number, last?: any): number;
|
|
51
|
-
}
|
|
52
|
-
declare module "coding/args" {
|
|
53
|
-
export function splitArgs(arg: any): {}[];
|
|
54
|
-
export function encode(arg: any): {
|
|
55
|
-
key: string;
|
|
56
|
-
};
|
|
57
|
-
export function decode(node: any): any;
|
|
58
|
-
}
|
|
59
|
-
declare module "coding/path" {
|
|
60
|
-
export function encode(path: any): string[];
|
|
61
|
-
export function decode(path: any): any[];
|
|
62
|
-
export function splitRef($ref: any): {}[];
|
|
63
|
-
}
|
|
64
|
-
declare module "coding/id" {
|
|
65
|
-
var _default: () => string;
|
|
66
|
-
export default _default;
|
|
67
|
-
}
|
|
68
|
-
declare module "node/find" {
|
|
69
|
-
export function findFirst(children: any, target: any): number;
|
|
70
|
-
export function findLast(children: any, end: any, first: any, last: any): number;
|
|
71
|
-
}
|
|
72
|
-
declare module "node/types" {
|
|
73
|
-
export function isRange(node: any): boolean;
|
|
74
|
-
export function isBranch(node: any): boolean;
|
|
75
|
-
export function isPrefix(node: any): any;
|
|
76
|
-
export function isLink(node: any): boolean;
|
|
77
|
-
export function isEncoded(node: any): boolean;
|
|
78
|
-
export function isOlder(node: any, version: any): boolean;
|
|
79
|
-
export function isNewer(node: any, version: any): boolean;
|
|
80
|
-
}
|
|
81
|
-
declare module "node/index" {
|
|
82
|
-
export * from "node/find";
|
|
83
|
-
export * from "node/types";
|
|
84
|
-
}
|
|
85
|
-
declare module "ops/add" {
|
|
86
|
-
export default function add(base: any, diff: any): any;
|
|
87
|
-
}
|
|
88
|
-
declare module "ops/merge" {
|
|
89
|
-
export default function merge(current: any, changes: any): any;
|
|
90
|
-
export function insertRange(current: any, change: any, start?: number): number;
|
|
91
|
-
export function insertNode(current: any, change: any, start?: number): any;
|
|
92
|
-
}
|
|
93
|
-
declare module "ops/path" {
|
|
94
|
-
export function wrapValue(value: any, path: any, version?: number): any;
|
|
95
|
-
export function wrap(children: any, path: any, version?: number, prefix?: boolean): any;
|
|
96
|
-
export function unwrap(children: any, path: any): any;
|
|
97
|
-
export function getNodeValue(node: any): any;
|
|
98
|
-
export function remove(children: any, path: any): any;
|
|
99
|
-
export const IS_VAL: unique symbol;
|
|
100
|
-
}
|
|
101
|
-
declare module "ops/slice" {
|
|
102
|
-
export default function slice(graph: any, query: any, root: any): Result;
|
|
103
|
-
export function sliceRange(graph: any, query: any, result: any): void;
|
|
104
|
-
class Result {
|
|
105
|
-
constructor(root: any);
|
|
106
|
-
root: any;
|
|
107
|
-
addKnown(node: any): void;
|
|
108
|
-
known: any;
|
|
109
|
-
addUnknown(node: any): void;
|
|
110
|
-
unknown: any;
|
|
111
|
-
addLinked(children: any): any;
|
|
112
|
-
linked: any;
|
|
113
|
-
}
|
|
114
|
-
export {};
|
|
115
|
-
}
|
|
116
|
-
declare module "ops/sieve" {
|
|
117
|
-
export default function sieve(current: any, changes: any, result?: any[]): any[];
|
|
118
|
-
export function insertRange(current: any, change: any, result: any, start?: number): number;
|
|
119
|
-
export function insertNode(current: any, change: any, result: any, start?: number): any;
|
|
120
|
-
}
|
|
121
|
-
declare module "ops/setVersion" {
|
|
122
|
-
export default function setVersion(graph: any, version: any): any;
|
|
123
|
-
}
|
|
124
|
-
declare module "ops/getKnown" {
|
|
125
|
-
export default function getKnown(graph: any, version?: number): {
|
|
126
|
-
key: any;
|
|
127
|
-
version: number;
|
|
128
|
-
}[];
|
|
129
|
-
}
|
|
130
|
-
declare module "ops/finalize" {
|
|
131
|
-
export default function finalize(graph: any, query: any, version?: number): {
|
|
132
|
-
key: string;
|
|
133
|
-
end: string;
|
|
134
|
-
version: number;
|
|
135
|
-
}[];
|
|
136
|
-
}
|
|
137
|
-
declare module "ops/index" {
|
|
138
|
-
export { default as add } from "./add.js";
|
|
139
|
-
export { default as merge } from "./merge.js";
|
|
140
|
-
export { default as slice } from "./slice.js";
|
|
141
|
-
export { default as sieve } from "./sieve.js";
|
|
142
|
-
export { default as setVersion } from "./setVersion.js";
|
|
143
|
-
export { default as getKnown } from "./getKnown.js";
|
|
144
|
-
export { default as finalize } from "./finalize.js";
|
|
145
|
-
export * from "ops/step";
|
|
146
|
-
export * from "ops/path";
|
|
147
|
-
}
|
|
148
|
-
declare module "coding/decodeTree" {
|
|
149
|
-
export function decodeGraph(graph: any): any;
|
|
150
|
-
export function decodeQuery(query: any): any;
|
|
151
|
-
}
|
|
152
|
-
declare module "coding/decorate" {
|
|
153
|
-
export default function decorate(rootGraph: any, rootQuery: any): any;
|
|
154
|
-
}
|
|
155
|
-
declare module "coding/serialize" {
|
|
156
|
-
export function serialize(obj: any): string;
|
|
157
|
-
export function deserialize(str: any): any;
|
|
158
|
-
}
|
|
159
|
-
declare module "coding/encodeTree" {
|
|
160
|
-
export function encodeGraph(obj: any, version?: number): any;
|
|
161
|
-
export function encodeQuery(obj: any, version?: number): any;
|
|
162
|
-
}
|
|
163
|
-
declare module "coding/index" {
|
|
164
|
-
export { default as makeId } from "./id.js";
|
|
165
|
-
export { default as decorate } from "./decorate.js";
|
|
166
|
-
export * from "coding/serialize";
|
|
167
|
-
export * from "coding/encodeTree";
|
|
168
|
-
export * from "coding/decodeTree";
|
|
169
|
-
export { encode as encodeUrl, decode as decodeUrl } from "./url.js";
|
|
170
|
-
export { encode as encodeValue, decode as decodeValue } from "./struct.js";
|
|
171
|
-
export { encode as encodeArgs, decode as decodeArgs, splitArgs } from "./args.js";
|
|
172
|
-
export { encode as encodePath, decode as decodePath, splitRef } from "./path.js";
|
|
173
|
-
}
|
|
174
|
-
declare module "stream/mergeStreams" {
|
|
175
|
-
export default function mergeStreams(...streams: any[]): AsyncGenerator<any, void, any>;
|
|
176
|
-
}
|
|
177
|
-
declare module "stream/makeWatcher" {
|
|
178
|
-
export default function makeWatcher(): {
|
|
179
|
-
write: (change: any) => void;
|
|
180
|
-
watch: (...args: any[]) => any;
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
declare module "stream/index" {
|
|
184
|
-
export { default as mergeStreams } from "./mergeStreams.js";
|
|
185
|
-
export { default as makeWatcher } from "./makeWatcher.js";
|
|
186
|
-
}
|
|
187
|
-
declare module "object" {
|
|
188
|
-
export function mergeObject(base: any, change: any): any;
|
|
189
|
-
export function cloneObject(object: any): any;
|
|
190
|
-
export function wrapObject(object: any, path: any): any;
|
|
191
|
-
export function unwrapObject(object: any, path: any): any;
|
|
192
|
-
}
|
|
193
|
-
declare module "index" {
|
|
194
|
-
export * from "coding";
|
|
195
|
-
export * from "ops";
|
|
196
|
-
export * from "node";
|
|
197
|
-
export * from "stream";
|
|
198
|
-
export * from "object";
|
|
199
|
-
export * from "util";
|
|
200
|
-
}
|