bundlebee 1.0.5 → 1.0.6
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/index.d.ts +45 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,18 +2,30 @@ declare module 'bundlebee' {
|
|
|
2
2
|
import ReadyResource from 'ready-resource'
|
|
3
3
|
import Bundle from 'bare-bundle'
|
|
4
4
|
import Bee from 'hyperbee2'
|
|
5
|
+
import Hypercore from 'hypercore'
|
|
5
6
|
|
|
6
7
|
interface BundlebeeOptions {
|
|
8
|
+
autoUpdate?: boolean
|
|
9
|
+
skipExistingABIs?: boolean
|
|
10
|
+
peerDependencies?: string[]
|
|
7
11
|
[key: string]: any
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
interface Entry {
|
|
15
|
+
id: string
|
|
11
16
|
source: Buffer
|
|
12
17
|
resolutions: Record<string, string>
|
|
13
18
|
}
|
|
14
19
|
|
|
20
|
+
interface Manifest {
|
|
21
|
+
abi: number
|
|
22
|
+
}
|
|
23
|
+
|
|
15
24
|
interface AddOptions {
|
|
16
25
|
skipModules?: boolean
|
|
26
|
+
peerDependencies?: string[]
|
|
27
|
+
abi?: number
|
|
28
|
+
dryRun?: boolean
|
|
17
29
|
}
|
|
18
30
|
|
|
19
31
|
interface LoadOptions {
|
|
@@ -21,22 +33,50 @@ declare module 'bundlebee' {
|
|
|
21
33
|
skipModules?: boolean
|
|
22
34
|
}
|
|
23
35
|
|
|
36
|
+
interface BundleInput {
|
|
37
|
+
bundle: string | Bundle
|
|
38
|
+
abi?: number
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ABIRecord {
|
|
42
|
+
checkout: number
|
|
43
|
+
manifest: Manifest
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface HeadInfo {
|
|
47
|
+
key: Buffer
|
|
48
|
+
length: number
|
|
49
|
+
}
|
|
50
|
+
|
|
24
51
|
class Bundlebee extends ReadyResource {
|
|
25
|
-
constructor(store: any, opts?: BundlebeeOptions)
|
|
52
|
+
constructor(store: any, opts?: BundlebeeOptions)
|
|
26
53
|
|
|
27
54
|
static require(
|
|
28
55
|
store: any,
|
|
29
|
-
...args: [...files: string[], opts: BundlebeeOptions]
|
|
56
|
+
...args: [...files: (string | BundleInput)[], opts: BundlebeeOptions]
|
|
30
57
|
): Promise<Bundlebee>
|
|
31
|
-
static require(store: any, ...files: string[]): Promise<Bundlebee>
|
|
58
|
+
static require(store: any, ...files: (string | BundleInput)[]): Promise<Bundlebee>
|
|
59
|
+
static bundleFrom(f: string): Bundle
|
|
60
|
+
|
|
61
|
+
get core(): Hypercore
|
|
62
|
+
get key(): Buffer
|
|
63
|
+
get discoveryKey(): Buffer
|
|
64
|
+
|
|
65
|
+
head(): HeadInfo
|
|
32
66
|
|
|
33
67
|
get(key: string, checkout?: number): Promise<Entry | null>
|
|
68
|
+
checkout(checkout?: number): Promise<Bee>
|
|
69
|
+
manifest(checkout?: number): Promise<Manifest | null>
|
|
70
|
+
peerDependencies(checkout?: number): Promise<Set<string> | null>
|
|
34
71
|
|
|
35
|
-
|
|
72
|
+
findABI(abi: number): Promise<number | undefined>
|
|
73
|
+
allABIs(): AsyncIterable<ABIRecord>
|
|
74
|
+
createEntryStream(checkout?: number): AsyncIterable<Entry>
|
|
36
75
|
|
|
37
76
|
add(root: URL, entrypoint: string, opts?: AddOptions): Promise<Bundle>
|
|
38
|
-
|
|
39
77
|
load(root: URL, entrypoint: string, checkout?: number, opts?: LoadOptions): Promise<any>
|
|
78
|
+
|
|
79
|
+
close(): Promise<void>
|
|
40
80
|
}
|
|
41
81
|
|
|
42
82
|
export = Bundlebee
|