@alia.onl/sdk 3.1.5 → 3.1.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alia.onl/sdk",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "description": "Alia AI chat SDK — reusable chat UI, voice, and streaming components for Oxy apps",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useEffect, useRef } from 'react';
2
- import type { AudioPlayer, AudioPlaybackStatus } from 'expo-audio';
2
+ import type { AudioPlayer, AudioStatus } from 'expo-audio';
3
3
  import {
4
4
  useSharedValue,
5
5
  withRepeat,
@@ -126,7 +126,7 @@ export function useTTS(options: UseTTSOptions = {}) {
126
126
  const player = createAudioPlayer({ uri: audioUrl });
127
127
  playerRef.current = player;
128
128
 
129
- player.addListener('playbackStatusUpdate', (status: AudioPlaybackStatus) => {
129
+ player.addListener('playbackStatusUpdate', (status: AudioStatus) => {
130
130
  if (status.didJustFinish) {
131
131
  releasePlayer();
132
132
  reset();
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference path="./optional-deps.d.ts" />
1
+ /// <reference types="nativewind/types" />
2
2
  // @alia.onl/sdk — Alia AI Chat SDK
3
3
  // Reusable chat UI, voice, and streaming components for Oxy apps
4
4
 
@@ -1,147 +0,0 @@
1
- // NativeWind types — extends RN components with className prop
2
- /// <reference types="nativewind/types" />
3
-
4
- // Type declarations for optional peer dependencies.
5
- // These prevent TypeScript errors when the deps aren't installed.
6
- // At runtime, the host app provides the actual packages.
7
- //
8
- // NOTE: Only declare modules for packages NOT installed in the monorepo.
9
- // Installed packages (lucide-react-native, zeego, expo-image, etc.)
10
- // have their own real types — ambient declarations here would shadow them.
11
-
12
- declare module 'livekit-client' {
13
- export interface RemoteTrack {
14
- kind?: string;
15
- mediaStreamTrack?: MediaStreamTrack;
16
- attach(): HTMLMediaElement;
17
- detach(): HTMLMediaElement[];
18
- }
19
- export class Room {
20
- on<Args extends unknown[]>(event: string, listener: (...args: Args) => void): this;
21
- off<Args extends unknown[]>(event: string, listener: (...args: Args) => void): this;
22
- localParticipant: LocalParticipant;
23
- remoteParticipants: Map<string, RemoteParticipant>;
24
- connect(url: string, token: string, options?: Record<string, unknown>): Promise<void>;
25
- disconnect(): Promise<void>;
26
- state: string;
27
- }
28
- export class LocalParticipant {
29
- publishData(data: Uint8Array, options?: DataPublishOptions): Promise<void>;
30
- getTrackPublications(): Map<string, RemoteTrackPublication>;
31
- getTrackPublication(source: string): RemoteTrackPublication | undefined;
32
- setMicrophoneEnabled(enabled: boolean): Promise<void>;
33
- audioTrackPublications: Map<string, RemoteTrackPublication>;
34
- trackPublications: Map<string, RemoteTrackPublication>;
35
- }
36
- export class RemoteParticipant {
37
- getTrackPublications(): Map<string, RemoteTrackPublication>;
38
- audioTrackPublications: Map<string, RemoteTrackPublication>;
39
- trackPublications: Map<string, RemoteTrackPublication>;
40
- identity: string;
41
- }
42
- export class RemoteTrackPublication {
43
- track: RemoteTrack | null;
44
- source: string;
45
- kind: string;
46
- isSubscribed: boolean;
47
- trackSid: string;
48
- }
49
- export interface DataPublishOptions {
50
- reliable?: boolean;
51
- topic?: string;
52
- }
53
- export const RoomEvent: Record<string, string>;
54
- export const Track: { Source: Record<string, string>; Kind: Record<string, string> };
55
- export const DataPacket_Kind: Record<string, number>;
56
- export enum DisconnectReason {
57
- UNKNOWN_REASON = 0,
58
- CLIENT_INITIATED = 1,
59
- DUPLICATE_IDENTITY = 2,
60
- SERVER_SHUTDOWN = 3,
61
- PARTICIPANT_REMOVED = 4,
62
- ROOM_DELETED = 5,
63
- STATE_MISMATCH = 6,
64
- JOIN_FAILURE = 7,
65
- }
66
- }
67
-
68
- declare module 'expo-haptics' {
69
- export enum ImpactFeedbackStyle {
70
- Light = 'light',
71
- Medium = 'medium',
72
- Heavy = 'heavy',
73
- Soft = 'soft',
74
- Rigid = 'rigid',
75
- }
76
- export function impactAsync(style?: ImpactFeedbackStyle): Promise<void>;
77
- }
78
-
79
- declare module 'expo-audio' {
80
- export interface AudioPlaybackStatus {
81
- didJustFinish?: boolean;
82
- isLoaded?: boolean;
83
- playing?: boolean;
84
- }
85
- export interface AudioPlayer {
86
- addListener(event: 'playbackStatusUpdate', listener: (status: AudioPlaybackStatus) => void): { remove(): void };
87
- play(): void;
88
- pause(): void;
89
- seekTo(seconds: number): void;
90
- remove(): void;
91
- release(): void;
92
- }
93
- /** A URI object, a bundled asset module id (number), or a required asset. */
94
- export type AudioSource = { uri: string } | number;
95
- export interface RecordingPreset {
96
- isMeteringEnabled?: boolean;
97
- [key: string]: unknown;
98
- }
99
- export interface AudioMode {
100
- [key: string]: unknown;
101
- }
102
- export interface AudioRecorderState {
103
- metering?: number;
104
- isRecording?: boolean;
105
- durationMillis?: number;
106
- }
107
- export function createAudioPlayer(source: AudioSource): AudioPlayer;
108
- export function useAudioRecorder(preset: RecordingPreset): AudioRecorder;
109
- export function useAudioRecorderState(recorder: AudioRecorder, interval: number): AudioRecorderState;
110
- export function requestRecordingPermissionsAsync(): Promise<{ granted: boolean }>;
111
- export function getRecordingPermissionsAsync(): Promise<{ granted: boolean }>;
112
- export function setAudioModeAsync(mode: AudioMode): Promise<void>;
113
- export const RecordingPresets: { HIGH_QUALITY: RecordingPreset };
114
- export class AudioRecorder {
115
- constructor(preset: RecordingPreset);
116
- prepareToRecordAsync(): Promise<void>;
117
- record(): void;
118
- stop(): Promise<void>;
119
- uri: string | null;
120
- }
121
- }
122
-
123
- declare module 'expo-clipboard' {
124
- export function setStringAsync(text: string): Promise<boolean>;
125
- export function getStringAsync(): Promise<string>;
126
- }
127
-
128
- declare module 'expo-image-picker' {
129
- export interface ImagePickerAsset {
130
- uri: string;
131
- fileName?: string | null;
132
- fileSize?: number;
133
- mimeType?: string;
134
- }
135
- export interface ImagePickerOptions {
136
- allowsMultipleSelection?: boolean;
137
- mediaTypes?: string;
138
- aspect?: [number, number];
139
- quality?: number;
140
- }
141
- export interface ImagePickerResult {
142
- canceled: boolean;
143
- assets: ImagePickerAsset[];
144
- }
145
- export function launchImageLibraryAsync(options?: ImagePickerOptions): Promise<ImagePickerResult>;
146
- export const MediaTypeOptions: { Images: string; Videos: string; All: string };
147
- }