+10
packages/producer/types.ts
+10
packages/producer/types.ts
···
1
1
import type { BaseClientOptions, ClientRequirements } from "@cistern/shared";
2
2
import type { RecordKey, ResourceUri } from "@atcute/lexicons";
3
3
4
+
/** Credentials and an optional public key, used for deriving `ProducerParams` */
4
5
export interface ProducerOptions extends BaseClientOptions {
6
+
/** 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 */
5
7
publicKey?: RecordKey;
6
8
}
7
9
10
+
/** Required parameters for constructing a `Producer`. These are automatically created for you in `createProducer` */
8
11
export type ProducerParams = ClientRequirements<ProducerOptions> & {
12
+
/** Optional public key and its contents */
9
13
publicKey?: PublicKeyOption;
10
14
};
11
15
16
+
/** A simplified public key, suitable for local storage */
12
17
export interface PublicKeyOption {
18
+
/** Full AT-URI of this key */
13
19
uri: ResourceUri;
20
+
21
+
/** Generated friendly name for this public key */
14
22
name: string;
23
+
24
+
/** The contents of this public key, encoded in base64 */
15
25
content: string;
16
26
}