Skip to content

Commit 67b45b9

Browse files
committed
docs(types): add JSDoc for public utility types
1 parent 270f680 commit 67b45b9

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/loader.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,30 @@ const COMPONENT_LOAD_RETRY_MAX_DELAY_MS = 5_000
2323
const COMPONENT_LOAD_RETRY_MAX_FAILURES = 5
2424

2525
export interface ReactIslandsLoaderOptions {
26+
/**
27+
* Document to scan and observe.
28+
* @default global document
29+
*/
2630
document?: Document
31+
/**
32+
* CSS selector used to find island hosts.
33+
* @default '[data-fict-react]'
34+
*/
2735
selector?: string
36+
/**
37+
* Enable MutationObserver to auto-mount/dispose and refresh.
38+
* @default true
39+
*/
2840
observe?: boolean
41+
/**
42+
* Fallback client directive when host attribute is missing or invalid.
43+
* @default 'load'
44+
*/
2945
defaultClient?: ClientDirective
46+
/**
47+
* Root margin used by visible strategy observers.
48+
* @default '200px'
49+
*/
3050
visibleRootMargin?: string
3151
}
3252

src/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { BaseProps } from '@fictjs/runtime'
22
import type { ComponentType } from 'react'
33

4+
/**
5+
* Controls when the React island mounts on the client.
6+
*/
47
export type ClientDirective = 'load' | 'idle' | 'visible' | 'only'
58

69
export interface ReactInteropOptions {
@@ -30,8 +33,14 @@ export interface ReactInteropOptions {
3033
actionProps?: string[]
3134
}
3235

36+
/**
37+
* Static value or lazy accessor used by Fict props.
38+
*/
3339
export type MaybeAccessor<T> = T | (() => T)
3440

41+
/**
42+
* Serializable marker payload used to represent a React action callback.
43+
*/
3544
export interface ReactActionRef {
3645
__fictReactActionMarker: 'fict.react.action.v1'
3746
__fictReactActionQrl: string

0 commit comments

Comments
 (0)