Skip to content

Commit 5ac9154

Browse files
committed
docs: improve JSDoc comments for exported appkit types
Add meaningful descriptions to execution, cache, plugin, and telemetry types that were previously missing or too vague in the public API surface. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
1 parent 7c26852 commit 5ac9154

9 files changed

Lines changed: 21 additions & 9 deletions

File tree

docs/docs/api/appkit/Interface.CacheConfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Interface: CacheConfig
22

3-
Configuration for caching
3+
Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup.
44

55
## Indexable
66

docs/docs/api/appkit/Interface.StreamExecutionSettings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Interface: StreamExecutionSettings
22

3-
Configuration for streaming execution with default and user-scoped settings
3+
Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration.
44

55
## Properties
66

docs/docs/api/appkit/TypeAlias.PluginData.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ type PluginData<T, U, N> = {
88
};
99
```
1010

11+
Tuple of plugin class, config, and name. Created by `toPlugin()` and passed to `createApp()`.
12+
1113
## Type Parameters
1214

1315
| Type Parameter |

docs/docs/api/appkit/TypeAlias.ToPlugin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
type ToPlugin<T, U, N> = (config?: U) => PluginData<T, U, N>;
55
```
66

7+
Factory function type returned by `toPlugin()`. Accepts optional config and returns a PluginData tuple.
8+
79
## Type Parameters
810

911
| Type Parameter |

docs/docs/api/appkit/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ plugin architecture, and React integration.
3131
| Interface | Description |
3232
| ------ | ------ |
3333
| [BasePluginConfig](Interface.BasePluginConfig.md) | Base configuration interface for AppKit plugins |
34-
| [CacheConfig](Interface.CacheConfig.md) | Configuration for caching |
34+
| [CacheConfig](Interface.CacheConfig.md) | Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup. |
3535
| [DatabaseCredential](Interface.DatabaseCredential.md) | Database credentials with OAuth token for Postgres connection |
3636
| [GenerateDatabaseCredentialRequest](Interface.GenerateDatabaseCredentialRequest.md) | Request parameters for generating database OAuth credentials |
3737
| [ITelemetry](Interface.ITelemetry.md) | Plugin-facing interface for OpenTelemetry instrumentation. Provides a thin abstraction over OpenTelemetry APIs for plugins. |
@@ -42,7 +42,7 @@ plugin architecture, and React integration.
4242
| [ResourceEntry](Interface.ResourceEntry.md) | Internal representation of a resource in the registry. Extends ResourceRequirement with resolution state and plugin ownership. |
4343
| [ResourceFieldEntry](Interface.ResourceFieldEntry.md) | Defines a single field for a resource. Each field has its own environment variable and optional description. Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance_name, database_name or scope, key). |
4444
| [ResourceRequirement](Interface.ResourceRequirement.md) | Declares a resource requirement for a plugin. Can be defined statically in a manifest or dynamically via getResourceRequirements(). Narrows the generated base: type → ResourceType enum, permission → ResourcePermission union. |
45-
| [StreamExecutionSettings](Interface.StreamExecutionSettings.md) | Configuration for streaming execution with default and user-scoped settings |
45+
| [StreamExecutionSettings](Interface.StreamExecutionSettings.md) | Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration. |
4646
| [TelemetryConfig](Interface.TelemetryConfig.md) | OpenTelemetry configuration for AppKit applications |
4747
| [ValidationResult](Interface.ValidationResult.md) | Result of validating all registered resources against the environment. |
4848

@@ -52,9 +52,9 @@ plugin architecture, and React integration.
5252
| ------ | ------ |
5353
| [ConfigSchema](TypeAlias.ConfigSchema.md) | Configuration schema definition for plugin config. Re-exported from the standard JSON Schema Draft 7 types. |
5454
| [IAppRouter](TypeAlias.IAppRouter.md) | Express router type for plugin route registration |
55-
| [PluginData](TypeAlias.PluginData.md) | - |
55+
| [PluginData](TypeAlias.PluginData.md) | Tuple of plugin class, config, and name. Created by `toPlugin()` and passed to `createApp()`. |
5656
| [ResourcePermission](TypeAlias.ResourcePermission.md) | Union of all possible permission levels across all resource types. |
57-
| [ToPlugin](TypeAlias.ToPlugin.md) | - |
57+
| [ToPlugin](TypeAlias.ToPlugin.md) | Factory function type returned by `toPlugin()`. Accepts optional config and returns a PluginData tuple. |
5858

5959
## Variables
6060

packages/appkit/src/telemetry/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface TelemetryProviderConfig {
66
logs: boolean;
77
}
88

9+
/** Converts a TelemetryOptions value (boolean, object, or undefined) into a fully resolved config with explicit traces/metrics/logs flags. Defaults to all enabled. */
910
export function normalizeTelemetryOptions(
1011
config?: TelemetryOptions,
1112
): TelemetryProviderConfig {

packages/shared/src/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface CacheStorage {
3232
close(): Promise<void>;
3333
}
3434

35-
/** Configuration for caching */
35+
/** Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup. */
3636
export interface CacheConfig {
3737
/** Whether caching is enabled */
3838
enabled?: boolean;

packages/shared/src/execute.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { CacheConfig } from "./cache";
22

3+
/** SSE stream configuration for `executeStream()`. Controls buffer sizes, heartbeat interval, and cleanup behavior. */
34
export interface StreamConfig {
45
userSignal?: AbortSignal;
56
streamId?: string;
@@ -12,19 +13,22 @@ export interface StreamConfig {
1213
maxActiveStreams?: number;
1314
}
1415

16+
/** Retry configuration for the RetryInterceptor. Uses exponential backoff between attempts. */
1517
export interface RetryConfig {
1618
enabled?: boolean;
1719
attempts?: number;
1820
initialDelay?: number;
1921
maxDelay?: number;
2022
}
2123

24+
/** Telemetry configuration for the TelemetryInterceptor. Controls span creation and custom attributes. */
2225
export interface TelemetryConfig {
2326
enabled?: boolean;
2427
spanName?: string;
2528
attributes?: Record<string, any>;
2629
}
2730

31+
/** Options passed to `Plugin.execute()` and `Plugin.executeStream()` to configure the interceptor chain (cache, retry, telemetry, timeout). */
2832
export interface PluginExecuteConfig {
2933
cache?: CacheConfig;
3034
retry?: RetryConfig;
@@ -35,17 +39,18 @@ export interface PluginExecuteConfig {
3539
[key: string]: unknown;
3640
}
3741

42+
/** Default and user-scoped execution settings for a plugin. The `user` config, when present, overrides `default` for on-behalf-of requests. */
3843
export interface PluginExecutionSettings {
3944
default: PluginExecuteConfig;
4045
user?: PluginExecuteConfig;
4146
}
4247

43-
// stream execute handler can be a promise or a generator
48+
/** Handler function for `executeStream()`. Can return a Promise (single result) or an AsyncGenerator (chunked streaming). */
4449
export type StreamExecuteHandler<T> =
4550
| ((signal?: AbortSignal) => Promise<T>)
4651
| ((signal?: AbortSignal) => AsyncGenerator<T, void, unknown>);
4752

48-
/** Configuration for streaming execution with default and user-scoped settings */
53+
/** Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration. */
4954
export interface StreamExecutionSettings {
5055
default: PluginExecuteConfig;
5156
user?: PluginExecuteConfig;

packages/shared/src/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ export type PluginMap<
186186
>;
187187
};
188188

189+
/** Tuple of plugin class, config, and name. Created by `toPlugin()` and passed to `createApp()`. */
189190
export type PluginData<T, U, N> = { plugin: T; config: U; name: N };
191+
/** Factory function type returned by `toPlugin()`. Accepts optional config and returns a PluginData tuple. */
190192
export type ToPlugin<T, U, N extends string> = (
191193
config?: U,
192194
) => PluginData<T, U, N>;

0 commit comments

Comments
 (0)