Skip to content

Commit

Permalink
adding type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
0marSalah authored and dmitrizagidulin committed Dec 2, 2024
1 parent d345b53 commit b06e012
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/esm/index.js"
"import": "./dist/esm/index.js",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
},
Expand Down
29 changes: 29 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Pack } from 'tar-stream'
import { Buffer } from 'buffer'

export interface ActorProfileOptions {
actorProfile?: any
outbox?: any
followers?: any
followingAccounts?: any
lists?: any
bookmarks?: any
likes?: any
blockedAccounts?: any
blockedDomains?: any
mutedAccounts?: any
}

/**
* Exports an actor profile and associated data as a tarball.
* @param options - The options for the actor profile.
* @returns A tar-stream Pack object containing the exported data.
*/
export function exportActorProfile(options: ActorProfileOptions): Pack

/**
* Imports an actor profile from a tarball buffer.
* @param tarBuffer - The tarball buffer containing the actor profile.
* @returns A promise resolving to the imported actor profile data.
*/
export function importActorProfile(tarBuffer: Buffer): Promise<any>
14 changes: 1 addition & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,7 @@ import * as tar from 'tar-stream'
import { type Pack } from 'tar-stream'
import YAML from 'yaml'
import { Readable } from 'stream'

export interface ActorProfileOptions {
actorProfile?: any
outbox?: any
followers?: any
followingAccounts?: any
lists?: any
bookmarks?: any
likes?: any
blockedAccounts?: any
blockedDomains?: any
mutedAccounts?: any
}
import { ActorProfileOptions } from './index.d'

export function exportActorProfile({
actorProfile,
Expand Down

0 comments on commit b06e012

Please sign in to comment.