Skip to content

Commit 2de6af8

Browse files
authored
Merge branch 'main' into docs-improvements2
2 parents 3f24ab9 + c672cd2 commit 2de6af8

File tree

12 files changed

+42
-29
lines changed

12 files changed

+42
-29
lines changed

docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
typedoc
5+
typedoc --treatWarningsAsErrors
66

77
# We need to fix the links in the generated markdown files.
88
# Typedoc generates anchors for properties in tables which can collide with anchors for types.

packages/browser-sdk/src/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
RequestFeedbackOptions,
1414
} from "./feedback/feedback";
1515
import * as feedbackLib from "./feedback/ui";
16-
import { ToolbarPosition } from "./toolbar/Toolbar";
16+
import { ToolbarPosition } from "./ui/types";
1717
import { API_BASE_URL, APP_BASE_URL, SSE_REALTIME_BASE_URL } from "./config";
1818
import { BucketContext, CompanyContext, UserContext } from "./context";
1919
import { HookArgs, HooksManager } from "./hooksManager";
@@ -145,7 +145,7 @@ export type PayloadContext = {
145145
/**
146146
* BucketClient configuration.
147147
*/
148-
interface Config {
148+
export interface Config {
149149
/**
150150
* Base URL of Bucket servers.
151151
*/
@@ -499,6 +499,7 @@ export class BucketClient {
499499
* @param type Type of event to remove.
500500
* @param handler The same function that was passed to `on`.
501501
*
502+
* @returns A function to remove the hook.
502503
*/
503504
off<THookType extends keyof HookArgs>(
504505
type: THookType,

packages/browser-sdk/src/feedback/feedback.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export type RequestFeedbackData = Omit<
6464
* copy of the feedback in your own application or CRM.
6565
*
6666
* @param {Object} data
67-
* @param data.
6867
*/
6968
onAfterSubmit?: (data: FeedbackSubmission) => void;
7069

packages/browser-sdk/src/hooksManager.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { CheckEvent, RawFeatures } from "./feature/features";
22
import { CompanyContext, UserContext } from "./context";
33

4-
/**
5-
* @internal
6-
*/
74
export interface HookArgs {
85
/**
96
* Deprecated: Use `check` instead.

packages/browser-sdk/src/index.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
export type { Feature, InitOptions, ToolbarOptions } from "./client";
1+
export type {
2+
Config,
3+
Feature,
4+
FeatureRemoteConfig,
5+
InitOptions,
6+
ToolbarOptions,
7+
} from "./client";
28
export { BucketClient } from "./client";
39
export type { BucketContext, CompanyContext, UserContext } from "./context";
410
export type {
511
CheckEvent,
612
FallbackFeatureOverride,
13+
FetchedFeature,
714
RawFeature,
815
RawFeatures,
916
} from "./feature/features";
@@ -28,6 +35,13 @@ export type {
2835
OnScoreSubmitResult,
2936
OpenFeedbackFormOptions,
3037
} from "./feedback/ui/types";
31-
export type { TrackEvent } from "./hooksManager";
38+
export type { HookArgs, TrackEvent } from "./hooksManager";
3239
export type { Logger } from "./logger";
3340
export { feedbackContainerId, propagatedEvents } from "./ui/constants";
41+
export type {
42+
DialogPlacement,
43+
Offset,
44+
PopoverPlacement,
45+
Position,
46+
ToolbarPosition,
47+
} from "./ui/types";

packages/browser-sdk/src/toolbar/Toolbar.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { BucketClient } from "../client";
1111
import { toolbarContainerId } from "../ui/constants";
1212
import { Dialog, DialogContent, DialogHeader, useDialog } from "../ui/Dialog";
1313
import { Logo } from "../ui/icons/Logo";
14-
import { DialogPlacement, Offset } from "../ui/types";
14+
import { ToolbarPosition } from "../ui/types";
1515
import { parseUnanchoredPosition } from "../ui/utils";
1616

1717
import { FeatureSearch, FeaturesTable } from "./Features";
@@ -22,10 +22,6 @@ export type FeatureItem = {
2222
localOverride: boolean | null;
2323
isEnabled: boolean;
2424
};
25-
export interface ToolbarPosition {
26-
placement: DialogPlacement;
27-
offset?: Offset;
28-
}
2925

3026
type Feature = {
3127
key: string;

packages/browser-sdk/src/toolbar/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { h, render } from "preact";
22

33
import { BucketClient } from "../client";
44
import { toolbarContainerId } from "../ui/constants";
5+
import { ToolbarPosition } from "../ui/types";
56
import { attachContainer } from "../ui/utils";
67

7-
import Toolbar, { ToolbarPosition } from "./Toolbar";
8+
import Toolbar from "./Toolbar";
89

910
type showToolbarToggleOptions = {
1011
bucketClient: BucketClient;

packages/browser-sdk/src/ui/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ export type Position =
3131
anchor: HTMLElement | null;
3232
placement?: PopoverPlacement;
3333
};
34+
35+
export interface ToolbarPosition {
36+
placement: DialogPlacement;
37+
offset?: Offset;
38+
}

packages/node-sdk/src/client.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,7 @@ export class BucketClient {
413413
/**
414414
* Tracks an event in Bucket.
415415
416-
* @param event - The event to track.
417-
* @param userId - The userId of the user who performed the event
418-
* @param opts - The options.
419-
* @param opts.attributes - The attributes of the event (optional).
420-
* @param opts.meta - The meta context associated with tracking (optional).
421-
* @param opts.companyId - Optional company ID for the event (optional).
416+
* @param options.companyId - Optional company ID for the event (optional).
422417
*
423418
* @throws An error if the user is not set or the event is invalid or the options are invalid.
424419
* @remarks
@@ -1228,7 +1223,6 @@ export class BoundBucketClient {
12281223
* @param client - The `BucketClient` to use.
12291224
* @param options - The options for the client.
12301225
* @param options.enableTracking - Whether to enable tracking for the client.
1231-
* @param options.context - The context for the client.
12321226
*
12331227
* @internal
12341228
*/

packages/node-sdk/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ export type {
55
ClientOptions,
66
Context,
77
ContextWithTracking,
8+
EmptyFeatureRemoteConfig,
89
Feature,
10+
FeatureOverride,
911
FeatureOverrides,
1012
FeatureOverridesFn,
13+
FeatureRemoteConfig,
1114
Features,
15+
FullFeatureOverride,
1216
HttpClient,
1317
HttpClientResponse,
1418
IdType,
1519
LOG_LEVELS,
1620
Logger,
1721
LogLevel,
1822
RawFeature,
23+
RawFeatureRemoteConfig,
1924
TrackingMeta,
2025
TrackOptions,
26+
TypedFeatureKey,
2127
TypedFeatures,
2228
} from "./types";

0 commit comments

Comments
 (0)