diff --git a/packages/producer/types.ts b/packages/producer/types.ts index 0143a24..650019f 100644 --- a/packages/producer/types.ts +++ b/packages/producer/types.ts @@ -1,16 +1,26 @@ import type { BaseClientOptions, ClientRequirements } from "@cistern/shared"; import type { RecordKey, ResourceUri } from "@atcute/lexicons"; +/** Credentials and an optional public key, used for deriving `ProducerParams` */ export interface ProducerOptions extends BaseClientOptions { + /** An optional record key to a Cistern public key. Assumed to be within the specified user's PDS, and retrieved before instantiation. You can omit this value if you intend to select a public key later */ publicKey?: RecordKey; } +/** Required parameters for constructing a `Producer`. These are automatically created for you in `createProducer` */ export type ProducerParams = ClientRequirements & { + /** Optional public key and its contents */ publicKey?: PublicKeyOption; }; +/** A simplified public key, suitable for local storage */ export interface PublicKeyOption { + /** Full AT-URI of this key */ uri: ResourceUri; + + /** Generated friendly name for this public key */ name: string; + + /** The contents of this public key, encoded in base64 */ content: string; }