Skip to content

Commit

Permalink
Move useKrispNoiseFilter into dedicated import path (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO authored Oct 1, 2024
1 parent a1a4c66 commit a353a3b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
6 changes: 6 additions & 0 deletions .changeset/wise-doors-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@livekit/components-core": patch
"@livekit/components-react": patch
---

Add krisp hook
17 changes: 0 additions & 17 deletions packages/react/etc/components-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ import { ConnectionState as ConnectionState_2 } from 'livekit-client';
import type { CreateLocalTracksOptions } from 'livekit-client';
import type { DataPublishOptions } from 'livekit-client';
import type { HTMLAttributes } from 'react';
import type { KrispNoiseFilterProcessor } from '@livekit/krisp-noise-filter';
import { LocalAudioTrack } from 'livekit-client';
import { LocalParticipant } from 'livekit-client';
import type { LocalTrack } from 'livekit-client';
import { LocalTrackPublication } from 'livekit-client';
import { LocalVideoTrack } from 'livekit-client';
import type { MediaDeviceFailure } from 'livekit-client';
import type { NoiseFilterOptions } from '@livekit/krisp-noise-filter';
import { Participant } from 'livekit-client';
import type { ParticipantEvent } from 'livekit-client';
import type { ParticipantKind } from 'livekit-client';
Expand Down Expand Up @@ -885,21 +883,6 @@ export function useIsRecording(room?: Room): boolean;
// @public
export function useIsSpeaking(participant?: Participant): boolean;

// @alpha
export function useKrispNoiseFilter(options?: useKrispNoiseFilterOptions): {
setNoiseFilterEnabled: (enable: boolean) => Promise<void>;
isNoiseFilterEnabled: boolean;
isNoiseFilterPending: boolean;
processor: KrispNoiseFilterProcessor | undefined;
};

// @alpha (undocumented)
export interface useKrispNoiseFilterOptions {
// (undocumented)
filterOptions?: NoiseFilterOptions;
trackRef?: TrackReferenceOrPlaceholder;
}

// @public
export function useLayoutContext(): LayoutContextType;

Expand Down
5 changes: 5 additions & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
"types": "./dist/prefabs/index.d.ts",
"import": "./dist/prefabs/index.mjs",
"require": "./dist/prefabs/index.js"
},
"./krisp": {
"types": "./dist/hooks/cloud/krisp/useKrispNoiseFilter.d.ts",
"import": "./dist/hooks/cloud/krisp/useKrispNoiseFilter.mjs",
"require": "./dist/hooks/cloud/krisp/useKrispNoiseFilter.js"
}
},
"main": "dist/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ export * from './useTrackTranscription';
export * from './useVoiceAssistant';
export * from './useParticipantAttributes';
export * from './useIsRecording';
export { useKrispNoiseFilter, useKrispNoiseFilterOptions } from './cloud/krisp/useKrispNoiseFilter';
7 changes: 6 additions & 1 deletion packages/react/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import defaults from '../../tsup.config';

export default defineConfig({
...defaults,
entry: ['src/index.ts', 'src/hooks/index.ts', 'src/prefabs/index.ts'],
entry: [
'src/index.ts',
'src/hooks/index.ts',
'src/prefabs/index.ts',
'src/hooks/cloud/krisp/useKrispNoiseFilter.ts',
],
external: ['livekit-client', 'react', 'react-dom', '@livekit/krisp-noise-filter'],
});

0 comments on commit a353a3b

Please sign in to comment.