@yurikasper/latent-grid 0.1.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.
- package/README.md +4 -0
- package/dist/client/client/client.gen.d.ts +3 -0
- package/dist/client/client/client.gen.d.ts.map +1 -0
- package/dist/client/client/client.gen.js +229 -0
- package/dist/client/client/client.gen.js.map +1 -0
- package/dist/client/client/index.d.ts +9 -0
- package/dist/client/client/index.d.ts.map +1 -0
- package/dist/client/client/index.js +7 -0
- package/dist/client/client/index.js.map +1 -0
- package/dist/client/client/types.gen.d.ts +118 -0
- package/dist/client/client/types.gen.d.ts.map +1 -0
- package/dist/client/client/types.gen.js +3 -0
- package/dist/client/client/types.gen.js.map +1 -0
- package/dist/client/client/utils.gen.d.ts +34 -0
- package/dist/client/client/utils.gen.d.ts.map +1 -0
- package/dist/client/client/utils.gen.js +232 -0
- package/dist/client/client/utils.gen.js.map +1 -0
- package/dist/client/client.gen.d.ts +13 -0
- package/dist/client/client.gen.d.ts.map +1 -0
- package/dist/client/client.gen.js +4 -0
- package/dist/client/client.gen.js.map +1 -0
- package/dist/client/core/auth.gen.d.ts +19 -0
- package/dist/client/core/auth.gen.d.ts.map +1 -0
- package/dist/client/core/auth.gen.js +15 -0
- package/dist/client/core/auth.gen.js.map +1 -0
- package/dist/client/core/bodySerializer.gen.d.ts +26 -0
- package/dist/client/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/bodySerializer.gen.js +58 -0
- package/dist/client/core/bodySerializer.gen.js.map +1 -0
- package/dist/client/core/params.gen.d.ts +44 -0
- package/dist/client/core/params.gen.d.ts.map +1 -0
- package/dist/client/core/params.gen.js +101 -0
- package/dist/client/core/params.gen.js.map +1 -0
- package/dist/client/core/pathSerializer.gen.d.ts +34 -0
- package/dist/client/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/client/core/pathSerializer.gen.js +115 -0
- package/dist/client/core/pathSerializer.gen.js.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/client/core/queryKeySerializer.gen.js +100 -0
- package/dist/client/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/client/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/client/core/serverSentEvents.gen.js +138 -0
- package/dist/client/core/serverSentEvents.gen.js.map +1 -0
- package/dist/client/core/types.gen.d.ts +79 -0
- package/dist/client/core/types.gen.d.ts.map +1 -0
- package/dist/client/core/types.gen.js +3 -0
- package/dist/client/core/types.gen.js.map +1 -0
- package/dist/client/core/utils.gen.d.ts +20 -0
- package/dist/client/core/utils.gen.d.ts.map +1 -0
- package/dist/client/core/utils.gen.js +88 -0
- package/dist/client/core/utils.gen.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/sdk.gen.d.ts +24 -0
- package/dist/client/sdk.gen.d.ts.map +1 -0
- package/dist/client/sdk.gen.js +25 -0
- package/dist/client/sdk.gen.js.map +1 -0
- package/dist/client/types.gen.d.ts +210 -0
- package/dist/client/types.gen.d.ts.map +1 -0
- package/dist/client/types.gen.js +3 -0
- package/dist/client/types.gen.js.map +1 -0
- package/dist/error.d.ts +9 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +7 -0
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/parse.d.ts +5 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +61 -0
- package/dist/parse.js.map +1 -0
- package/dist/parse.spec.d.ts +2 -0
- package/dist/parse.spec.d.ts.map +1 -0
- package/dist/parse.spec.js +48 -0
- package/dist/parse.spec.js.map +1 -0
- package/dist/test/table-fixture.d.ts +4 -0
- package/dist/test/table-fixture.d.ts.map +1 -0
- package/dist/test/table-fixture.js +17 -0
- package/dist/test/table-fixture.js.map +1 -0
- package/dist/types/extracted-table.d.ts +30 -0
- package/dist/types/extracted-table.d.ts.map +1 -0
- package/dist/types/extracted-table.js +48 -0
- package/dist/types/extracted-table.js.map +1 -0
- package/dist/types/extracted-table.spec.d.ts +2 -0
- package/dist/types/extracted-table.spec.d.ts.map +1 -0
- package/dist/types/extracted-table.spec.js +17 -0
- package/dist/types/extracted-table.spec.js.map +1 -0
- package/dist/types/table-cell.d.ts +85 -0
- package/dist/types/table-cell.d.ts.map +1 -0
- package/dist/types/table-cell.js +134 -0
- package/dist/types/table-cell.js.map +1 -0
- package/dist/types/table-cell.spec.d.ts +2 -0
- package/dist/types/table-cell.spec.d.ts.map +1 -0
- package/dist/types/table-cell.spec.js +32 -0
- package/dist/types/table-cell.spec.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { parseImageTableResponse } from "../parse.js";
|
|
2
|
+
import { ExtractedTable } from "../types/extracted-table.js";
|
|
3
|
+
export function buildTable(overrides = {}) {
|
|
4
|
+
const baseTable = {
|
|
5
|
+
title: "Test Table",
|
|
6
|
+
box: { x1: 0, y1: 0, x2: 100, y2: 100 },
|
|
7
|
+
grid: [
|
|
8
|
+
[0, 0],
|
|
9
|
+
[1, 2],
|
|
10
|
+
],
|
|
11
|
+
cells: [{ content: "Header" }, { content: "A" }, { content: "B" }],
|
|
12
|
+
...overrides,
|
|
13
|
+
};
|
|
14
|
+
const table = parseImageTableResponse([baseTable])[0];
|
|
15
|
+
return table;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=table-fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-fixture.js","sourceRoot":"","sources":["../../src/test/table-fixture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,UAAU,UAAU,CACtB,YAAoC,EAAE;IAEtC,MAAM,SAAS,GAAG;QACd,KAAK,EAAE,YAAY;QACnB,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE;QACvC,IAAI,EAAE;YACF,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,CAAC,CAAC,EAAE,CAAC,CAAC;SACT;QACD,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAClE,GAAG,SAAS;KACf,CAAC;IACF,MAAM,KAAK,GAAG,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,KAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TableCell } from "./table-cell.js";
|
|
2
|
+
type Box = {
|
|
3
|
+
x1: number;
|
|
4
|
+
y1: number;
|
|
5
|
+
x2: number;
|
|
6
|
+
y2: number;
|
|
7
|
+
};
|
|
8
|
+
export type TableGrid = TableCell[][];
|
|
9
|
+
export declare class ExtractedTable {
|
|
10
|
+
title?: string;
|
|
11
|
+
box: Box;
|
|
12
|
+
grid: TableGrid;
|
|
13
|
+
cells: TableCell[];
|
|
14
|
+
constructor(data: {
|
|
15
|
+
title?: string;
|
|
16
|
+
box: Box;
|
|
17
|
+
grid: TableGrid;
|
|
18
|
+
cells: TableCell[];
|
|
19
|
+
});
|
|
20
|
+
getCell(row: number, col: number): TableCell | null;
|
|
21
|
+
findCellsByContent(search: string | RegExp): TableCell[];
|
|
22
|
+
}
|
|
23
|
+
export declare class PdfExtractedTable extends ExtractedTable {
|
|
24
|
+
page: number;
|
|
25
|
+
constructor(data: ConstructorParameters<typeof ExtractedTable>[0] & {
|
|
26
|
+
page: number;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=extracted-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extracted-table.d.ts","sourceRoot":"","sources":["../../src/types/extracted-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,KAAK,GAAG,GAAG;IACP,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,EAAE,CAAC;AAEtC,qBAAa,cAAc;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,SAAS,EAAE,CAAC;gBAEP,IAAI,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,GAAG,CAAC;QACT,IAAI,EAAE,SAAS,CAAC;QAChB,KAAK,EAAE,SAAS,EAAE,CAAC;KACtB;IAOD,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAUnD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE;CAkB3D;AAED,qBAAa,iBAAkB,SAAQ,cAAc;IACjD,IAAI,EAAE,MAAM,CAAC;gBAGT,IAAI,EAAE,qBAAqB,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG;QACpD,IAAI,EAAE,MAAM,CAAC;KAChB;CAKR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { TableCell } from "./table-cell.js";
|
|
2
|
+
export class ExtractedTable {
|
|
3
|
+
title;
|
|
4
|
+
box;
|
|
5
|
+
grid;
|
|
6
|
+
cells;
|
|
7
|
+
constructor(data) {
|
|
8
|
+
this.title = data.title;
|
|
9
|
+
this.box = data.box;
|
|
10
|
+
this.grid = data.grid;
|
|
11
|
+
this.cells = data.cells;
|
|
12
|
+
}
|
|
13
|
+
getCell(row, col) {
|
|
14
|
+
if (row < 0 || row >= this.grid.length) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (col < 0 || !this.grid[row] || col >= this.grid[row].length) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return this.grid[row][col] ?? null;
|
|
21
|
+
}
|
|
22
|
+
findCellsByContent(search) {
|
|
23
|
+
const results = [];
|
|
24
|
+
for (const cell of this.cells) {
|
|
25
|
+
if (cell.content) {
|
|
26
|
+
if (typeof search === "string") {
|
|
27
|
+
if (cell.content.includes(search)) {
|
|
28
|
+
results.push(cell);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (search instanceof RegExp) {
|
|
32
|
+
if (search.test(cell.content)) {
|
|
33
|
+
results.push(cell);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return results;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class PdfExtractedTable extends ExtractedTable {
|
|
42
|
+
page;
|
|
43
|
+
constructor(data) {
|
|
44
|
+
super(data);
|
|
45
|
+
this.page = data.page;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=extracted-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extracted-table.js","sourceRoot":"","sources":["../../src/types/extracted-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,cAAc;IACvB,KAAK,CAAU;IACf,GAAG,CAAM;IACT,IAAI,CAAY;IAChB,KA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AC,CAAC;oBACvB,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACjD,IAAI,CAAS;IAEb,YACI,IAEC;QAED,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extracted-table.spec.d.ts","sourceRoot":"","sources":["../../src/types/extracted-table.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildTable } from "../test/table-fixture.js";
|
|
3
|
+
describe("ExtractedTable", () => {
|
|
4
|
+
const table = buildTable();
|
|
5
|
+
it("should return correct cell by coordinates", () => {
|
|
6
|
+
const cell = table.getCell(0, 0);
|
|
7
|
+
expect(cell).toBe(table.grid[0][0]);
|
|
8
|
+
const outOfBoundsCell = table.getCell(10, 10);
|
|
9
|
+
expect(outOfBoundsCell).toBeNull();
|
|
10
|
+
});
|
|
11
|
+
it("should find cells by content", () => {
|
|
12
|
+
const foundCells = table.findCellsByContent(/header/i);
|
|
13
|
+
expect(foundCells).toHaveLength(1);
|
|
14
|
+
expect(foundCells[0]).toBe(table.cells[0]);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=extracted-table.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extracted-table.spec.js","sourceRoot":"","sources":["../../src/types/extracted-table.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC;IAE3B,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACjD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAErC,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,MAAM,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACpC,MAAM,UAAU,GAAG,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ExtractedTable } from "./extracted-table.js";
|
|
2
|
+
export type CellPosition = {
|
|
3
|
+
row: number;
|
|
4
|
+
col: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Represents a single cell within an extracted table.
|
|
8
|
+
* Provides methods to navigate the table grid relative to this cell.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TableCell {
|
|
11
|
+
/**
|
|
12
|
+
* The text content of the cell.
|
|
13
|
+
*/
|
|
14
|
+
content?: string;
|
|
15
|
+
_table: ExtractedTable | null;
|
|
16
|
+
_positions: CellPosition[];
|
|
17
|
+
constructor(data: {
|
|
18
|
+
content?: string;
|
|
19
|
+
_table: ExtractedTable | null;
|
|
20
|
+
_positions: CellPosition[];
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the coordinates of the cell at the specified index.
|
|
24
|
+
* Useful if the cell spans multiple positions.
|
|
25
|
+
*
|
|
26
|
+
* @param index - The index of the position to retrieve (default is 0).
|
|
27
|
+
* @returns The row and column index of the cell position.
|
|
28
|
+
*/
|
|
29
|
+
coordinates(index?: number): CellPosition | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves the number of rows this cell spans.
|
|
32
|
+
*
|
|
33
|
+
* @returns The number of rows spanned by this cell.
|
|
34
|
+
*/
|
|
35
|
+
rowspan(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the number of columns this cell spans.
|
|
38
|
+
*
|
|
39
|
+
* @returns The number of columns spanned by this cell.
|
|
40
|
+
*/
|
|
41
|
+
colspan(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves all cells in the same row as this cell's position at the given index.
|
|
44
|
+
* The index determines which position to use if the cell spans multiple rows.
|
|
45
|
+
*
|
|
46
|
+
* @param index - The index of the position to use for determining the row (default is 0).
|
|
47
|
+
* @returns An array of TableCell objects in the row.
|
|
48
|
+
*/
|
|
49
|
+
row(index?: number): TableCell[];
|
|
50
|
+
/**
|
|
51
|
+
* Retrieves all cells in the same column as this cell's position at the given index.
|
|
52
|
+
* The index determines which position to use if the cell spans multiple columns.
|
|
53
|
+
*
|
|
54
|
+
* @param index - The index of the position to use for determining the column (default is 0).
|
|
55
|
+
* @returns An array of TableCell objects in the column.
|
|
56
|
+
*/
|
|
57
|
+
column(index?: number): TableCell[];
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves the cell(s) immediately above this cell.
|
|
60
|
+
*
|
|
61
|
+
* @returns An array of TableCell objects located above this cell.
|
|
62
|
+
*/
|
|
63
|
+
top(): TableCell[];
|
|
64
|
+
/**
|
|
65
|
+
* Retrieves the cell(s) immediately below this cell.
|
|
66
|
+
*
|
|
67
|
+
* @returns An array of TableCell objects located below this cell.
|
|
68
|
+
*/
|
|
69
|
+
bottom(): TableCell[];
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves the cell(s) immediately to the left of this cell.
|
|
72
|
+
*
|
|
73
|
+
* @returns An array of TableCell objects located to the left of this cell.
|
|
74
|
+
*/
|
|
75
|
+
left(): TableCell[];
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the cell(s) immediately to the right of this cell.
|
|
78
|
+
*
|
|
79
|
+
* @returns An array of TableCell objects located to the right of this cell.
|
|
80
|
+
*/
|
|
81
|
+
right(): TableCell[];
|
|
82
|
+
private neighbor;
|
|
83
|
+
}
|
|
84
|
+
export declare function checkCell(cell: TableCell): void;
|
|
85
|
+
//# sourceMappingURL=table-cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell.d.ts","sourceRoot":"","sources":["../../src/types/table-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,qBAAa,SAAS;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,YAAY,EAAE,CAAM;gBAEpB,IAAI,EAAE;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;QAC9B,UAAU,EAAE,YAAY,EAAE,CAAC;KAC9B;IAMD;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,SAAI;IAIrB;;;;OAIG;IACH,OAAO;IAKP;;;;OAIG;IACH,OAAO;IAKP;;;;;;OAMG;IACH,GAAG,CAAC,KAAK,SAAI,GAAG,SAAS,EAAE;IAQ3B;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,SAAI,GAAG,SAAS,EAAE;IAU9B;;;;OAIG;IACH,GAAG,IAAI,SAAS,EAAE;IAIlB;;;;OAIG;IACH,MAAM,IAAI,SAAS,EAAE;IAIrB;;;;OAIG;IACH,IAAI,IAAI,SAAS,EAAE;IAInB;;;;OAIG;IACH,KAAK,IAAI,SAAS,EAAE;IAIpB,OAAO,CAAC,QAAQ;CAwBnB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,QAOxC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ExtractedTable } from "./extracted-table.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a single cell within an extracted table.
|
|
4
|
+
* Provides methods to navigate the table grid relative to this cell.
|
|
5
|
+
*/
|
|
6
|
+
export class TableCell {
|
|
7
|
+
/**
|
|
8
|
+
* The text content of the cell.
|
|
9
|
+
*/
|
|
10
|
+
content;
|
|
11
|
+
_table;
|
|
12
|
+
_positions = [];
|
|
13
|
+
constructor(data) {
|
|
14
|
+
this.content = data.content;
|
|
15
|
+
this._table = data._table;
|
|
16
|
+
this._positions = data._positions;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the coordinates of the cell at the specified index.
|
|
20
|
+
* Useful if the cell spans multiple positions.
|
|
21
|
+
*
|
|
22
|
+
* @param index - The index of the position to retrieve (default is 0).
|
|
23
|
+
* @returns The row and column index of the cell position.
|
|
24
|
+
*/
|
|
25
|
+
coordinates(index = 0) {
|
|
26
|
+
return this._positions[index];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves the number of rows this cell spans.
|
|
30
|
+
*
|
|
31
|
+
* @returns The number of rows spanned by this cell.
|
|
32
|
+
*/
|
|
33
|
+
rowspan() {
|
|
34
|
+
const rows = this._positions.map((pos) => pos.row);
|
|
35
|
+
return Math.max(...rows) - Math.min(...rows) + 1;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves the number of columns this cell spans.
|
|
39
|
+
*
|
|
40
|
+
* @returns The number of columns spanned by this cell.
|
|
41
|
+
*/
|
|
42
|
+
colspan() {
|
|
43
|
+
const cols = this._positions.map((pos) => pos.col);
|
|
44
|
+
return Math.max(...cols) - Math.min(...cols) + 1;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves all cells in the same row as this cell's position at the given index.
|
|
48
|
+
* The index determines which position to use if the cell spans multiple rows.
|
|
49
|
+
*
|
|
50
|
+
* @param index - The index of the position to use for determining the row (default is 0).
|
|
51
|
+
* @returns An array of TableCell objects in the row.
|
|
52
|
+
*/
|
|
53
|
+
row(index = 0) {
|
|
54
|
+
if (!this._positions[index]) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
const { row } = this._positions[index];
|
|
58
|
+
return this._table.grid[row] ?? [];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Retrieves all cells in the same column as this cell's position at the given index.
|
|
62
|
+
* The index determines which position to use if the cell spans multiple columns.
|
|
63
|
+
*
|
|
64
|
+
* @param index - The index of the position to use for determining the column (default is 0).
|
|
65
|
+
* @returns An array of TableCell objects in the column.
|
|
66
|
+
*/
|
|
67
|
+
column(index = 0) {
|
|
68
|
+
if (!this._positions[index]) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
const { col } = this._positions[index];
|
|
72
|
+
return this._table.grid.map((r) => r[col]).filter((cell) => cell !== undefined);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves the cell(s) immediately above this cell.
|
|
76
|
+
*
|
|
77
|
+
* @returns An array of TableCell objects located above this cell.
|
|
78
|
+
*/
|
|
79
|
+
top() {
|
|
80
|
+
return this.neighbor(-1, 0);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Retrieves the cell(s) immediately below this cell.
|
|
84
|
+
*
|
|
85
|
+
* @returns An array of TableCell objects located below this cell.
|
|
86
|
+
*/
|
|
87
|
+
bottom() {
|
|
88
|
+
return this.neighbor(1, 0);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves the cell(s) immediately to the left of this cell.
|
|
92
|
+
*
|
|
93
|
+
* @returns An array of TableCell objects located to the left of this cell.
|
|
94
|
+
*/
|
|
95
|
+
left() {
|
|
96
|
+
return this.neighbor(0, -1);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves the cell(s) immediately to the right of this cell.
|
|
100
|
+
*
|
|
101
|
+
* @returns An array of TableCell objects located to the right of this cell.
|
|
102
|
+
*/
|
|
103
|
+
right() {
|
|
104
|
+
return this.neighbor(0, 1);
|
|
105
|
+
}
|
|
106
|
+
neighbor(offsetRow, offsetCol) {
|
|
107
|
+
const positions = this._positions
|
|
108
|
+
.map(({ row, col }) => ({
|
|
109
|
+
row: row + offsetRow,
|
|
110
|
+
col: col + offsetCol,
|
|
111
|
+
}))
|
|
112
|
+
.filter(({ row, col }) => row >= 0 &&
|
|
113
|
+
row < this._table.grid.length &&
|
|
114
|
+
col >= 0 &&
|
|
115
|
+
this._table.grid[row] &&
|
|
116
|
+
col < this._table.grid[row].length)
|
|
117
|
+
// Filter out the cell itself
|
|
118
|
+
.filter(({ row, col }) => {
|
|
119
|
+
return !this._positions.some((pos) => pos.row === row && pos.col === col);
|
|
120
|
+
});
|
|
121
|
+
return positions
|
|
122
|
+
.map(({ row, col }) => this._table.grid?.[row]?.[col])
|
|
123
|
+
.filter((cell) => cell !== undefined);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export function checkCell(cell) {
|
|
127
|
+
if (!cell._table) {
|
|
128
|
+
throw new Error("Cell is not associated with any table.");
|
|
129
|
+
}
|
|
130
|
+
if (cell._positions.length === 0) {
|
|
131
|
+
throw new Error("Cell has no position information.");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=table-cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell.spec.d.ts","sourceRoot":"","sources":["../../src/types/table-cell.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildTable } from "../test/table-fixture.js";
|
|
3
|
+
describe("TableCell", () => {
|
|
4
|
+
const table = buildTable();
|
|
5
|
+
const cell = table.cells[0]; // The wide cell at (0,0) spanning two columns
|
|
6
|
+
it("should report correct position and spans", () => {
|
|
7
|
+
expect(cell.colspan()).toBe(2);
|
|
8
|
+
expect(cell.rowspan()).toBe(1);
|
|
9
|
+
expect(cell.coordinates()).toEqual({ row: 0, col: 0 });
|
|
10
|
+
expect(cell.coordinates(1)).toEqual({ row: 0, col: 1 });
|
|
11
|
+
});
|
|
12
|
+
it("should retrieve correct rows and columns", () => {
|
|
13
|
+
const cellsInRow = cell.row();
|
|
14
|
+
expect(cellsInRow).toHaveLength(2);
|
|
15
|
+
expect(cellsInRow).toContain(cell);
|
|
16
|
+
const cellsInColumn = cell.column(1);
|
|
17
|
+
expect(cellsInColumn).toHaveLength(2);
|
|
18
|
+
expect(cellsInColumn).toContain(cell);
|
|
19
|
+
expect(cellsInColumn).toContain(table.grid[1][1]);
|
|
20
|
+
});
|
|
21
|
+
it("should retrieve correct neighboring cells", () => {
|
|
22
|
+
expect(cell.left()).toHaveLength(0);
|
|
23
|
+
expect(cell.right()).toHaveLength(0);
|
|
24
|
+
expect(cell.top()).toHaveLength(0);
|
|
25
|
+
const bottomCells = cell.bottom();
|
|
26
|
+
expect(bottomCells).toHaveLength(2);
|
|
27
|
+
expect(bottomCells).toContain(table.grid[1][0]);
|
|
28
|
+
expect(bottomCells).toContain(table.grid[1][1]);
|
|
29
|
+
expect(bottomCells[0].top()).toContain(cell);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=table-cell.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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
+
"table extraction",
|
|
8
|
+
"img2table"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@hey-api/openapi-ts": "0.89.2",
|
|
28
|
+
"eslint": "^9.39.2",
|
|
29
|
+
"typescript": "^5.9.3",
|
|
30
|
+
"vitest": "^4.0.16"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"generate:api": "openapi-ts",
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"test": "vitest",
|
|
36
|
+
"check-types": "tsc --noEmit",
|
|
37
|
+
"lint": "eslint src"
|
|
38
|
+
}
|
|
39
|
+
}
|