Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 041908a

Browse files
committedDec 2, 2024·
adding type definitions
1 parent 6f0cbc6 commit 041908a

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed
 

‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"exports": {
2727
".": {
2828
"require": "./dist/index.js",
29-
"import": "./dist/esm/index.js"
29+
"import": "./dist/esm/index.js",
30+
"types": "./dist/index.d.ts"
3031
},
3132
"./package.json": "./package.json"
3233
},

‎src/index.d.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { Pack } from 'tar-stream'
2+
import { Buffer } from 'buffer'
3+
4+
export interface ActorProfileOptions {
5+
actorProfile?: any
6+
outbox?: any
7+
followers?: any
8+
followingAccounts?: any
9+
lists?: any
10+
bookmarks?: any
11+
likes?: any
12+
blockedAccounts?: any
13+
blockedDomains?: any
14+
mutedAccounts?: any
15+
}
16+
17+
/**
18+
* Exports an actor profile and associated data as a tarball.
19+
* @param options - The options for the actor profile.
20+
* @returns A tar-stream Pack object containing the exported data.
21+
*/
22+
export function exportActorProfile(options: ActorProfileOptions): Pack
23+
24+
/**
25+
* Imports an actor profile from a tarball buffer.
26+
* @param tarBuffer - The tarball buffer containing the actor profile.
27+
* @returns A promise resolving to the imported actor profile data.
28+
*/
29+
export function importActorProfile(tarBuffer: Buffer): Promise<any>

‎src/index.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,7 @@ import * as tar from 'tar-stream'
55
import { type Pack } from 'tar-stream'
66
import YAML from 'yaml'
77
import { Readable } from 'stream'
8-
9-
export interface ActorProfileOptions {
10-
actorProfile?: any
11-
outbox?: any
12-
followers?: any
13-
followingAccounts?: any
14-
lists?: any
15-
bookmarks?: any
16-
likes?: any
17-
blockedAccounts?: any
18-
blockedDomains?: any
19-
mutedAccounts?: any
20-
}
8+
import { ActorProfileOptions } from './index.d'
219

2210
export function exportActorProfile({
2311
actorProfile,

0 commit comments

Comments
 (0)
Please sign in to comment.