@anysphere/file-service 0.0.0-e54316b5 → 0.0.0-e58ac9e8

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 (2) hide show
  1. package/index.d.ts +96 -0
  2. package/package.json +10 -9
package/index.d.ts ADDED
@@ -0,0 +1,96 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ export const enum DiffType {
7
+ Insert = 'Insert',
8
+ Delete = 'Delete',
9
+ Equal = 'Equal'
10
+ }
11
+ export interface DiffChunk {
12
+ diffType: DiffType
13
+ text: string
14
+ }
15
+ export interface WalkDirConfig {
16
+ maxNumFiles: number
17
+ logFilePath?: string
18
+ blocklistPath?: string
19
+ }
20
+ export interface CommitData {
21
+ sha: string
22
+ date: number
23
+ message: string
24
+ author: string
25
+ parents: Array<string>
26
+ files: Array<CommitFile>
27
+ }
28
+ export interface CommitFile {
29
+ from: string
30
+ to: string
31
+ additions: number
32
+ deletions: number
33
+ status: CommitFileStatus
34
+ }
35
+ export const enum CommitFileStatus {
36
+ Added = 0,
37
+ Deleted = 1,
38
+ Modified = 2,
39
+ Renamed = 3
40
+ }
41
+ export const enum CommitChainGetFiles {
42
+ DoGetFiles = 0,
43
+ DontGetFiles = 1
44
+ }
45
+ export interface VerifyData {
46
+ commitTime: number
47
+ fileContent: string
48
+ filePath: string
49
+ }
50
+ export interface Candidate {
51
+ path: string
52
+ locations: Array<number>
53
+ weight: number
54
+ }
55
+ export declare class DiffClient {
56
+ constructor()
57
+ diff(text1: string, text2: string): Array<DiffChunk>
58
+ /**
59
+ * use https://docs.rs/diffmatchpatch/latest/diffmatchpatch/struct.DiffMatchPatch.html#method.diff_lines_to_chars
60
+ * then diff the chars.
61
+ * then convert back to lines.
62
+ *
63
+ * takes in two strings. splits based on newlines.
64
+ * returns diffs based on lines.
65
+ */
66
+ diffLines(text1: string, text2: string): Array<DiffChunk>
67
+ }
68
+ export declare class MerkleClient {
69
+ constructor(absoluteRootDirectory: string)
70
+ build(allowIncremental: boolean, config: WalkDirConfig): Promise<void>
71
+ getSubtreeHash(relativePath: string): Promise<string>
72
+ getNumEmbeddableFiles(): Promise<number>
73
+ getImportantPaths(k: number): Promise<Array<string>>
74
+ getAllFiles(): Promise<Array<string>>
75
+ getAllDirFilesToEmbed(absoluteFilePath: string): Promise<Array<string>>
76
+ onDidCreate(absoluteFilePath: string): void
77
+ onDidChange(absoluteFilePath: string): void
78
+ onDidDelete(absoluteFilePath: string): void
79
+ static enableTracing(): void
80
+ }
81
+ export declare class GitClient {
82
+ constructor(absoluteRootDirectory: string)
83
+ getTotalCommitCount(): Promise<number>
84
+ getCommitVerifyData(commit: string): Promise<VerifyData>
85
+ throwIfCommitDoesntExist(rootSha: string): Promise<void>
86
+ getVerifyCommit(): Promise<string>
87
+ getRepoHeadSha(): Promise<string | null>
88
+ getCommitChain(hash: string, depth: number, getFiles: CommitChainGetFiles): Promise<Array<CommitData>>
89
+ }
90
+ export declare class GitFile {
91
+ findSimilarFiles(lineno: number): Promise<Array<Candidate>>
92
+ }
93
+ export declare class LocalGitGraph {
94
+ constructor(repo: string)
95
+ openFile(path: string): Promise<GitFile>
96
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anysphere/file-service",
3
- "version": "0.0.0-e54316b5",
3
+ "version": "0.0.0-e58ac9e8",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
@@ -15,7 +15,8 @@
15
15
  }
16
16
  },
17
17
  "files": [
18
- "index.js"
18
+ "index.js",
19
+ "index.d.ts"
19
20
  ],
20
21
  "license": "MIT",
21
22
  "devDependencies": {
@@ -39,12 +40,12 @@
39
40
  "version": "napi version"
40
41
  },
41
42
  "optionalDependencies": {
42
- "@anysphere/file-service-win32-x64-msvc": "0.0.0-e54316b5",
43
- "@anysphere/file-service-darwin-x64": "0.0.0-e54316b5",
44
- "@anysphere/file-service-linux-x64-gnu": "0.0.0-e54316b5",
45
- "@anysphere/file-service-darwin-arm64": "0.0.0-e54316b5",
46
- "@anysphere/file-service-win32-arm64-msvc": "0.0.0-e54316b5",
47
- "@anysphere/file-service-darwin-universal": "0.0.0-e54316b5",
48
- "@anysphere/file-service-linux-arm64-gnu": "0.0.0-e54316b5"
43
+ "@anysphere/file-service-win32-x64-msvc": "0.0.0-e58ac9e8",
44
+ "@anysphere/file-service-darwin-x64": "0.0.0-e58ac9e8",
45
+ "@anysphere/file-service-linux-x64-gnu": "0.0.0-e58ac9e8",
46
+ "@anysphere/file-service-darwin-arm64": "0.0.0-e58ac9e8",
47
+ "@anysphere/file-service-win32-arm64-msvc": "0.0.0-e58ac9e8",
48
+ "@anysphere/file-service-darwin-universal": "0.0.0-e58ac9e8",
49
+ "@anysphere/file-service-linux-arm64-gnu": "0.0.0-e58ac9e8"
49
50
  }
50
51
  }