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

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 +90 -0
  2. package/package.json +10 -9
package/index.d.ts ADDED
@@ -0,0 +1,90 @@
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
+ }
18
+ export interface CommitData {
19
+ sha: string
20
+ date: number
21
+ message: string
22
+ author: string
23
+ parents: Array<string>
24
+ files: Array<CommitFile>
25
+ }
26
+ export interface CommitFile {
27
+ from: string
28
+ to: string
29
+ additions: number
30
+ deletions: number
31
+ status: CommitFileStatus
32
+ }
33
+ export const enum CommitFileStatus {
34
+ Added = 0,
35
+ Deleted = 1,
36
+ Modified = 2,
37
+ Renamed = 3
38
+ }
39
+ export const enum CommitChainGetFiles {
40
+ DoGetFiles = 0,
41
+ DontGetFiles = 1
42
+ }
43
+ export interface VerifyData {
44
+ commitTime: number
45
+ fileContent: string
46
+ filePath: string
47
+ }
48
+ export interface Candidate {
49
+ path: string
50
+ locations: Array<number>
51
+ weight: number
52
+ }
53
+ export declare class DiffClient {
54
+ constructor()
55
+ diff(text1: string, text2: string): Array<DiffChunk>
56
+ /**
57
+ * use https://docs.rs/diffmatchpatch/latest/diffmatchpatch/struct.DiffMatchPatch.html#method.diff_lines_to_chars
58
+ * then diff the chars.
59
+ * then convert back to lines.
60
+ *
61
+ * takes in two strings. splits based on newlines.
62
+ * returns diffs based on lines.
63
+ */
64
+ diffLines(text1: string, text2: string): Array<DiffChunk>
65
+ }
66
+ export declare class MerkleClient {
67
+ constructor(absoluteRootDirectory: string)
68
+ initWithRipgrepIgnore(logFilesPath: string | undefined | null, config: WalkDirConfig): Promise<void>
69
+ getSubtreeHash(relativePath: string): Promise<string>
70
+ getNumEmbeddableFiles(): Promise<number>
71
+ getImportantPaths(k: number): Promise<Array<string>>
72
+ getAllFiles(): Promise<Array<string>>
73
+ getAllDirFilesToEmbed(absoluteFilePath: string): Promise<Array<string>>
74
+ }
75
+ export declare class GitClient {
76
+ constructor(absoluteRootDirectory: string)
77
+ getTotalCommitCount(): Promise<number>
78
+ getCommitVerifyData(commit: string): Promise<VerifyData>
79
+ throwIfCommitDoesntExist(rootSha: string): Promise<void>
80
+ getVerifyCommit(): Promise<string>
81
+ getRepoHeadSha(): Promise<string | null>
82
+ getCommitChain(hash: string, depth: number, getFiles: CommitChainGetFiles): Promise<Array<CommitData>>
83
+ }
84
+ export declare class GitFile {
85
+ findSimilarFiles(lineno: number): Promise<Array<Candidate>>
86
+ }
87
+ export declare class LocalGitGraph {
88
+ constructor(repo: string)
89
+ openFile(path: string): Promise<GitFile>
90
+ }
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-e606c2e0",
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-e606c2e0",
44
+ "@anysphere/file-service-darwin-x64": "0.0.0-e606c2e0",
45
+ "@anysphere/file-service-linux-x64-gnu": "0.0.0-e606c2e0",
46
+ "@anysphere/file-service-darwin-arm64": "0.0.0-e606c2e0",
47
+ "@anysphere/file-service-win32-arm64-msvc": "0.0.0-e606c2e0",
48
+ "@anysphere/file-service-darwin-universal": "0.0.0-e606c2e0",
49
+ "@anysphere/file-service-linux-arm64-gnu": "0.0.0-e606c2e0"
49
50
  }
50
51
  }