@pagelines/sdk 1.0.837 → 1.0.838

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,57 +0,0 @@
1
- import { MaybeRef } from 'vue';
2
- import { AgentConfig } from '@pagelines/core';
3
- import { WidgetConfig, WidgetUpdate, PLWidget } from '../PLWidget';
4
- export interface UsePLWidgetConfig {
5
- mode: WidgetConfig['mode'];
6
- handle?: MaybeRef<string | undefined>;
7
- agent?: MaybeRef<AgentConfig | null | undefined>;
8
- context?: MaybeRef<string | undefined>;
9
- firstMessage?: MaybeRef<string | undefined>;
10
- apiBase?: string;
11
- onClose?: () => void;
12
- }
13
- /**
14
- * Composable for managing PLWidget lifecycle with automatic initialization,
15
- * reactive updates, and cleanup.
16
- *
17
- * Benefits:
18
- * - Eliminates manual DOM timing coordination (watch + nextTick)
19
- * - Automatic cleanup on unmount
20
- * - Reactive prop updates via widget.update()
21
- * - Prevents double initialization
22
- * - Clear loading/error states
23
- *
24
- * @example
25
- * ```vue
26
- * <script setup>
27
- * const agentRef = ref<Agent | null>(null)
28
- * const { containerRef, loading, error } = usePLWidget({
29
- * mode: 'inline',
30
- * agent: agentRef,
31
- * context: 'welcome'
32
- * })
33
- * </script>
34
- *
35
- * <template>
36
- * <div ref="containerRef" class="w-full h-full" />
37
- * </template>
38
- * ```
39
- */
40
- export declare function usePLWidget(config: UsePLWidgetConfig): {
41
- containerRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
42
- widget: import('vue').Ref<{
43
- update: (updates: WidgetUpdate) => void;
44
- toggle: () => void;
45
- open: () => void;
46
- close: () => void;
47
- destroy: () => void;
48
- } | null, PLWidget | {
49
- update: (updates: WidgetUpdate) => void;
50
- toggle: () => void;
51
- open: () => void;
52
- close: () => void;
53
- destroy: () => void;
54
- } | null>;
55
- loading: import('vue').Ref<boolean, boolean>;
56
- error: import('vue').Ref<string | null, string | null>;
57
- };