@cr_docs_t/dts 0.26.0 → 0.28.0

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.
@@ -11,7 +11,7 @@ export declare class FugueTree {
11
11
  readonly replicaID: string;
12
12
  userIdentity: string;
13
13
  pendingMsgs: Map<string, FugueMessage>;
14
- readonly batchSize = 100;
14
+ readonly batchSize = 400;
15
15
  constructor(ws: WebSocket | null, documentID: string, userIdentity: string);
16
16
  /**
17
17
  * Make msg key for pending messages map
@@ -11,7 +11,7 @@ export class FugueTree {
11
11
  this.replicaID = randomString(3);
12
12
  this.pendingMsgs = new Map();
13
13
  // Tentative
14
- this.batchSize = 100;
14
+ this.batchSize = 400;
15
15
  this.ws = ws;
16
16
  this.documentID = documentID;
17
17
  this.userIdentity = userIdentity;
@@ -1 +1 @@
1
- {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/dts/Serailizers/FugueTree/State.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,iBAAS,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAAC,eAAe,CAAC,CAG5D;AAED,iBAAS,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC,GAAG,KAAK,CAMnE;AAED,eAAO,MAAM,oBAAoB;;;CAGhC,CAAC"}
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/dts/Serailizers/FugueTree/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,iBAAS,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAAC,eAAe,CAAC,CAG5D;AAED,iBAAS,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC,eAAe,CAAC,GAAG,KAAK,CAMnE;AAED,eAAO,MAAM,oBAAoB;;;CAGhC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./parser.js";
2
+ export * from "./types/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/treesitter/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./parser.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,6 @@
1
+ import { Parser, Query } from "web-tree-sitter";
2
+ export declare const newParser: (treeSitterLatexPath: string, queryFilePath: string) => Promise<{
3
+ parser: Parser;
4
+ query: Query;
5
+ }>;
6
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/treesitter/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAI1D,eAAO,MAAM,SAAS,GAAU,qBAAqB,MAAM,EAAE,eAAe,MAAM;YAF/C,MAAM;WAAS,KAAK;EA8BtD,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { Language, Parser, Query } from "web-tree-sitter";
2
+ let initPromise = null;
3
+ export const newParser = async (treeSitterLatexPath, queryFilePath) => {
4
+ if (initPromise)
5
+ return initPromise;
6
+ initPromise = (async () => {
7
+ try {
8
+ await Parser.init({
9
+ locateFile: (name, dir) => {
10
+ console.log({ name, dir });
11
+ // return `/${name}`;
12
+ return "/tree-sitter.wasm";
13
+ },
14
+ });
15
+ const parser = new Parser();
16
+ // const Latex = await Language.load("/tree-sitter-latex.wasm");
17
+ const Latex = await Language.load(treeSitterLatexPath);
18
+ parser.setLanguage(Latex);
19
+ // Load query file from public
20
+ // const schContent = await fetch("/highlights.scm").then((res) => res.text());
21
+ const schContent = await fetch(queryFilePath).then((res) => res.text());
22
+ const query = new Query(Latex, schContent);
23
+ return { parser, query };
24
+ }
25
+ catch (error) {
26
+ initPromise = null; // Reset on failure to allow retry
27
+ console.error("Error initializing Tree-sitter:", error);
28
+ throw error;
29
+ }
30
+ })();
31
+ return initPromise;
32
+ };