diff --git a/package.json b/package.json index 34cc08a..359df06 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..6e55da1 --- /dev/null +++ b/src/index.d.ts @@ -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 diff --git a/src/index.ts b/src/index.ts index 99ec37e..c2c2d42 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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,